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