@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.mjs
CHANGED
|
@@ -1506,7 +1506,7 @@ var UserConfig = z17.object({
|
|
|
1506
1506
|
});
|
|
1507
1507
|
|
|
1508
1508
|
// src/schema/widgetData.ts
|
|
1509
|
-
import { z as
|
|
1509
|
+
import { z as z48 } from "zod";
|
|
1510
1510
|
|
|
1511
1511
|
// src/schema/widgets/abTestingPlaceholder.ts
|
|
1512
1512
|
import { z as z18 } from "zod";
|
|
@@ -1624,6 +1624,8 @@ var languageKeys = [
|
|
|
1624
1624
|
"zh"
|
|
1625
1625
|
];
|
|
1626
1626
|
var LanguageKey = freezeEnum(languageKeys);
|
|
1627
|
+
var layoutFrames = ["callout", "offer-content"];
|
|
1628
|
+
var LayoutFrame = freezeEnum(layoutFrames);
|
|
1627
1629
|
var mutatorEvents = ["item_added", "quantity_changed", "variant_selected"];
|
|
1628
1630
|
var MutatorEvent = freezeEnum(mutatorEvents);
|
|
1629
1631
|
var objectFits = ["cover", "contain"];
|
|
@@ -1668,6 +1670,7 @@ var sectionTypes = [
|
|
|
1668
1670
|
"progressBar",
|
|
1669
1671
|
"quantity",
|
|
1670
1672
|
"reviews",
|
|
1673
|
+
"separator",
|
|
1671
1674
|
"text",
|
|
1672
1675
|
"variants"
|
|
1673
1676
|
];
|
|
@@ -1777,17 +1780,17 @@ var CheckoutExtension = z19.looseObject({
|
|
|
1777
1780
|
});
|
|
1778
1781
|
|
|
1779
1782
|
// src/schema/widgets/contentBlock.ts
|
|
1780
|
-
import { z as
|
|
1783
|
+
import { z as z42 } from "zod";
|
|
1781
1784
|
|
|
1782
1785
|
// src/schema/widgets/checkout-and-beyond/root.ts
|
|
1783
|
-
import { z as
|
|
1786
|
+
import { z as z41 } from "zod";
|
|
1784
1787
|
|
|
1785
1788
|
// src/schema/widgets/checkout-and-beyond/layout.ts
|
|
1786
|
-
import { v7 as
|
|
1787
|
-
import { z as
|
|
1789
|
+
import { v7 as uuidv713 } from "uuid";
|
|
1790
|
+
import { z as z40 } from "zod";
|
|
1788
1791
|
|
|
1789
1792
|
// src/schema/widgets/checkout-and-beyond/shared.ts
|
|
1790
|
-
import { z as
|
|
1793
|
+
import { z as z39 } from "zod";
|
|
1791
1794
|
|
|
1792
1795
|
// src/schema/widgets/checkout-and-beyond/banner.ts
|
|
1793
1796
|
import { z as z20 } from "zod";
|
|
@@ -2912,35 +2915,53 @@ var CABReviewsSection = z36.object({
|
|
|
2912
2915
|
name: z36.string().optional(),
|
|
2913
2916
|
sectionId: z36.uuid().default(() => uuidv710()),
|
|
2914
2917
|
sectionType: z36.literal(SectionType.reviews).default(SectionType.reviews),
|
|
2915
|
-
size: z36.enum(reviewsSizes).default(ReviewsSize.default)
|
|
2918
|
+
size: z36.enum(reviewsSizes).default(ReviewsSize.default),
|
|
2919
|
+
/**
|
|
2920
|
+
* Star outline color, interpolated into a style by the renderer, so it is hex-constrained like
|
|
2921
|
+
* `CABButtonSection.color`. The legacy source (`PostPurchaseSettings.styles.starStrokeColor`) is a free
|
|
2922
|
+
* string: its converter must validate and fall back to this default rather than let one odd value drop
|
|
2923
|
+
* the whole reviews section.
|
|
2924
|
+
*/
|
|
2925
|
+
strokeColor: z36.string().regex(HEX_COLOR_REGEX).default("#fadb14"),
|
|
2926
|
+
/** Star outline width in px; `0` draws no outline. The legacy `styles.strokeWidth` is a STRING ('1') — its converter coerces. */
|
|
2927
|
+
strokeWidth: z36.number().nonnegative().default(0)
|
|
2916
2928
|
});
|
|
2917
2929
|
|
|
2918
|
-
// src/schema/widgets/checkout-and-beyond/
|
|
2919
|
-
import { slice } from "es-toolkit/compat";
|
|
2930
|
+
// src/schema/widgets/checkout-and-beyond/separator.ts
|
|
2920
2931
|
import { v7 as uuidv711 } from "uuid";
|
|
2921
2932
|
import { z as z37 } from "zod";
|
|
2922
|
-
var
|
|
2933
|
+
var CABSeparatorSection = z37.object({
|
|
2923
2934
|
...CABVariableFields,
|
|
2924
|
-
hideOutOfStockVariants: z37.boolean().default(false),
|
|
2925
|
-
name: z37.string().optional(),
|
|
2926
2935
|
sectionId: z37.uuid().default(() => uuidv711()),
|
|
2927
|
-
sectionType: z37.literal(SectionType.
|
|
2928
|
-
|
|
2929
|
-
|
|
2936
|
+
sectionType: z37.literal(SectionType.separator).default(SectionType.separator)
|
|
2937
|
+
});
|
|
2938
|
+
|
|
2939
|
+
// src/schema/widgets/checkout-and-beyond/variants.ts
|
|
2940
|
+
import { slice } from "es-toolkit/compat";
|
|
2941
|
+
import { v7 as uuidv712 } from "uuid";
|
|
2942
|
+
import { z as z38 } from "zod";
|
|
2943
|
+
var CABVariantsSection = z38.object({
|
|
2944
|
+
...CABVariableFields,
|
|
2945
|
+
hideOutOfStockVariants: z38.boolean().default(false),
|
|
2946
|
+
name: z38.string().optional(),
|
|
2947
|
+
sectionId: z38.uuid().default(() => uuidv712()),
|
|
2948
|
+
sectionType: z38.literal(SectionType.variants).default(SectionType.variants),
|
|
2949
|
+
selector: z38.enum(slice(variantSelectors, 0, 3)).default(VariantSelector.menu),
|
|
2950
|
+
variantMode: z38.enum(variantModes).default(VariantMode.multiple)
|
|
2930
2951
|
});
|
|
2931
2952
|
|
|
2932
2953
|
// src/schema/widgets/checkout-and-beyond/shared.ts
|
|
2933
|
-
var CABBorder =
|
|
2934
|
-
radius:
|
|
2935
|
-
style:
|
|
2936
|
-
width:
|
|
2954
|
+
var CABBorder = z39.object({
|
|
2955
|
+
radius: z39.enum(borderRadii).default(BorderRadius.base),
|
|
2956
|
+
style: z39.enum(borderStyles).default(BorderStyle.none),
|
|
2957
|
+
width: z39.enum(borderWidths).default(BorderWidth.base)
|
|
2937
2958
|
}).default({
|
|
2938
2959
|
radius: BorderRadius.base,
|
|
2939
2960
|
style: BorderStyle.none,
|
|
2940
2961
|
width: BorderWidth.base
|
|
2941
2962
|
});
|
|
2942
|
-
var CABSection =
|
|
2943
|
-
() =>
|
|
2963
|
+
var CABSection = z39.lazy(
|
|
2964
|
+
() => z39.discriminatedUnion("sectionType", [
|
|
2944
2965
|
CABBannerSection,
|
|
2945
2966
|
CABButtonSection,
|
|
2946
2967
|
CABCarouselSection,
|
|
@@ -2956,38 +2977,49 @@ var CABSection = z38.lazy(
|
|
|
2956
2977
|
CABProgressBarSection,
|
|
2957
2978
|
CABQuantitySection,
|
|
2958
2979
|
CABReviewsSection,
|
|
2980
|
+
CABSeparatorSection,
|
|
2959
2981
|
CABTextSection,
|
|
2960
2982
|
CABVariantsSection
|
|
2961
2983
|
])
|
|
2962
2984
|
);
|
|
2963
2985
|
|
|
2964
2986
|
// src/schema/widgets/checkout-and-beyond/layout.ts
|
|
2965
|
-
var GridItem =
|
|
2966
|
-
var
|
|
2987
|
+
var GridItem = z40.union([z40.literal("auto"), z40.literal("fill"), z40.string().regex(/^\d+%$/), z40.number()]);
|
|
2988
|
+
var CABLayoutWrapping = z40.object({
|
|
2989
|
+
breakAt: z40.number().positive(),
|
|
2990
|
+
maxPerLine: z40.number().int().positive()
|
|
2991
|
+
});
|
|
2992
|
+
var CABLayoutSection = z40.object({
|
|
2967
2993
|
...CABVariableFields,
|
|
2968
|
-
alignment:
|
|
2969
|
-
horizontal:
|
|
2970
|
-
vertical:
|
|
2994
|
+
alignment: z40.object({
|
|
2995
|
+
horizontal: z40.enum(horizontalAlignments).default(HorizontalAlignment.start),
|
|
2996
|
+
vertical: z40.enum(verticalAlignments).default(VerticalAlignment.top)
|
|
2971
2997
|
}).default({
|
|
2972
2998
|
horizontal: HorizontalAlignment.start,
|
|
2973
2999
|
vertical: VerticalAlignment.top
|
|
2974
3000
|
}),
|
|
2975
|
-
border:
|
|
2976
|
-
buttonField:
|
|
2977
|
-
direction:
|
|
2978
|
-
|
|
2979
|
-
|
|
2980
|
-
|
|
3001
|
+
border: z40.lazy(() => CABBorder),
|
|
3002
|
+
buttonField: z40.enum(buttonFields).optional(),
|
|
3003
|
+
direction: z40.enum(directions).default(Direction.rows),
|
|
3004
|
+
/**
|
|
3005
|
+
* Platform chrome around the section, not a layout behavior: `callout` is a subdued box with block borders
|
|
3006
|
+
* (the legacy post-purchase callout banner), `offer-content` the post-purchase offer's own content card.
|
|
3007
|
+
*/
|
|
3008
|
+
frame: z40.enum(layoutFrames).optional(),
|
|
3009
|
+
grid: z40.object({
|
|
3010
|
+
columns: z40.union([z40.array(GridItem), z40.undefined()]).default(() => ["auto"]),
|
|
3011
|
+
rows: z40.union([z40.array(GridItem), z40.undefined()]).default(() => ["auto"])
|
|
2981
3012
|
}).default({ columns: ["auto"], rows: ["auto"] }).optional(),
|
|
2982
|
-
name:
|
|
2983
|
-
padding:
|
|
2984
|
-
sectionId:
|
|
2985
|
-
sections:
|
|
2986
|
-
sectionType:
|
|
2987
|
-
spacing:
|
|
3013
|
+
name: z40.string().optional(),
|
|
3014
|
+
padding: z40.enum(spacings).default(Spacing.none),
|
|
3015
|
+
sectionId: z40.uuid().default(() => uuidv713()),
|
|
3016
|
+
sections: z40.union([z40.array(z40.lazy(() => CABSection)), z40.strictObject({}).transform(() => [])]).default(() => []),
|
|
3017
|
+
sectionType: z40.literal(SectionType.layout).default(SectionType.layout),
|
|
3018
|
+
spacing: z40.enum(spacings).default(Spacing.base),
|
|
2988
3019
|
/** Fire-and-forget impression pixel POSTed once when the section is shown (e.g. a Monetize offer view). */
|
|
2989
|
-
viewUrl:
|
|
2990
|
-
width:
|
|
3020
|
+
viewUrl: z40.string().optional(),
|
|
3021
|
+
width: z40.number().default(100),
|
|
3022
|
+
wrapping: CABLayoutWrapping.optional()
|
|
2991
3023
|
});
|
|
2992
3024
|
|
|
2993
3025
|
// src/schema/widgets/checkout-and-beyond/uiLabels.ts
|
|
@@ -3008,8 +3040,8 @@ var UI_LABELS = {
|
|
|
3008
3040
|
};
|
|
3009
3041
|
|
|
3010
3042
|
// src/schema/widgets/checkout-and-beyond/root.ts
|
|
3011
|
-
var localized = (fallback) =>
|
|
3012
|
-
var CABUILabels =
|
|
3043
|
+
var localized = (fallback) => z41.record(z41.string(), z41.string()).default(() => ({ ...fallback })).transform((labels) => Object.keys(labels).length > 0 ? labels : { ...fallback });
|
|
3044
|
+
var CABUILabels = z41.object({
|
|
3013
3045
|
currentPage: localized(UI_LABELS.currentPage),
|
|
3014
3046
|
guest: localized(UI_LABELS.guest),
|
|
3015
3047
|
loadingOptions: localized(UI_LABELS.loadingOptions),
|
|
@@ -3034,154 +3066,154 @@ var CABUILabels = z40.object({
|
|
|
3034
3066
|
subscriptionOptions: { ...UI_LABELS.subscriptionOptions },
|
|
3035
3067
|
updating: { ...UI_LABELS.updating }
|
|
3036
3068
|
}));
|
|
3037
|
-
var TargetArea =
|
|
3038
|
-
fill:
|
|
3039
|
-
flip:
|
|
3040
|
-
icon:
|
|
3041
|
-
label:
|
|
3042
|
-
width:
|
|
3069
|
+
var TargetArea = z41.object({
|
|
3070
|
+
fill: z41.boolean().optional(),
|
|
3071
|
+
flip: z41.enum(["both", "horizontal", "vertical"]).optional(),
|
|
3072
|
+
icon: z41.string(),
|
|
3073
|
+
label: z41.string(),
|
|
3074
|
+
width: z41.string()
|
|
3043
3075
|
}).default(targetAreas[EditorMode.checkoutExtension][1]);
|
|
3044
|
-
var CABTracking =
|
|
3045
|
-
enableAttribution:
|
|
3046
|
-
enableSource:
|
|
3047
|
-
enableWidget:
|
|
3076
|
+
var CABTracking = z41.object({
|
|
3077
|
+
enableAttribution: z41.boolean().nullish().transform((value) => value ?? true),
|
|
3078
|
+
enableSource: z41.boolean().nullish().transform((value) => value ?? true),
|
|
3079
|
+
enableWidget: z41.boolean().nullish().transform((value) => value ?? true)
|
|
3048
3080
|
}).nullish().transform((value) => value ?? { enableAttribution: true, enableSource: true, enableWidget: true });
|
|
3049
|
-
var CABExperiment =
|
|
3050
|
-
elementId:
|
|
3051
|
-
experimentId:
|
|
3052
|
-
experimentType:
|
|
3053
|
-
selectedId:
|
|
3081
|
+
var CABExperiment = z41.object({
|
|
3082
|
+
elementId: z41.number(),
|
|
3083
|
+
experimentId: z41.number(),
|
|
3084
|
+
experimentType: z41.string(),
|
|
3085
|
+
selectedId: z41.number()
|
|
3054
3086
|
});
|
|
3055
3087
|
var CABRootSection = CABLayoutSection.extend({
|
|
3056
|
-
editorMode:
|
|
3088
|
+
editorMode: z41.enum(editorModes).default(EditorMode.checkoutExtension),
|
|
3057
3089
|
experiment: CABExperiment.optional(),
|
|
3058
3090
|
// Same rule as CABTracking above: the v1 converters pass raw legacy `previewMode` through, so a
|
|
3059
3091
|
// `null` must fall back rather than throw the widget; malformed values still throw.
|
|
3060
|
-
previewMode:
|
|
3061
|
-
storeId:
|
|
3092
|
+
previewMode: z41.boolean().nullish().transform((value) => value ?? false),
|
|
3093
|
+
storeId: z41.number().nullable().default(null),
|
|
3062
3094
|
targetArea: TargetArea.nullable(),
|
|
3063
3095
|
tracking: CABTracking,
|
|
3064
|
-
type:
|
|
3096
|
+
type: z41.enum(widgetTypes).default(WidgetType.ui_extension_content_block),
|
|
3065
3097
|
uiLabels: CABUILabels,
|
|
3066
|
-
version:
|
|
3067
|
-
widgetId:
|
|
3098
|
+
version: z41.literal(2).default(2),
|
|
3099
|
+
widgetId: z41.number().nullable().default(null)
|
|
3068
3100
|
});
|
|
3069
3101
|
|
|
3070
3102
|
// src/schema/widgets/contentBlock.ts
|
|
3071
|
-
var ContentBlockV1 =
|
|
3072
|
-
blockSpacing:
|
|
3073
|
-
imageBlocks:
|
|
3074
|
-
|
|
3075
|
-
|
|
3076
|
-
altText:
|
|
3077
|
-
description:
|
|
3078
|
-
id:
|
|
3079
|
-
imagePlacement:
|
|
3080
|
-
imageSize:
|
|
3081
|
-
imageUrl:
|
|
3082
|
-
textAlignment:
|
|
3103
|
+
var ContentBlockV1 = z42.object({
|
|
3104
|
+
blockSpacing: z42.enum(spacings).optional(),
|
|
3105
|
+
imageBlocks: z42.union([
|
|
3106
|
+
z42.array(
|
|
3107
|
+
z42.object({
|
|
3108
|
+
altText: z42.string().nullable(),
|
|
3109
|
+
description: z42.string().nullable(),
|
|
3110
|
+
id: z42.uuid(),
|
|
3111
|
+
imagePlacement: z42.enum(["top", "right", "bottom", "left"]),
|
|
3112
|
+
imageSize: z42.number(),
|
|
3113
|
+
imageUrl: z42.url(),
|
|
3114
|
+
textAlignment: z42.enum(["left", "center", "right"]),
|
|
3083
3115
|
/** Inline scale only: an image caption can never be a block-level heading. */
|
|
3084
|
-
textSize:
|
|
3116
|
+
textSize: z42.enum(inlineTextSizeNames)
|
|
3085
3117
|
})
|
|
3086
3118
|
),
|
|
3087
|
-
|
|
3119
|
+
z42.strictObject({}).transform(() => [])
|
|
3088
3120
|
]).optional(),
|
|
3089
|
-
imageLayout:
|
|
3090
|
-
language:
|
|
3091
|
-
description:
|
|
3092
|
-
superTitle:
|
|
3093
|
-
title:
|
|
3121
|
+
imageLayout: z42.enum(["row", "column"]).optional(),
|
|
3122
|
+
language: z42.object({
|
|
3123
|
+
description: z42.string(),
|
|
3124
|
+
superTitle: z42.string(),
|
|
3125
|
+
title: z42.string()
|
|
3094
3126
|
}),
|
|
3095
|
-
previewMode:
|
|
3096
|
-
type:
|
|
3097
|
-
version:
|
|
3127
|
+
previewMode: z42.boolean(),
|
|
3128
|
+
type: z42.literal(WidgetType.ui_extension_content_block).default(WidgetType.ui_extension_content_block),
|
|
3129
|
+
version: z42.literal(1)
|
|
3098
3130
|
});
|
|
3099
|
-
var ContentBlock =
|
|
3131
|
+
var ContentBlock = z42.discriminatedUnion("version", [
|
|
3100
3132
|
ContentBlockV1,
|
|
3101
3133
|
CABRootSection.extend({
|
|
3102
|
-
type:
|
|
3134
|
+
type: z42.literal(WidgetType.ui_extension_content_block).default(WidgetType.ui_extension_content_block)
|
|
3103
3135
|
})
|
|
3104
3136
|
]);
|
|
3105
3137
|
|
|
3106
3138
|
// src/schema/widgets/giftWithPurchase.ts
|
|
3107
|
-
import { z as
|
|
3108
|
-
var GiftWithPurchase =
|
|
3109
|
-
type:
|
|
3139
|
+
import { z as z43 } from "zod";
|
|
3140
|
+
var GiftWithPurchase = z43.looseObject({
|
|
3141
|
+
type: z43.literal(WidgetType.gift_with_purchase).default(WidgetType.gift_with_purchase)
|
|
3110
3142
|
});
|
|
3111
3143
|
|
|
3112
3144
|
// src/schema/widgets/lineItemEditor.ts
|
|
3113
|
-
import { z as
|
|
3114
|
-
var LineItemEditorSwitchLanguageV1 =
|
|
3115
|
-
downgradeToOneTimeLabel:
|
|
3145
|
+
import { z as z44 } from "zod";
|
|
3146
|
+
var LineItemEditorSwitchLanguageV1 = z44.object({
|
|
3147
|
+
downgradeToOneTimeLabel: z44.string().optional(),
|
|
3116
3148
|
/** Frequency-option template (`{{frequency}}`/`{{interval}}`) for the plan select. */
|
|
3117
|
-
subscriptionOptionLabel:
|
|
3118
|
-
upgradeToSubscriptionLabel:
|
|
3119
|
-
upgradeToSubscriptionWithoutDiscountLabel:
|
|
3149
|
+
subscriptionOptionLabel: z44.string().optional(),
|
|
3150
|
+
upgradeToSubscriptionLabel: z44.string().optional(),
|
|
3151
|
+
upgradeToSubscriptionWithoutDiscountLabel: z44.string().optional()
|
|
3120
3152
|
});
|
|
3121
|
-
var LineItemEditorV1 =
|
|
3153
|
+
var LineItemEditorV1 = z44.object({
|
|
3122
3154
|
/** Legacy `getStyles` button style; the converter carries a valid kind, defaulting to `plain`. */
|
|
3123
|
-
button:
|
|
3124
|
-
previewMode:
|
|
3125
|
-
switchToSubscription:
|
|
3126
|
-
disableDowngrade:
|
|
3155
|
+
button: z44.object({ kind: z44.enum(["plain", "primary", "secondary"]).optional() }).optional(),
|
|
3156
|
+
previewMode: z44.boolean().optional(),
|
|
3157
|
+
switchToSubscription: z44.object({
|
|
3158
|
+
disableDowngrade: z44.boolean().optional(),
|
|
3127
3159
|
language: LineItemEditorSwitchLanguageV1.optional()
|
|
3128
3160
|
}).optional(),
|
|
3129
|
-
switchToSubscriptionEnabled:
|
|
3130
|
-
tracking:
|
|
3131
|
-
enableAttribution:
|
|
3132
|
-
enableSource:
|
|
3133
|
-
enableWidget:
|
|
3161
|
+
switchToSubscriptionEnabled: z44.boolean().optional(),
|
|
3162
|
+
tracking: z44.object({
|
|
3163
|
+
enableAttribution: z44.boolean().optional(),
|
|
3164
|
+
enableSource: z44.boolean().optional(),
|
|
3165
|
+
enableWidget: z44.boolean().optional()
|
|
3134
3166
|
}).optional(),
|
|
3135
|
-
type:
|
|
3136
|
-
version:
|
|
3167
|
+
type: z44.literal(WidgetType.ui_extension_line_item_editor).default(WidgetType.ui_extension_line_item_editor),
|
|
3168
|
+
version: z44.literal(1)
|
|
3137
3169
|
});
|
|
3138
|
-
var LineItemEditor =
|
|
3170
|
+
var LineItemEditor = z44.discriminatedUnion("version", [
|
|
3139
3171
|
LineItemEditorV1,
|
|
3140
3172
|
CABRootSection.extend({
|
|
3141
|
-
type:
|
|
3173
|
+
type: z44.literal(WidgetType.ui_extension_line_item_editor).default(WidgetType.ui_extension_line_item_editor)
|
|
3142
3174
|
})
|
|
3143
3175
|
]);
|
|
3144
3176
|
|
|
3145
3177
|
// src/schema/widgets/progressBar.ts
|
|
3146
|
-
import { z as
|
|
3147
|
-
var ProgressBar =
|
|
3148
|
-
type:
|
|
3178
|
+
import { z as z45 } from "zod";
|
|
3179
|
+
var ProgressBar = z45.looseObject({
|
|
3180
|
+
type: z45.literal(WidgetType.ui_extension_progress_bar).default(WidgetType.ui_extension_progress_bar)
|
|
3149
3181
|
});
|
|
3150
3182
|
|
|
3151
3183
|
// src/schema/widgets/rebuyButton.ts
|
|
3152
|
-
import { z as
|
|
3153
|
-
var RebuyButtonV1 =
|
|
3154
|
-
type:
|
|
3155
|
-
version:
|
|
3184
|
+
import { z as z46 } from "zod";
|
|
3185
|
+
var RebuyButtonV1 = z46.looseObject({
|
|
3186
|
+
type: z46.literal(WidgetType.ui_extension_button).default(WidgetType.ui_extension_button),
|
|
3187
|
+
version: z46.literal(1)
|
|
3156
3188
|
});
|
|
3157
|
-
var RebuyButton =
|
|
3189
|
+
var RebuyButton = z46.discriminatedUnion("version", [
|
|
3158
3190
|
RebuyButtonV1,
|
|
3159
3191
|
CABRootSection.extend({
|
|
3160
|
-
type:
|
|
3192
|
+
type: z46.literal(WidgetType.ui_extension_button).default(WidgetType.ui_extension_button)
|
|
3161
3193
|
})
|
|
3162
3194
|
]);
|
|
3163
3195
|
|
|
3164
3196
|
// src/schema/widgets/rebuyMonetize.ts
|
|
3165
|
-
import { z as
|
|
3166
|
-
var RebuyMonetize =
|
|
3167
|
-
type:
|
|
3197
|
+
import { z as z47 } from "zod";
|
|
3198
|
+
var RebuyMonetize = z47.looseObject({
|
|
3199
|
+
type: z47.literal(WidgetType.ui_extension_ad).default(WidgetType.ui_extension_ad)
|
|
3168
3200
|
});
|
|
3169
|
-
var RebuyMonetizeV1 =
|
|
3170
|
-
name:
|
|
3171
|
-
previewMode:
|
|
3201
|
+
var RebuyMonetizeV1 = z47.object({
|
|
3202
|
+
name: z47.string().nullable().optional(),
|
|
3203
|
+
previewMode: z47.boolean().optional(),
|
|
3172
3204
|
/** Privacy Policy footer href → the marker section's `privacyPolicyUrl`. */
|
|
3173
|
-
privacyPolicyUrl:
|
|
3205
|
+
privacyPolicyUrl: z47.string().nullable().optional(),
|
|
3174
3206
|
/** Ads-taxonomy sub-vertical id — one of the admin Monetize editor's two configurables. */
|
|
3175
|
-
subVertical:
|
|
3176
|
-
tracking:
|
|
3177
|
-
enableAttribution:
|
|
3178
|
-
enableSource:
|
|
3179
|
-
enableWidget:
|
|
3207
|
+
subVertical: z47.string().nullable().optional(),
|
|
3208
|
+
tracking: z47.object({
|
|
3209
|
+
enableAttribution: z47.boolean().optional(),
|
|
3210
|
+
enableSource: z47.boolean().optional(),
|
|
3211
|
+
enableWidget: z47.boolean().optional()
|
|
3180
3212
|
}).optional(),
|
|
3181
|
-
type:
|
|
3182
|
-
version:
|
|
3213
|
+
type: z47.literal(WidgetType.ui_extension_ad).default(WidgetType.ui_extension_ad),
|
|
3214
|
+
version: z47.literal(1),
|
|
3183
3215
|
/** Ads-taxonomy vertical id — one of the admin Monetize editor's two configurables. */
|
|
3184
|
-
vertical:
|
|
3216
|
+
vertical: z47.string().nullable().optional()
|
|
3185
3217
|
});
|
|
3186
3218
|
|
|
3187
3219
|
// src/schema/widgetData.ts
|
|
@@ -3195,7 +3227,7 @@ var extensionWidgetTypes = [
|
|
|
3195
3227
|
WidgetType.ui_extension_line_item_editor,
|
|
3196
3228
|
WidgetType.ui_extension_progress_bar
|
|
3197
3229
|
];
|
|
3198
|
-
var WidgetData =
|
|
3230
|
+
var WidgetData = z48.discriminatedUnion("type", [
|
|
3199
3231
|
ABTestingPlaceholder,
|
|
3200
3232
|
CheckoutExtension,
|
|
3201
3233
|
ContentBlock,
|
|
@@ -3556,15 +3588,15 @@ var SWITCH_LABELS = {
|
|
|
3556
3588
|
|
|
3557
3589
|
// src/schema/widgets/post-purchase-offer/common.ts
|
|
3558
3590
|
import { replace, toNumber, toString } from "es-toolkit/compat";
|
|
3559
|
-
import { z as
|
|
3560
|
-
var strictNumber =
|
|
3561
|
-
|
|
3562
|
-
|
|
3563
|
-
|
|
3591
|
+
import { z as z49 } from "zod";
|
|
3592
|
+
var strictNumber = z49.union([
|
|
3593
|
+
z49.number(),
|
|
3594
|
+
z49.string().transform((value) => toNumber(replace(toString(value), /[^0-9.]/g, "")) || 0),
|
|
3595
|
+
z49.unknown().transform(() => 0)
|
|
3564
3596
|
]);
|
|
3565
3597
|
|
|
3566
3598
|
// src/schema/widgets/post-purchase-offer/constants.ts
|
|
3567
|
-
import { z as
|
|
3599
|
+
import { z as z50 } from "zod";
|
|
3568
3600
|
var blockTypes = [
|
|
3569
3601
|
"callout_banner",
|
|
3570
3602
|
"image",
|
|
@@ -3575,144 +3607,144 @@ var blockTypes = [
|
|
|
3575
3607
|
"text",
|
|
3576
3608
|
"timer"
|
|
3577
3609
|
];
|
|
3578
|
-
var blockType =
|
|
3610
|
+
var blockType = z50.enum(blockTypes);
|
|
3579
3611
|
var BlockType = blockType.enum;
|
|
3580
3612
|
|
|
3581
3613
|
// src/schema/widgets/post-purchase-offer/postPurchaseBlocks.ts
|
|
3582
3614
|
import { get as get3, isEqual } from "es-toolkit/compat";
|
|
3583
3615
|
import { v4 as uuidv42 } from "uuid";
|
|
3584
|
-
import { z as
|
|
3585
|
-
var TextAlignment2 =
|
|
3586
|
-
var TextSize =
|
|
3587
|
-
|
|
3588
|
-
|
|
3616
|
+
import { z as z51 } from "zod";
|
|
3617
|
+
var TextAlignment2 = z51.union([z51.enum(["leading", "center", "trailing"]), z51.unknown().transform(() => "leading")]);
|
|
3618
|
+
var TextSize = z51.union([
|
|
3619
|
+
z51.enum(["xsmall", "small", "base", "default", "medium", "large", "xlarge"]),
|
|
3620
|
+
z51.unknown().transform(() => "medium")
|
|
3589
3621
|
]);
|
|
3590
|
-
var CalloutBannerBlock =
|
|
3591
|
-
id:
|
|
3592
|
-
name:
|
|
3593
|
-
settings:
|
|
3594
|
-
superTitle:
|
|
3595
|
-
title:
|
|
3622
|
+
var CalloutBannerBlock = z51.object({
|
|
3623
|
+
id: z51.string().optional().default(() => uuidv42()),
|
|
3624
|
+
name: z51.string().optional(),
|
|
3625
|
+
settings: z51.object({
|
|
3626
|
+
superTitle: z51.union([z51.string(), TiptapDocument]).default(() => "Limited-time Offer"),
|
|
3627
|
+
title: z51.union([z51.string(), TiptapDocument]).default(() => "Add this customer favorite to your order")
|
|
3596
3628
|
}),
|
|
3597
|
-
styles:
|
|
3598
|
-
superTitleEmphasized:
|
|
3629
|
+
styles: z51.object({
|
|
3630
|
+
superTitleEmphasized: z51.boolean().default(false),
|
|
3599
3631
|
superTitleSize: TextSize.default("large"),
|
|
3600
3632
|
textAlignment: TextAlignment2.default("center"),
|
|
3601
|
-
titleEmphasized:
|
|
3633
|
+
titleEmphasized: z51.boolean().default(true),
|
|
3602
3634
|
titleSize: TextSize.default("large")
|
|
3603
3635
|
}),
|
|
3604
|
-
type:
|
|
3636
|
+
type: z51.literal(BlockType.callout_banner).default(BlockType.callout_banner)
|
|
3605
3637
|
});
|
|
3606
|
-
var ImageBlock =
|
|
3607
|
-
id:
|
|
3608
|
-
name:
|
|
3609
|
-
settings:
|
|
3610
|
-
|
|
3638
|
+
var ImageBlock = z51.object({
|
|
3639
|
+
id: z51.string().optional().default(() => uuidv42()),
|
|
3640
|
+
name: z51.string().optional(),
|
|
3641
|
+
settings: z51.union([
|
|
3642
|
+
z51.object({
|
|
3611
3643
|
/** This isn't used in the post-purchase offer widget */
|
|
3612
|
-
alt:
|
|
3613
|
-
image:
|
|
3614
|
-
imageSize:
|
|
3615
|
-
imageType:
|
|
3644
|
+
alt: z51.string().optional().default(""),
|
|
3645
|
+
image: z51.union([z51.literal(""), z51.url()]).default(""),
|
|
3646
|
+
imageSize: z51.number().default(20),
|
|
3647
|
+
imageType: z51.enum(["URL", "UPLOAD"]).default("URL")
|
|
3616
3648
|
}),
|
|
3617
|
-
|
|
3649
|
+
z51.array(z51.never()).transform(() => ({}))
|
|
3618
3650
|
]),
|
|
3619
|
-
type:
|
|
3651
|
+
type: z51.literal(BlockType.image).default(BlockType.image)
|
|
3620
3652
|
});
|
|
3621
|
-
var ImageContentBlock =
|
|
3622
|
-
id:
|
|
3623
|
-
name:
|
|
3624
|
-
settings:
|
|
3625
|
-
alt:
|
|
3626
|
-
description:
|
|
3653
|
+
var ImageContentBlock = z51.object({
|
|
3654
|
+
id: z51.string().optional().default(() => uuidv42()),
|
|
3655
|
+
name: z51.string().optional(),
|
|
3656
|
+
settings: z51.object({
|
|
3657
|
+
alt: z51.string().optional().default(""),
|
|
3658
|
+
description: z51.union([z51.string(), TiptapDocument, z51.null()]).default(
|
|
3627
3659
|
"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."
|
|
3628
3660
|
),
|
|
3629
3661
|
descriptionSize: TextSize.default("medium"),
|
|
3630
3662
|
horizontalAlignment: TextAlignment2.default("leading"),
|
|
3631
|
-
image:
|
|
3632
|
-
imagePlacement:
|
|
3633
|
-
imageSize:
|
|
3634
|
-
superTitle:
|
|
3663
|
+
image: z51.union([z51.literal(""), z51.url()]).default(""),
|
|
3664
|
+
imagePlacement: z51.enum(["bottom", "left", "right", "top"]).optional().default("left"),
|
|
3665
|
+
imageSize: z51.number().default(20),
|
|
3666
|
+
superTitle: z51.union([z51.string(), TiptapDocument]).default("Lorem Ipsum!"),
|
|
3635
3667
|
superTitleSize: TextSize.default("medium"),
|
|
3636
3668
|
/** This isn't configurable in the admin-nextjs editor */
|
|
3637
|
-
swapContent:
|
|
3638
|
-
title:
|
|
3669
|
+
swapContent: z51.boolean().optional().default(false),
|
|
3670
|
+
title: z51.union([z51.string(), TiptapDocument]).nullable().default("Lorem ipsum dolor sit amet"),
|
|
3639
3671
|
titleSize: TextSize.default("medium")
|
|
3640
3672
|
}),
|
|
3641
|
-
type:
|
|
3673
|
+
type: z51.literal(BlockType.image_content).default(BlockType.image_content)
|
|
3642
3674
|
});
|
|
3643
|
-
var PayButtonBlock =
|
|
3644
|
-
id:
|
|
3645
|
-
name:
|
|
3646
|
-
settings:
|
|
3647
|
-
|
|
3648
|
-
label:
|
|
3675
|
+
var PayButtonBlock = z51.object({
|
|
3676
|
+
id: z51.string().optional().default(() => uuidv42()),
|
|
3677
|
+
name: z51.string().optional(),
|
|
3678
|
+
settings: z51.union([
|
|
3679
|
+
z51.object({
|
|
3680
|
+
label: z51.string().default("Pay Now")
|
|
3649
3681
|
}),
|
|
3650
|
-
|
|
3682
|
+
z51.array(z51.never()).transform(() => ({
|
|
3651
3683
|
label: "Pay Now"
|
|
3652
3684
|
}))
|
|
3653
3685
|
]),
|
|
3654
|
-
styles:
|
|
3655
|
-
|
|
3656
|
-
buttonWidth:
|
|
3686
|
+
styles: z51.union([
|
|
3687
|
+
z51.object({
|
|
3688
|
+
buttonWidth: z51.number().min(10).max(100).default(50)
|
|
3657
3689
|
}),
|
|
3658
|
-
|
|
3690
|
+
z51.array(z51.never()).transform(() => ({
|
|
3659
3691
|
buttonWidth: 50
|
|
3660
3692
|
}))
|
|
3661
3693
|
]),
|
|
3662
|
-
type:
|
|
3694
|
+
type: z51.literal(BlockType.pay_button).default(BlockType.pay_button)
|
|
3663
3695
|
});
|
|
3664
|
-
var ProductInformationBlock =
|
|
3696
|
+
var ProductInformationBlock = z51.object({
|
|
3665
3697
|
/** This isn't configurable in the admin-nextjs editor */
|
|
3666
|
-
hideProductImage:
|
|
3667
|
-
id:
|
|
3668
|
-
name:
|
|
3669
|
-
type:
|
|
3698
|
+
hideProductImage: z51.boolean().optional().default(false),
|
|
3699
|
+
id: z51.string().optional().default(() => uuidv42()),
|
|
3700
|
+
name: z51.string().optional(),
|
|
3701
|
+
type: z51.literal(BlockType.product_information).default(BlockType.product_information)
|
|
3670
3702
|
});
|
|
3671
|
-
var SeparatorBlock =
|
|
3672
|
-
id:
|
|
3673
|
-
name:
|
|
3674
|
-
type:
|
|
3703
|
+
var SeparatorBlock = z51.object({
|
|
3704
|
+
id: z51.string().optional().default(() => uuidv42()),
|
|
3705
|
+
name: z51.string().optional(),
|
|
3706
|
+
type: z51.literal(BlockType.separator).default(BlockType.separator)
|
|
3675
3707
|
});
|
|
3676
|
-
var TextBlock =
|
|
3677
|
-
id:
|
|
3678
|
-
name:
|
|
3679
|
-
settings:
|
|
3680
|
-
description:
|
|
3708
|
+
var TextBlock = z51.object({
|
|
3709
|
+
id: z51.string().optional().default(() => uuidv42()),
|
|
3710
|
+
name: z51.string().optional(),
|
|
3711
|
+
settings: z51.object({
|
|
3712
|
+
description: z51.union([z51.string(), TiptapDocument]).optional().default(
|
|
3681
3713
|
"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."
|
|
3682
3714
|
),
|
|
3683
3715
|
/** This isn't used in the post-purchase offer widget */
|
|
3684
3716
|
descriptionSize: TextSize.default("medium"),
|
|
3685
3717
|
horizontalAlignment: TextAlignment2.default("leading"),
|
|
3686
|
-
superTitle:
|
|
3718
|
+
superTitle: z51.union([z51.string(), TiptapDocument]).default("Super Title"),
|
|
3687
3719
|
/** This isn't used in the post-purchase offer widget */
|
|
3688
3720
|
superTitleSize: TextSize.default("medium"),
|
|
3689
|
-
title:
|
|
3721
|
+
title: z51.union([z51.string(), TiptapDocument]).nullable().default("Lorem ipsum dolor sit amet."),
|
|
3690
3722
|
/** This isn't used in the post-purchase offer widget */
|
|
3691
3723
|
titleSize: TextSize.default("medium")
|
|
3692
3724
|
}),
|
|
3693
|
-
type:
|
|
3725
|
+
type: z51.literal(BlockType.text).default(BlockType.text)
|
|
3694
3726
|
});
|
|
3695
|
-
var TimerBlock =
|
|
3696
|
-
id:
|
|
3697
|
-
name:
|
|
3698
|
-
settings:
|
|
3699
|
-
durationMinutes:
|
|
3700
|
-
durationSeconds:
|
|
3701
|
-
endOffer:
|
|
3702
|
-
title:
|
|
3727
|
+
var TimerBlock = z51.object({
|
|
3728
|
+
id: z51.string().optional().default(() => uuidv42()),
|
|
3729
|
+
name: z51.string().optional(),
|
|
3730
|
+
settings: z51.object({
|
|
3731
|
+
durationMinutes: z51.number().min(0).default(10),
|
|
3732
|
+
durationSeconds: z51.union([z51.number().min(0), z51.unknown().transform(() => 0)]).default(0),
|
|
3733
|
+
endOffer: z51.boolean().default(true),
|
|
3734
|
+
title: z51.union([z51.string(), TiptapDocument]).default("Hurry \u2014 your special offer ends in:")
|
|
3703
3735
|
}),
|
|
3704
|
-
styles:
|
|
3736
|
+
styles: z51.object({
|
|
3705
3737
|
textAlignment: TextAlignment2.default("center"),
|
|
3706
|
-
timerBackgroundColor:
|
|
3707
|
-
timerEmphasized:
|
|
3738
|
+
timerBackgroundColor: z51.enum(["info", "warning", "success", "critical"]).default("warning"),
|
|
3739
|
+
timerEmphasized: z51.union([z51.boolean(), z51.unknown().transform(() => true)]).default(true),
|
|
3708
3740
|
timerSize: TextSize.default("medium"),
|
|
3709
|
-
timerWidth:
|
|
3710
|
-
titleEmphasized:
|
|
3741
|
+
timerWidth: z51.number().min(10).max(100).optional().default(100),
|
|
3742
|
+
titleEmphasized: z51.union([z51.boolean(), z51.unknown().transform(() => true)]).default(false),
|
|
3711
3743
|
titleSize: TextSize.default("medium")
|
|
3712
3744
|
}),
|
|
3713
|
-
type:
|
|
3745
|
+
type: z51.literal(BlockType.timer).default(BlockType.timer)
|
|
3714
3746
|
});
|
|
3715
|
-
var PostPurchaseBlock =
|
|
3747
|
+
var PostPurchaseBlock = z51.discriminatedUnion("type", [
|
|
3716
3748
|
CalloutBannerBlock,
|
|
3717
3749
|
ImageBlock,
|
|
3718
3750
|
ImageContentBlock,
|
|
@@ -3732,68 +3764,68 @@ var isTextBlock = (block) => isEqual(get3(block, "type"), BlockType.text);
|
|
|
3732
3764
|
var isTimerBlock = (block) => isEqual(get3(block, "type"), BlockType.timer);
|
|
3733
3765
|
|
|
3734
3766
|
// src/schema/widgets/post-purchase-offer/postPurchaseOffer.ts
|
|
3735
|
-
import { z as
|
|
3767
|
+
import { z as z54 } from "zod";
|
|
3736
3768
|
|
|
3737
3769
|
// src/schema/widgets/post-purchase-offer/postPurchaseWidget.ts
|
|
3738
|
-
import { z as
|
|
3770
|
+
import { z as z53 } from "zod";
|
|
3739
3771
|
|
|
3740
3772
|
// src/schema/widgets/post-purchase-offer/postPurchaseSettings.ts
|
|
3741
|
-
import { z as
|
|
3742
|
-
var PostPurchaseSettings =
|
|
3743
|
-
advance:
|
|
3744
|
-
blocks:
|
|
3773
|
+
import { z as z52 } from "zod";
|
|
3774
|
+
var PostPurchaseSettings = z52.object({
|
|
3775
|
+
advance: z52.object({ removePartialOrder: z52.boolean().default(true) }).optional().default(() => ({ removePartialOrder: true })),
|
|
3776
|
+
blocks: z52.union([z52.array(PostPurchaseBlock), z52.unknown().transform(() => [])]).default(() => [
|
|
3745
3777
|
PostPurchaseBlock.parse({ settings: {}, styles: {}, type: BlockType.timer }),
|
|
3746
3778
|
PostPurchaseBlock.parse({ settings: {}, styles: {}, type: BlockType.callout_banner }),
|
|
3747
3779
|
PostPurchaseBlock.parse({ type: BlockType.product_information })
|
|
3748
3780
|
]),
|
|
3749
|
-
columnLayout:
|
|
3750
|
-
discount:
|
|
3781
|
+
columnLayout: z52.boolean().optional(),
|
|
3782
|
+
discount: z52.object({
|
|
3751
3783
|
amount: strictNumber.default(30),
|
|
3752
|
-
shouldShowSavingText:
|
|
3753
|
-
type:
|
|
3784
|
+
shouldShowSavingText: z52.boolean().optional().default(true),
|
|
3785
|
+
type: z52.enum(["none", "fixed_amount", "percentage"]).default("none")
|
|
3754
3786
|
}),
|
|
3755
|
-
discountedFrom:
|
|
3756
|
-
endpoint:
|
|
3757
|
-
integrations:
|
|
3758
|
-
judgeme:
|
|
3759
|
-
junip:
|
|
3760
|
-
klaviyo:
|
|
3761
|
-
loox:
|
|
3762
|
-
okendo:
|
|
3763
|
-
opinew:
|
|
3764
|
-
reviewsio:
|
|
3765
|
-
stamped:
|
|
3766
|
-
yotpo:
|
|
3787
|
+
discountedFrom: z52.enum(["price", "compare_at_price"]).optional().default("price"),
|
|
3788
|
+
endpoint: z52.string().optional(),
|
|
3789
|
+
integrations: z52.object({
|
|
3790
|
+
judgeme: z52.boolean().default(false),
|
|
3791
|
+
junip: z52.boolean().optional().default(false),
|
|
3792
|
+
klaviyo: z52.boolean().default(false),
|
|
3793
|
+
loox: z52.boolean().default(false),
|
|
3794
|
+
okendo: z52.boolean().default(false),
|
|
3795
|
+
opinew: z52.boolean().optional().default(false),
|
|
3796
|
+
reviewsio: z52.boolean().optional().default(false),
|
|
3797
|
+
stamped: z52.boolean().default(false),
|
|
3798
|
+
yotpo: z52.boolean().default(false)
|
|
3767
3799
|
}),
|
|
3768
|
-
key:
|
|
3769
|
-
language:
|
|
3770
|
-
description:
|
|
3771
|
-
descriptionEnabled:
|
|
3772
|
-
descriptionRte:
|
|
3773
|
-
content:
|
|
3774
|
-
type:
|
|
3800
|
+
key: z52.string().optional(),
|
|
3801
|
+
language: z52.object({
|
|
3802
|
+
description: z52.union([z52.string(), z52.unknown().transform(() => "")]).default(""),
|
|
3803
|
+
descriptionEnabled: z52.boolean().optional().default(false),
|
|
3804
|
+
descriptionRte: z52.object({
|
|
3805
|
+
content: z52.array(z52.unknown()),
|
|
3806
|
+
type: z52.string()
|
|
3775
3807
|
}).optional(),
|
|
3776
|
-
descriptionSpacing:
|
|
3777
|
-
displayCtaPrice:
|
|
3778
|
-
global:
|
|
3779
|
-
declineAll:
|
|
3780
|
-
declineThisOffer:
|
|
3781
|
-
free:
|
|
3782
|
-
notAvailable:
|
|
3783
|
-
payNow:
|
|
3784
|
-
payNowUpgradeToSubscription:
|
|
3785
|
-
quantity:
|
|
3808
|
+
descriptionSpacing: z52.enum(["none", "xtight", "tight", "default", "loose", "xloose"]).optional(),
|
|
3809
|
+
displayCtaPrice: z52.boolean().default(true),
|
|
3810
|
+
global: z52.object({
|
|
3811
|
+
declineAll: z52.string().optional().default("Decline All"),
|
|
3812
|
+
declineThisOffer: z52.string().default("Decline this offer"),
|
|
3813
|
+
free: z52.string().optional().default("Free"),
|
|
3814
|
+
notAvailable: z52.string().optional().default("Not available"),
|
|
3815
|
+
payNow: z52.string().default("Pay Now"),
|
|
3816
|
+
payNowUpgradeToSubscription: z52.string().optional().default("Upgrade to Subscription"),
|
|
3817
|
+
quantity: z52.string().default("Quantity"),
|
|
3786
3818
|
/** This isn't configurable in the admin-nextjs editor */
|
|
3787
|
-
recurringShipping:
|
|
3788
|
-
recurringSubtotal:
|
|
3789
|
-
reviewsPlural:
|
|
3790
|
-
reviewsSingular:
|
|
3791
|
-
save:
|
|
3792
|
-
shipping:
|
|
3793
|
-
subscriptionOption:
|
|
3794
|
-
subtotal:
|
|
3795
|
-
taxes:
|
|
3796
|
-
total:
|
|
3819
|
+
recurringShipping: z52.string().optional().default("Recurring shipping"),
|
|
3820
|
+
recurringSubtotal: z52.string().default("Recurring subtotal"),
|
|
3821
|
+
reviewsPlural: z52.string().optional().default("Reviews"),
|
|
3822
|
+
reviewsSingular: z52.string().optional().default("Review"),
|
|
3823
|
+
save: z52.union([z52.string(), z52.unknown().transform(() => "Save")]).optional().default("Save"),
|
|
3824
|
+
shipping: z52.string().default("Shipping"),
|
|
3825
|
+
subscriptionOption: z52.string().optional().default("Subscribe and Save"),
|
|
3826
|
+
subtotal: z52.string().default("Subtotal"),
|
|
3827
|
+
taxes: z52.string().default("Taxes"),
|
|
3828
|
+
total: z52.string().default("Total")
|
|
3797
3829
|
}).optional().default(() => ({
|
|
3798
3830
|
declineAll: "Decline All",
|
|
3799
3831
|
declineThisOffer: "Decline this offer",
|
|
@@ -3814,70 +3846,70 @@ var PostPurchaseSettings = z51.object({
|
|
|
3814
3846
|
taxes: "Taxes",
|
|
3815
3847
|
total: "Total"
|
|
3816
3848
|
})),
|
|
3817
|
-
globalTranslation:
|
|
3849
|
+
globalTranslation: z52.string().optional().default("english")
|
|
3818
3850
|
}),
|
|
3819
|
-
metafields:
|
|
3851
|
+
metafields: z52.boolean().default(false),
|
|
3820
3852
|
/** This isn't configurable in the admin-nextjs editor */
|
|
3821
|
-
offer:
|
|
3822
|
-
count:
|
|
3853
|
+
offer: z52.object({
|
|
3854
|
+
count: z52.number().default(1)
|
|
3823
3855
|
}),
|
|
3824
|
-
offersLayout:
|
|
3825
|
-
itemsPerPage:
|
|
3826
|
-
type:
|
|
3856
|
+
offersLayout: z52.object({
|
|
3857
|
+
itemsPerPage: z52.number().optional(),
|
|
3858
|
+
type: z52.enum(["list", "grid", "carousel"]).default("list")
|
|
3827
3859
|
}).optional().default({
|
|
3828
3860
|
type: "list"
|
|
3829
3861
|
}),
|
|
3830
3862
|
/** This isn't configurable in the admin-nextjs editor */
|
|
3831
|
-
previewMode:
|
|
3832
|
-
productLimit:
|
|
3833
|
-
productOptions:
|
|
3863
|
+
previewMode: z52.boolean().default(false),
|
|
3864
|
+
productLimit: z52.number().optional().default(1),
|
|
3865
|
+
productOptions: z52.object({
|
|
3834
3866
|
/** This isn't configurable in the admin-nextjs editor */
|
|
3835
|
-
hideOutOfStockVariants:
|
|
3836
|
-
matchVariant:
|
|
3837
|
-
showDeclineAll:
|
|
3838
|
-
showShipping:
|
|
3839
|
-
showSubtotal:
|
|
3840
|
-
showTaxes:
|
|
3841
|
-
showTotal:
|
|
3842
|
-
showVariantSelectors:
|
|
3843
|
-
variantSelectorDisplayMode:
|
|
3867
|
+
hideOutOfStockVariants: z52.boolean().optional().default(false),
|
|
3868
|
+
matchVariant: z52.boolean().optional().default(true),
|
|
3869
|
+
showDeclineAll: z52.enum(["above", "below", "both", "none"]).optional(),
|
|
3870
|
+
showShipping: z52.boolean().optional().default(true),
|
|
3871
|
+
showSubtotal: z52.boolean().optional().default(true),
|
|
3872
|
+
showTaxes: z52.boolean().optional().default(true),
|
|
3873
|
+
showTotal: z52.boolean().optional().default(true),
|
|
3874
|
+
showVariantSelectors: z52.boolean().optional().default(true),
|
|
3875
|
+
variantSelectorDisplayMode: z52.enum(["separate", "single"]).optional().default("separate")
|
|
3844
3876
|
}),
|
|
3845
|
-
productType:
|
|
3846
|
-
productTypeSelector:
|
|
3847
|
-
quantityInputs:
|
|
3848
|
-
defaultQuantity:
|
|
3849
|
-
enabled:
|
|
3850
|
-
maxValue:
|
|
3851
|
-
minValue:
|
|
3877
|
+
productType: z52.union([z52.enum(["one-time", "subscription", "both"]), z52.literal("").transform(() => "one-time")]).default("one-time"),
|
|
3878
|
+
productTypeSelector: z52.enum(["dropdown", "radio"]).optional().default("radio"),
|
|
3879
|
+
quantityInputs: z52.object({
|
|
3880
|
+
defaultQuantity: z52.union([z52.number(), z52.null().transform(() => 1)]).default(1),
|
|
3881
|
+
enabled: z52.boolean().default(true),
|
|
3882
|
+
maxValue: z52.union([z52.number(), z52.null().transform(() => 15)]).default(15),
|
|
3883
|
+
minValue: z52.union([z52.number().min(0), z52.unknown().transform(() => 0)]).default(1)
|
|
3852
3884
|
}),
|
|
3853
|
-
shipping:
|
|
3885
|
+
shipping: z52.object({
|
|
3854
3886
|
amount: strictNumber.default(10),
|
|
3855
3887
|
/** This isn't configurable in the admin-nextjs editor */
|
|
3856
|
-
enabled:
|
|
3857
|
-
title:
|
|
3858
|
-
type:
|
|
3888
|
+
enabled: z52.boolean().default(true),
|
|
3889
|
+
title: z52.string().optional().default("Shipping Fees"),
|
|
3890
|
+
type: z52.enum(["free", "fixed_amount"]).default("free")
|
|
3859
3891
|
}),
|
|
3860
|
-
styles:
|
|
3861
|
-
starColor:
|
|
3862
|
-
starSize:
|
|
3863
|
-
starStrokeColor:
|
|
3864
|
-
strokeWidth:
|
|
3892
|
+
styles: z52.object({
|
|
3893
|
+
starColor: z52.string().optional().default("#fadb14"),
|
|
3894
|
+
starSize: z52.union([z52.enum(["small", "medium", "large"]), z52.unknown().transform(() => "large")]).optional().default("large"),
|
|
3895
|
+
starStrokeColor: z52.string().optional().default("#fadb14"),
|
|
3896
|
+
strokeWidth: z52.string().optional().default("1")
|
|
3865
3897
|
}).optional(),
|
|
3866
|
-
subImages:
|
|
3867
|
-
subscription:
|
|
3868
|
-
discount:
|
|
3898
|
+
subImages: z52.number().nullish().default(8),
|
|
3899
|
+
subscription: z52.object({
|
|
3900
|
+
discount: z52.object({
|
|
3869
3901
|
amount: strictNumber.default(30),
|
|
3870
|
-
shouldShowSavingText:
|
|
3871
|
-
type:
|
|
3902
|
+
shouldShowSavingText: z52.boolean().optional().default(true),
|
|
3903
|
+
type: z52.enum(["none", "fixed_amount", "percentage"]).default("none")
|
|
3872
3904
|
}),
|
|
3873
|
-
shipping:
|
|
3905
|
+
shipping: z52.object({
|
|
3874
3906
|
amount: strictNumber.default(1),
|
|
3875
3907
|
/** This isn't configurable in the admin-nextjs editor */
|
|
3876
|
-
enabled:
|
|
3908
|
+
enabled: z52.boolean().default(true),
|
|
3877
3909
|
/** This isn't configurable in the admin-nextjs editor */
|
|
3878
3910
|
recurringAmount: strictNumber.default(2),
|
|
3879
|
-
shippingTitle:
|
|
3880
|
-
type:
|
|
3911
|
+
shippingTitle: z52.string().default("Shipping Fees"),
|
|
3912
|
+
type: z52.enum(["free", "fixed_amount"]).default("free")
|
|
3881
3913
|
})
|
|
3882
3914
|
}).optional().default({
|
|
3883
3915
|
discount: {
|
|
@@ -3895,15 +3927,15 @@ var PostPurchaseSettings = z51.object({
|
|
|
3895
3927
|
type: "free"
|
|
3896
3928
|
}
|
|
3897
3929
|
}),
|
|
3898
|
-
subscriptionIsDefault:
|
|
3930
|
+
subscriptionIsDefault: z52.boolean().optional(),
|
|
3899
3931
|
/** This isn't configurable in the admin-nextjs editor */
|
|
3900
|
-
template:
|
|
3901
|
-
type:
|
|
3902
|
-
upgradeToSubscription:
|
|
3903
|
-
acceptButtonText:
|
|
3904
|
-
allow:
|
|
3905
|
-
emailRefundNotice:
|
|
3906
|
-
errorBannerText:
|
|
3932
|
+
template: z52.string().optional().default(""),
|
|
3933
|
+
type: z52.literal("shopify_post_purchase_extension").default("shopify_post_purchase_extension"),
|
|
3934
|
+
upgradeToSubscription: z52.object({
|
|
3935
|
+
acceptButtonText: z52.string().optional().default("Upgrade"),
|
|
3936
|
+
allow: z52.boolean().optional().default(false),
|
|
3937
|
+
emailRefundNotice: z52.boolean().optional().default(false),
|
|
3938
|
+
errorBannerText: z52.string().optional().default("This subscription cannot be added - limit one per order")
|
|
3907
3939
|
}).optional().default(() => ({
|
|
3908
3940
|
acceptButtonText: "Upgrade",
|
|
3909
3941
|
allow: false,
|
|
@@ -3913,32 +3945,32 @@ var PostPurchaseSettings = z51.object({
|
|
|
3913
3945
|
});
|
|
3914
3946
|
|
|
3915
3947
|
// src/schema/widgets/post-purchase-offer/postPurchaseWidget.ts
|
|
3916
|
-
var PostPurchaseWidgetLinkedFlow =
|
|
3917
|
-
id:
|
|
3918
|
-
name:
|
|
3948
|
+
var PostPurchaseWidgetLinkedFlow = z53.object({
|
|
3949
|
+
id: z53.number(),
|
|
3950
|
+
name: z53.string()
|
|
3919
3951
|
});
|
|
3920
|
-
var PostPurchaseWidget =
|
|
3921
|
-
classification:
|
|
3922
|
-
createdAtTime:
|
|
3923
|
-
customEndpointName:
|
|
3924
|
-
id:
|
|
3925
|
-
lastViewed:
|
|
3926
|
-
linkedCustomEndpointId:
|
|
3927
|
-
linkedFlows:
|
|
3928
|
-
name:
|
|
3929
|
-
owner:
|
|
3952
|
+
var PostPurchaseWidget = z53.object({
|
|
3953
|
+
classification: z53.literal("post_purchase_offer_page").default("post_purchase_offer_page"),
|
|
3954
|
+
createdAtTime: z53.iso.datetime({ offset: true }).optional(),
|
|
3955
|
+
customEndpointName: z53.string().nullish(),
|
|
3956
|
+
id: z53.number().default(0),
|
|
3957
|
+
lastViewed: z53.iso.datetime({ offset: true }).nullish(),
|
|
3958
|
+
linkedCustomEndpointId: z53.number().nullish(),
|
|
3959
|
+
linkedFlows: z53.array(PostPurchaseWidgetLinkedFlow).optional(),
|
|
3960
|
+
name: z53.string().default(""),
|
|
3961
|
+
owner: z53.number().nullish(),
|
|
3930
3962
|
settings: PostPurchaseSettings
|
|
3931
3963
|
});
|
|
3932
3964
|
|
|
3933
3965
|
// src/schema/widgets/post-purchase-offer/postPurchaseOffer.ts
|
|
3934
|
-
var PostPurchaseOffer =
|
|
3935
|
-
|
|
3936
|
-
errors:
|
|
3937
|
-
message:
|
|
3938
|
-
successful:
|
|
3966
|
+
var PostPurchaseOffer = z54.discriminatedUnion("successful", [
|
|
3967
|
+
z54.strictObject({
|
|
3968
|
+
errors: z54.array(z54.object({ message: z54.string() })),
|
|
3969
|
+
message: z54.string(),
|
|
3970
|
+
successful: z54.literal(false)
|
|
3939
3971
|
}),
|
|
3940
|
-
|
|
3941
|
-
successful:
|
|
3972
|
+
z54.strictObject({
|
|
3973
|
+
successful: z54.literal(true),
|
|
3942
3974
|
widget: PostPurchaseWidget
|
|
3943
3975
|
})
|
|
3944
3976
|
]);
|
|
@@ -5037,6 +5069,7 @@ export {
|
|
|
5037
5069
|
CABImageSectionFields,
|
|
5038
5070
|
CABIntegrations,
|
|
5039
5071
|
CABLayoutSection,
|
|
5072
|
+
CABLayoutWrapping,
|
|
5040
5073
|
CABMonetizeAds,
|
|
5041
5074
|
CABMonetizeSection,
|
|
5042
5075
|
CABNumberVariable,
|
|
@@ -5054,6 +5087,7 @@ export {
|
|
|
5054
5087
|
CABRuleset,
|
|
5055
5088
|
CABRulesetEntry,
|
|
5056
5089
|
CABSection,
|
|
5090
|
+
CABSeparatorSection,
|
|
5057
5091
|
CABTextSection,
|
|
5058
5092
|
CABTextTier,
|
|
5059
5093
|
CABTextVariable,
|
|
@@ -5105,6 +5139,7 @@ export {
|
|
|
5105
5139
|
ImageContentBlock,
|
|
5106
5140
|
InlineTextSizeName,
|
|
5107
5141
|
LanguageKey,
|
|
5142
|
+
LayoutFrame,
|
|
5108
5143
|
LineItemEditor,
|
|
5109
5144
|
LineItemEditorSwitchLanguageV1,
|
|
5110
5145
|
LineItemEditorV1,
|
|
@@ -5265,6 +5300,7 @@ export {
|
|
|
5265
5300
|
isTimerBlock,
|
|
5266
5301
|
isVariantsType,
|
|
5267
5302
|
languageKeys,
|
|
5303
|
+
layoutFrames,
|
|
5268
5304
|
mutatorEvents,
|
|
5269
5305
|
objectFits,
|
|
5270
5306
|
offersDirections,
|