@rebuy/rebuy 3.35.0 → 3.36.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 +689 -571
- package/dist/index.mjs +689 -571
- package/dist/schema/index.d.ts +3 -0
- package/dist/schema/postPurchaseGroup.d.ts +15 -0
- package/dist/schema/postPurchaseProduct.d.ts +74 -24
- package/dist/schema/postPurchaseProductCalculation.d.ts +87 -0
- package/dist/schema/postPurchaseProductCollectionView.d.ts +724 -3
- package/dist/schema/postPurchaseProductDisplay.d.ts +41 -12
- package/dist/schema/postPurchaseProductView.d.ts +708 -0
- package/dist/schema/postPurchaseQuantity.d.ts +16 -3
- package/dist/schema/postPurchaseSubscriptionProduct.d.ts +74 -17
- package/dist/server/__fixtures__/postPurchaseGroup.d.ts +3 -0
- package/dist/server/index.cjs +818 -310
- package/dist/server/index.d.ts +13 -2
- package/dist/server/index.mjs +818 -310
- package/dist/server/postPurchaseProductDisplay.d.ts +38 -6
- package/dist/server/preparePostPurchaseAdmissionView.d.ts +418 -0
- package/dist/server/preparePostPurchaseCollectionGroup.d.ts +458 -0
- package/dist/server/preparePostPurchaseCollectionView.d.ts +442 -0
- package/dist/server/preparePostPurchaseGroupAdmissionView.d.ts +459 -0
- package/dist/server/preparePostPurchaseGroupDefault.d.ts +459 -0
- package/dist/server/preparePostPurchaseGroupView.d.ts +458 -0
- package/dist/server/preparePostPurchaseMemberView.d.ts +1466 -0
- package/dist/server/preparePostPurchaseProduct.d.ts +11 -0
- package/dist/server/preparePostPurchaseQuantityAdmissionView.d.ts +440 -0
- package/dist/server/preparePostPurchaseQuantityView.d.ts +427 -0
- package/dist/server/preparePostPurchaseSubscription.d.ts +37 -5
- package/dist/server/preparePostPurchaseView.d.ts +8 -0
- package/dist/server/projectPostPurchaseProduct.d.ts +37 -5
- package/dist/transforms/postPurchase/convertDescriptionRte.d.ts +11 -0
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -138,9 +138,11 @@ __export(src_exports, {
|
|
|
138
138
|
PostPurchaseAttributeProducts: () => PostPurchaseAttributeProducts,
|
|
139
139
|
PostPurchaseBlock: () => PostPurchaseBlock,
|
|
140
140
|
PostPurchaseChoice: () => PostPurchaseChoice,
|
|
141
|
+
PostPurchaseCollectionChoice: () => PostPurchaseCollectionChoice,
|
|
141
142
|
PostPurchaseDiscount: () => PostPurchaseDiscount,
|
|
142
143
|
PostPurchaseExcludedProductIds: () => PostPurchaseExcludedProductIds,
|
|
143
144
|
PostPurchaseGroupCatalog: () => PostPurchaseGroupCatalog,
|
|
145
|
+
PostPurchaseGroupChoice: () => PostPurchaseGroupChoice,
|
|
144
146
|
PostPurchaseGroupDescription: () => PostPurchaseGroupDescription,
|
|
145
147
|
PostPurchaseGroupSelection: () => PostPurchaseGroupSelection,
|
|
146
148
|
PostPurchaseOffer: () => PostPurchaseOffer,
|
|
@@ -157,11 +159,17 @@ __export(src_exports, {
|
|
|
157
159
|
PostPurchasePlanOption: () => PostPurchasePlanOption,
|
|
158
160
|
PostPurchasePreparation: () => PostPurchasePreparation,
|
|
159
161
|
PostPurchasePrimaryImageSource: () => PostPurchasePrimaryImageSource,
|
|
162
|
+
PostPurchaseProductCalculation: () => PostPurchaseProductCalculation,
|
|
163
|
+
PostPurchaseProductChangeset: () => PostPurchaseProductChangeset,
|
|
164
|
+
PostPurchaseProductCollectionView: () => PostPurchaseProductCollectionView,
|
|
165
|
+
PostPurchaseProductCosts: () => PostPurchaseProductCosts,
|
|
160
166
|
PostPurchaseProductDisplay: () => PostPurchaseProductDisplay,
|
|
161
167
|
PostPurchaseProductGallery: () => PostPurchaseProductGallery,
|
|
162
168
|
PostPurchaseProductId: () => PostPurchaseProductId,
|
|
163
169
|
PostPurchaseProductSettings: () => PostPurchaseProductSettings,
|
|
164
170
|
PostPurchaseProductSource: () => PostPurchaseProductSource,
|
|
171
|
+
PostPurchaseProductView: () => PostPurchaseProductView,
|
|
172
|
+
PostPurchaseQuantityChoice: () => PostPurchaseQuantityChoice,
|
|
165
173
|
PostPurchaseQuantityPolicy: () => PostPurchaseQuantityPolicy,
|
|
166
174
|
PostPurchaseSettings: () => PostPurchaseSettings,
|
|
167
175
|
PostPurchaseShadowReportFields: () => PostPurchaseShadowReportFields,
|
|
@@ -2557,9 +2565,6 @@ var ExitPolicySchema = import_zod18.z.discriminatedUnion("status", [
|
|
|
2557
2565
|
})
|
|
2558
2566
|
]);
|
|
2559
2567
|
|
|
2560
|
-
// src/schema/postPurchaseGroupCatalog.ts
|
|
2561
|
-
var import_zod25 = require("zod");
|
|
2562
|
-
|
|
2563
2568
|
// src/schema/postPurchaseProduct.ts
|
|
2564
2569
|
var import_zod23 = require("zod");
|
|
2565
2570
|
|
|
@@ -2586,14 +2591,10 @@ var PostPurchasePrimaryImageSource = import_zod20.z.string().default(
|
|
|
2586
2591
|
"https://cdn.shopify.com/shopifycloud/shopify/assets/no-image-2048-5e88c1b20e087fb7bbe9a3771824e743c244f437e4f8ba93bbf7b11b53f7824c.gif"
|
|
2587
2592
|
);
|
|
2588
2593
|
var PostPurchaseProductDisplay = import_zod20.z.object({
|
|
2594
|
+
descriptionDocument: TiptapDocument.optional(),
|
|
2589
2595
|
discountedFrom: PostPurchaseSettings.shape.discountedFrom,
|
|
2590
2596
|
gallery: PostPurchaseProductGallery.optional(),
|
|
2591
|
-
language: language.pick({
|
|
2592
|
-
description: true,
|
|
2593
|
-
descriptionEnabled: true,
|
|
2594
|
-
descriptionRte: true,
|
|
2595
|
-
descriptionSpacing: true
|
|
2596
|
-
}),
|
|
2597
|
+
language: language.pick({ description: true, descriptionEnabled: true }),
|
|
2597
2598
|
primaryImage: import_zod20.z.object({ description: import_zod20.z.string(), source: import_zod20.z.string() }),
|
|
2598
2599
|
productOptions: PostPurchaseSettings.shape.productOptions.pick({
|
|
2599
2600
|
showDeclineAll: true,
|
|
@@ -2720,6 +2721,18 @@ var PostPurchasePreparation = import_zod23.z.discriminatedUnion("status", [
|
|
|
2720
2721
|
import_zod23.z.object({ reason: import_zod23.z.string(), status: import_zod23.z.literal("unsupported") })
|
|
2721
2722
|
]);
|
|
2722
2723
|
|
|
2724
|
+
// src/schema/postPurchaseQuantity.ts
|
|
2725
|
+
var import_zod47 = require("zod");
|
|
2726
|
+
|
|
2727
|
+
// src/schema/postPurchaseProductCollectionView.ts
|
|
2728
|
+
var import_zod46 = require("zod");
|
|
2729
|
+
|
|
2730
|
+
// src/schema/postPurchaseProductView.ts
|
|
2731
|
+
var import_zod45 = require("zod");
|
|
2732
|
+
|
|
2733
|
+
// src/schema/postPurchaseGroupCatalog.ts
|
|
2734
|
+
var import_zod25 = require("zod");
|
|
2735
|
+
|
|
2723
2736
|
// src/schema/postPurchaseVariantCatalog.ts
|
|
2724
2737
|
var import_zod24 = require("zod");
|
|
2725
2738
|
var PostPurchaseVariantSelector = import_zod24.z.object({ variantId: PostPurchaseVariantId }).strict();
|
|
@@ -2764,57 +2777,8 @@ var PostPurchaseGroupSelection = import_zod25.z.object({
|
|
|
2764
2777
|
productId
|
|
2765
2778
|
});
|
|
2766
2779
|
|
|
2767
|
-
// src/schema/postPurchaseIdentity.ts
|
|
2768
|
-
var import_zod26 = require("zod");
|
|
2769
|
-
var POST_PURCHASE_ID_MAX = 128;
|
|
2770
|
-
var PostPurchaseTimestampSchema = import_zod26.z.number().int().nonnegative();
|
|
2771
|
-
var PostPurchaseOrderIdSchema = import_zod26.z.string().regex(/^gid:\/\/shopify\/Order\/[1-9]\d*$/);
|
|
2772
|
-
var ShopifyDomainSchema = import_zod26.z.string().max(POST_PURCHASE_ID_MAX).regex(/^[a-z0-9]([a-z0-9-]*[a-z0-9])?\.myshopify\.com$/);
|
|
2773
|
-
var DecideRequestSchema = import_zod26.z.object({
|
|
2774
|
-
checkoutToken: import_zod26.z.string().min(1).max(POST_PURCHASE_ID_MAX),
|
|
2775
|
-
shop: ShopifyDomainSchema
|
|
2776
|
-
});
|
|
2777
|
-
var PostPurchaseAppIdSchema = import_zod26.z.string().min(1).max(POST_PURCHASE_ID_MAX);
|
|
2778
|
-
var DecisionEntrySchema = import_zod26.z.object({
|
|
2779
|
-
blockId: import_zod26.z.number().int().positive(),
|
|
2780
|
-
blockIndex: import_zod26.z.string(),
|
|
2781
|
-
blockParentIndex: import_zod26.z.string(),
|
|
2782
|
-
flowId: import_zod26.z.number().int().positive(),
|
|
2783
|
-
sectionId: import_zod26.z.number().int().positive(),
|
|
2784
|
-
widgetId: import_zod26.z.number().int().positive(),
|
|
2785
|
-
widgetTraffic: import_zod26.z.number().min(0).max(100)
|
|
2786
|
-
});
|
|
2787
|
-
|
|
2788
|
-
// src/schema/postPurchaseOfferEligibility.ts
|
|
2789
|
-
var import_zod28 = require("zod");
|
|
2790
|
-
|
|
2791
|
-
// src/schema/postPurchaseProductCollectionView.ts
|
|
2792
|
-
var import_zod27 = require("zod");
|
|
2793
|
-
var PostPurchaseExcludedProductIds = import_zod27.z.array(PostPurchaseProductId).default([]);
|
|
2794
|
-
|
|
2795
|
-
// src/schema/postPurchaseOfferEligibility.ts
|
|
2796
|
-
var selection = PreparedPostPurchaseProduct.shape.selection;
|
|
2797
|
-
var PostPurchaseOfferSkipReason = import_zod28.z.enum(["empty", "no-eligible-subscription"]);
|
|
2798
|
-
var PostPurchaseOfferEligibilityContext = import_zod28.z.object({
|
|
2799
|
-
excludedProductIds: PostPurchaseExcludedProductIds,
|
|
2800
|
-
originalLineItems: import_zod28.z.array(selection.pick({ productId: true, sellingPlanId: true, variantId: true }))
|
|
2801
|
-
});
|
|
2802
|
-
var PostPurchaseOfferEligibility = import_zod28.z.discriminatedUnion("status", [
|
|
2803
|
-
import_zod28.z.object({
|
|
2804
|
-
members: import_zod28.z.array(
|
|
2805
|
-
import_zod28.z.object({ productId: selection.shape.productId, productIndex: import_zod28.z.number().int().nonnegative() })
|
|
2806
|
-
),
|
|
2807
|
-
status: import_zod28.z.literal("retain")
|
|
2808
|
-
}),
|
|
2809
|
-
import_zod28.z.object({ reason: PostPurchaseOfferSkipReason, status: import_zod28.z.literal("skip") }),
|
|
2810
|
-
import_zod28.z.object({ reason: import_zod28.z.literal("eligible-upgrade").optional(), status: import_zod28.z.literal("unavailable") })
|
|
2811
|
-
]);
|
|
2812
|
-
|
|
2813
|
-
// src/schema/postPurchaseOfferPresentation.ts
|
|
2814
|
-
var import_zod48 = require("zod");
|
|
2815
|
-
|
|
2816
2780
|
// src/schema/widgets/checkout-and-beyond/root.ts
|
|
2817
|
-
var
|
|
2781
|
+
var import_zod44 = require("zod");
|
|
2818
2782
|
|
|
2819
2783
|
// src/schema/widgets/checkout-and-beyond/constants.ts
|
|
2820
2784
|
var import_es_toolkit3 = require("es-toolkit");
|
|
@@ -2869,18 +2833,18 @@ var targetAreas = {
|
|
|
2869
2833
|
|
|
2870
2834
|
// src/schema/widgets/checkout-and-beyond/layout.ts
|
|
2871
2835
|
var import_uuid15 = require("uuid");
|
|
2872
|
-
var
|
|
2836
|
+
var import_zod43 = require("zod");
|
|
2873
2837
|
|
|
2874
2838
|
// src/schema/widgets/checkout-and-beyond/shared.ts
|
|
2875
|
-
var
|
|
2839
|
+
var import_zod42 = require("zod");
|
|
2876
2840
|
|
|
2877
2841
|
// src/schema/widgets/checkout-and-beyond/banner.ts
|
|
2878
|
-
var
|
|
2879
|
-
var CABBannerSection =
|
|
2842
|
+
var import_zod26 = require("zod");
|
|
2843
|
+
var CABBannerSection = import_zod26.z.lazy(
|
|
2880
2844
|
() => CABLayoutSection.omit({ sectionType: true }).extend({
|
|
2881
|
-
buttonField:
|
|
2882
|
-
color:
|
|
2883
|
-
dismissible:
|
|
2845
|
+
buttonField: import_zod26.z.enum(buttonFields).optional(),
|
|
2846
|
+
color: import_zod26.z.enum(bannerColors).default("info"),
|
|
2847
|
+
dismissible: import_zod26.z.boolean().default(true),
|
|
2884
2848
|
/**
|
|
2885
2849
|
* The `s-banner` heading — localized content (a buyer can see a merchant-composed banner). Absent OR
|
|
2886
2850
|
* blank ⇒ no heading; the renderer emits no heading slot for `''` rather than an empty one.
|
|
@@ -2896,18 +2860,18 @@ var CABBannerSection = import_zod29.z.lazy(
|
|
|
2896
2860
|
* not a 500. Nothing emits `heading` yet; the first converter that maps merchant banner copy into it
|
|
2897
2861
|
* either strips first or teaches `normalizeTextContent` to strip this field.
|
|
2898
2862
|
*/
|
|
2899
|
-
heading:
|
|
2900
|
-
sectionType:
|
|
2863
|
+
heading: import_zod26.z.record(import_zod26.z.string(), import_zod26.z.string().refine(checkForHTML, NO_HTML)).optional(),
|
|
2864
|
+
sectionType: import_zod26.z.literal(SectionType.banner).default(SectionType.banner)
|
|
2901
2865
|
})
|
|
2902
2866
|
);
|
|
2903
2867
|
|
|
2904
2868
|
// src/schema/widgets/checkout-and-beyond/button.ts
|
|
2905
2869
|
var import_uuid5 = require("uuid");
|
|
2906
|
-
var
|
|
2870
|
+
var import_zod28 = require("zod");
|
|
2907
2871
|
|
|
2908
2872
|
// src/schema/widgets/checkout-and-beyond/image.ts
|
|
2909
2873
|
var import_uuid4 = require("uuid");
|
|
2910
|
-
var
|
|
2874
|
+
var import_zod27 = require("zod");
|
|
2911
2875
|
|
|
2912
2876
|
// src/schema/widgets/checkout-and-beyond/icons.ts
|
|
2913
2877
|
var iconNames = [
|
|
@@ -2994,17 +2958,17 @@ var iconTones = ["auto", "critical", "custom", "info", "neutral", "success", "wa
|
|
|
2994
2958
|
var IconTone = freezeEnum(iconTones);
|
|
2995
2959
|
|
|
2996
2960
|
// src/schema/widgets/checkout-and-beyond/image.ts
|
|
2997
|
-
var CABImageSectionFields =
|
|
2961
|
+
var CABImageSectionFields = import_zod27.z.object({
|
|
2998
2962
|
...CABVariableFields,
|
|
2999
|
-
altText:
|
|
2963
|
+
altText: import_zod27.z.string().refine(checkForHTML, NO_HTML).default(""),
|
|
3000
2964
|
/**
|
|
3001
2965
|
* Image width÷height (e.g. `46` for the progress-bar fill); `null` renders at natural size. Any POSITIVE
|
|
3002
2966
|
* ratio — never limited to 1, but never `0`/negative either: a renderer dividing by it would get `Infinity`,
|
|
3003
2967
|
* and CSS `aspect-ratio` drops a negative value and silently reverts to natural size.
|
|
3004
2968
|
*/
|
|
3005
|
-
aspectRatio:
|
|
3006
|
-
border:
|
|
3007
|
-
buttonField:
|
|
2969
|
+
aspectRatio: import_zod27.z.number().positive().nullable().default(null),
|
|
2970
|
+
border: import_zod27.z.lazy(() => CABBorder),
|
|
2971
|
+
buttonField: import_zod27.z.enum(buttonFields).optional(),
|
|
3008
2972
|
/**
|
|
3009
2973
|
* `icon` renders `source` as a single `s-icon` by name (the uber-image path covers icons too), reading
|
|
3010
2974
|
* `iconSize`/`iconTone`. The other values are a harmless informational holdover from the previous
|
|
@@ -3023,29 +2987,29 @@ var CABImageSectionFields = import_zod30.z.object({
|
|
|
3023
2987
|
* behavior degraded gracefully and told us about it. The client-assembled half of the invariant was never
|
|
3024
2988
|
* the risky half.
|
|
3025
2989
|
*/
|
|
3026
|
-
category:
|
|
2990
|
+
category: import_zod27.z.enum(["gallery", "icon", "icons", "payment-methods", "secure-checkout"]).nullable().default(null),
|
|
3027
2991
|
/** `icon`-mode only: the `s-icon` `size`; `null` ⇒ the component default (`base`). Ignored by image treatments. */
|
|
3028
|
-
iconSize:
|
|
2992
|
+
iconSize: import_zod27.z.enum(iconSizes).nullable().default(null),
|
|
3029
2993
|
/** `icon`-mode only: the `s-icon` `tone`; `null` ⇒ the component default (`auto`). Ignored by image treatments. */
|
|
3030
|
-
iconTone:
|
|
3031
|
-
name:
|
|
3032
|
-
naturalHeight:
|
|
3033
|
-
naturalWidth:
|
|
2994
|
+
iconTone: import_zod27.z.enum(iconTones).nullable().default(null),
|
|
2995
|
+
name: import_zod27.z.string().optional(),
|
|
2996
|
+
naturalHeight: import_zod27.z.number().default(0),
|
|
2997
|
+
naturalWidth: import_zod27.z.number().default(0),
|
|
3034
2998
|
/**
|
|
3035
2999
|
* `contain` (the component default): dimensionless images render in s-image's 1/1 default frame, and
|
|
3036
3000
|
* `cover` would crop non-square art (payment badges lost their edges — 15993); `contain` letterboxes.
|
|
3037
3001
|
*/
|
|
3038
|
-
objectFit:
|
|
3039
|
-
sectionId:
|
|
3040
|
-
sectionType:
|
|
3002
|
+
objectFit: import_zod27.z.enum(objectFits).default(ObjectFit.contain),
|
|
3003
|
+
sectionId: import_zod27.z.uuid().default(() => (0, import_uuid4.v7)()),
|
|
3004
|
+
sectionType: import_zod27.z.literal(SectionType.image).default(SectionType.image),
|
|
3041
3005
|
/**
|
|
3042
3006
|
* An image URL or dynamic token, an empty default, or — when `category: 'icon'` — an icon NAME. Icon mode
|
|
3043
3007
|
* takes a name or `''` only, NOT a token: no renderer resolves a token to an icon today, so accepting one
|
|
3044
3008
|
* would promise a capability that doesn't exist. Widen the refine's carve-out to `DYNAMIC_TOKEN_REGEX` when a
|
|
3045
3009
|
* server-chosen tier icon actually needs it.
|
|
3046
3010
|
*/
|
|
3047
|
-
source:
|
|
3048
|
-
width:
|
|
3011
|
+
source: import_zod27.z.union([import_zod27.z.url(), import_zod27.z.literal(""), import_zod27.z.string().regex(DYNAMIC_TOKEN_REGEX), import_zod27.z.enum(iconNames)]).default(""),
|
|
3012
|
+
width: import_zod27.z.number().default(100)
|
|
3049
3013
|
});
|
|
3050
3014
|
var iconNameSet = new Set(iconNames);
|
|
3051
3015
|
var isIconName = (source2) => iconNameSet.has(source2);
|
|
@@ -3065,35 +3029,35 @@ var CABImageSection = CABImageSectionFields.superRefine(({ category, source: sou
|
|
|
3065
3029
|
});
|
|
3066
3030
|
|
|
3067
3031
|
// src/schema/widgets/checkout-and-beyond/button.ts
|
|
3068
|
-
var CABButtonContent =
|
|
3069
|
-
() =>
|
|
3032
|
+
var CABButtonContent = import_zod28.z.lazy(
|
|
3033
|
+
() => import_zod28.z.discriminatedUnion("sectionType", [CABImageSection, CABLayoutSection, CABTextSection])
|
|
3070
3034
|
);
|
|
3071
|
-
var CABButtonSection =
|
|
3035
|
+
var CABButtonSection = import_zod28.z.object({
|
|
3072
3036
|
...CABVariableFields,
|
|
3073
|
-
action:
|
|
3074
|
-
buttonStyle:
|
|
3075
|
-
custom:
|
|
3076
|
-
color:
|
|
3077
|
-
height:
|
|
3078
|
-
width:
|
|
3037
|
+
action: import_zod28.z.union([import_zod28.z.literal(""), import_zod28.z.enum(buttonActions)]).default(""),
|
|
3038
|
+
buttonStyle: import_zod28.z.enum(buttonStyles).default(ButtonStyle.primary),
|
|
3039
|
+
custom: import_zod28.z.object({
|
|
3040
|
+
color: import_zod28.z.string().regex(HEX_COLOR_REGEX).default("#005bd3"),
|
|
3041
|
+
height: import_zod28.z.number().default(52),
|
|
3042
|
+
width: import_zod28.z.number().default(300)
|
|
3079
3043
|
}).default({
|
|
3080
3044
|
color: "#005bd3",
|
|
3081
3045
|
height: 52,
|
|
3082
3046
|
width: 300
|
|
3083
3047
|
}),
|
|
3084
|
-
disableDowngrade:
|
|
3085
|
-
name:
|
|
3086
|
-
optionId:
|
|
3087
|
-
popover:
|
|
3088
|
-
alignment:
|
|
3089
|
-
position:
|
|
3048
|
+
disableDowngrade: import_zod28.z.boolean().default(false),
|
|
3049
|
+
name: import_zod28.z.string().optional(),
|
|
3050
|
+
optionId: import_zod28.z.number().optional(),
|
|
3051
|
+
popover: import_zod28.z.object({
|
|
3052
|
+
alignment: import_zod28.z.enum(textAlignments).default(TextAlignment.center),
|
|
3053
|
+
position: import_zod28.z.enum(popoverPositions).default(PopoverPosition.blockStart)
|
|
3090
3054
|
}).optional().default(() => ({
|
|
3091
3055
|
alignment: TextAlignment.center,
|
|
3092
3056
|
position: PopoverPosition.blockStart
|
|
3093
3057
|
})),
|
|
3094
|
-
sectionId:
|
|
3095
|
-
sections:
|
|
3096
|
-
sectionType:
|
|
3058
|
+
sectionId: import_zod28.z.uuid().default(() => (0, import_uuid5.v7)()),
|
|
3059
|
+
sections: import_zod28.z.union([import_zod28.z.array(CABButtonContent), import_zod28.z.strictObject({}).transform(() => [])]).default(() => []),
|
|
3060
|
+
sectionType: import_zod28.z.literal(SectionType.button).default(SectionType.button),
|
|
3097
3061
|
/**
|
|
3098
3062
|
* The smart-cart tier this button acts on (`addGift`/`removeGift`): scopes the click to one tier's gift. The
|
|
3099
3063
|
* client resolves the tier's gift (productId) from the progress-bar context by this `tierId` — the button node
|
|
@@ -3108,91 +3072,91 @@ var CABButtonSection = import_zod31.z.object({
|
|
|
3108
3072
|
* lookup finds no tier and the click resolves to nothing. Safe to bound — the field is new, so there are no
|
|
3109
3073
|
* stored payloads to grandfather, and the producer is client code, not a merchant form.
|
|
3110
3074
|
*/
|
|
3111
|
-
tier:
|
|
3075
|
+
tier: import_zod28.z.object({ tierId: import_zod28.z.string().min(1) }).optional(),
|
|
3112
3076
|
/** Fire-and-forget pixel POSTed when the button is clicked (e.g. a Monetize decline). */
|
|
3113
|
-
trackingUrl:
|
|
3077
|
+
trackingUrl: import_zod28.z.string().optional(),
|
|
3114
3078
|
/**
|
|
3115
3079
|
* Secondary effects applied to in-scope variables on click, alongside (never instead of) the primary
|
|
3116
3080
|
* `action` — an `addToOrder` button can also flip a variable. Applied in array order.
|
|
3117
3081
|
*/
|
|
3118
|
-
variableEffects:
|
|
3082
|
+
variableEffects: import_zod28.z.array(CABVariableEffect).optional()
|
|
3119
3083
|
});
|
|
3120
3084
|
|
|
3121
3085
|
// src/schema/widgets/checkout-and-beyond/carousel.ts
|
|
3122
|
-
var
|
|
3086
|
+
var import_zod33 = require("zod");
|
|
3123
3087
|
|
|
3124
3088
|
// src/schema/widgets/checkout-and-beyond/offers.ts
|
|
3125
|
-
var
|
|
3089
|
+
var import_zod32 = require("zod");
|
|
3126
3090
|
|
|
3127
3091
|
// src/schema/widgets/checkout-and-beyond/dataSource.ts
|
|
3128
3092
|
var import_uuid6 = require("uuid");
|
|
3129
|
-
var
|
|
3130
|
-
var CABDiscount =
|
|
3131
|
-
amount:
|
|
3132
|
-
discountedBy:
|
|
3133
|
-
discountedFrom:
|
|
3134
|
-
type:
|
|
3135
|
-
});
|
|
3136
|
-
var CABIntegrations =
|
|
3137
|
-
judgeme:
|
|
3138
|
-
junip:
|
|
3139
|
-
klaviyo:
|
|
3140
|
-
loox:
|
|
3141
|
-
okendo:
|
|
3142
|
-
opinew:
|
|
3143
|
-
reviewsio:
|
|
3144
|
-
stamped:
|
|
3145
|
-
yotpo:
|
|
3146
|
-
});
|
|
3147
|
-
var CABDataSourceSection =
|
|
3148
|
-
dataSourceId:
|
|
3149
|
-
dataSourcePath:
|
|
3093
|
+
var import_zod29 = require("zod");
|
|
3094
|
+
var CABDiscount = import_zod29.z.object({
|
|
3095
|
+
amount: import_zod29.z.union([import_zod29.z.number(), import_zod29.z.string()]).catch(0),
|
|
3096
|
+
discountedBy: import_zod29.z.string().optional(),
|
|
3097
|
+
discountedFrom: import_zod29.z.enum(discountSources).optional().catch(void 0),
|
|
3098
|
+
type: import_zod29.z.enum(discountTypes).catch("none")
|
|
3099
|
+
});
|
|
3100
|
+
var CABIntegrations = import_zod29.z.object({
|
|
3101
|
+
judgeme: import_zod29.z.boolean().default(false),
|
|
3102
|
+
junip: import_zod29.z.boolean().default(false),
|
|
3103
|
+
klaviyo: import_zod29.z.boolean().default(false),
|
|
3104
|
+
loox: import_zod29.z.boolean().default(false),
|
|
3105
|
+
okendo: import_zod29.z.boolean().default(false),
|
|
3106
|
+
opinew: import_zod29.z.boolean().default(false),
|
|
3107
|
+
reviewsio: import_zod29.z.boolean().default(false),
|
|
3108
|
+
stamped: import_zod29.z.boolean().default(false),
|
|
3109
|
+
yotpo: import_zod29.z.boolean().default(false)
|
|
3110
|
+
});
|
|
3111
|
+
var CABDataSourceSection = import_zod29.z.object({
|
|
3112
|
+
dataSourceId: import_zod29.z.number().nullable().default(null),
|
|
3113
|
+
dataSourcePath: import_zod29.z.string().default(DEFAULT_ENDPOINTS[0].value),
|
|
3150
3114
|
discount: CABDiscount.optional(),
|
|
3151
3115
|
integrations: CABIntegrations.optional(),
|
|
3152
|
-
limit:
|
|
3153
|
-
matchVariant:
|
|
3154
|
-
matchVariantOutOfStock:
|
|
3155
|
-
name:
|
|
3156
|
-
productType:
|
|
3157
|
-
sectionId:
|
|
3158
|
-
sectionType:
|
|
3116
|
+
limit: import_zod29.z.number().default(1),
|
|
3117
|
+
matchVariant: import_zod29.z.boolean().default(false),
|
|
3118
|
+
matchVariantOutOfStock: import_zod29.z.boolean().default(false),
|
|
3119
|
+
name: import_zod29.z.string().default(DEFAULT_ENDPOINTS[0].label),
|
|
3120
|
+
productType: import_zod29.z.enum(productTypes).optional(),
|
|
3121
|
+
sectionId: import_zod29.z.uuid().default(() => (0, import_uuid6.v7)()),
|
|
3122
|
+
sectionType: import_zod29.z.literal(SectionType.dataSource).default(SectionType.dataSource),
|
|
3159
3123
|
/** Default subscribe-vs-one-time for `productType: both` (legacy `subscription_is_default`). */
|
|
3160
|
-
subscriptionIsDefault:
|
|
3161
|
-
treatAsGwp:
|
|
3124
|
+
subscriptionIsDefault: import_zod29.z.boolean().default(false),
|
|
3125
|
+
treatAsGwp: import_zod29.z.boolean().default(false)
|
|
3162
3126
|
});
|
|
3163
3127
|
|
|
3164
3128
|
// src/schema/widgets/checkout-and-beyond/products.ts
|
|
3165
3129
|
var import_uuid8 = require("uuid");
|
|
3166
|
-
var
|
|
3130
|
+
var import_zod31 = require("zod");
|
|
3167
3131
|
|
|
3168
3132
|
// src/schema/widgets/checkout-and-beyond/product.ts
|
|
3169
3133
|
var import_uuid7 = require("uuid");
|
|
3170
|
-
var
|
|
3171
|
-
var CABVariantContent =
|
|
3172
|
-
() =>
|
|
3134
|
+
var import_zod30 = require("zod");
|
|
3135
|
+
var CABVariantContent = import_zod30.z.lazy(
|
|
3136
|
+
() => import_zod30.z.discriminatedUnion("sectionType", [CABButtonSection, CABTextSection])
|
|
3173
3137
|
);
|
|
3174
|
-
var CABProductSection =
|
|
3138
|
+
var CABProductSection = import_zod30.z.object({
|
|
3175
3139
|
...CABVariableFields,
|
|
3176
|
-
name:
|
|
3177
|
-
productId:
|
|
3178
|
-
sectionId:
|
|
3179
|
-
sections:
|
|
3180
|
-
sectionType:
|
|
3181
|
-
selectors:
|
|
3182
|
-
variantMode:
|
|
3140
|
+
name: import_zod30.z.string().optional(),
|
|
3141
|
+
productId: import_zod30.z.number().nullable().default(null),
|
|
3142
|
+
sectionId: import_zod30.z.uuid().default(() => (0, import_uuid7.v7)()),
|
|
3143
|
+
sections: import_zod30.z.union([import_zod30.z.array(CABVariantContent), import_zod30.z.strictObject({}).transform(() => [])]).default(() => []),
|
|
3144
|
+
sectionType: import_zod30.z.literal(SectionType.product).default(SectionType.product),
|
|
3145
|
+
selectors: import_zod30.z.record(import_zod30.z.string(), import_zod30.z.enum(variantSelectors).default(VariantSelector.menu)).default(() => ({})),
|
|
3146
|
+
variantMode: import_zod30.z.enum(variantModes).default(VariantMode.multiple)
|
|
3183
3147
|
});
|
|
3184
3148
|
|
|
3185
3149
|
// src/schema/widgets/checkout-and-beyond/products.ts
|
|
3186
|
-
var CABProductsSection =
|
|
3150
|
+
var CABProductsSection = import_zod31.z.object({
|
|
3187
3151
|
...CABVariableFields,
|
|
3188
|
-
name:
|
|
3189
|
-
sectionId:
|
|
3190
|
-
sections:
|
|
3191
|
-
sectionType:
|
|
3152
|
+
name: import_zod31.z.string().optional(),
|
|
3153
|
+
sectionId: import_zod31.z.uuid().default(() => (0, import_uuid8.v7)()),
|
|
3154
|
+
sections: import_zod31.z.union([import_zod31.z.array(import_zod31.z.lazy(() => CABProductSection)), import_zod31.z.strictObject({}).transform(() => [])]).default(() => []),
|
|
3155
|
+
sectionType: import_zod31.z.literal(SectionType.products).default(SectionType.products)
|
|
3192
3156
|
});
|
|
3193
3157
|
|
|
3194
3158
|
// src/schema/widgets/checkout-and-beyond/offers.ts
|
|
3195
|
-
var CABOffersSection =
|
|
3159
|
+
var CABOffersSection = import_zod32.z.lazy(
|
|
3196
3160
|
() => CABLayoutSection.omit({ sections: true, sectionType: true }).extend({
|
|
3197
3161
|
/**
|
|
3198
3162
|
* A rule between consecutive cards in the vertical list — legacy checkout-offers' `<Divider />`,
|
|
@@ -3200,8 +3164,8 @@ var CABOffersSection = import_zod35.z.lazy(
|
|
|
3200
3164
|
* run of products). Optional, not defaulted: only the v1 converter sets it (REB-24265); a
|
|
3201
3165
|
* hand-built tree keeps React CAB's dividerless rendering.
|
|
3202
3166
|
*/
|
|
3203
|
-
divider:
|
|
3204
|
-
sections:
|
|
3167
|
+
divider: import_zod32.z.boolean().optional(),
|
|
3168
|
+
sections: import_zod32.z.union([import_zod32.z.array(import_zod32.z.lazy(() => CABSection)), import_zod32.z.strictObject({}).transform(() => [])]).default(() => [
|
|
3205
3169
|
CABBannerSection.parse({
|
|
3206
3170
|
buttonField: "undoAddToOrder",
|
|
3207
3171
|
color: "success",
|
|
@@ -3215,77 +3179,77 @@ var CABOffersSection = import_zod35.z.lazy(
|
|
|
3215
3179
|
CABDataSourceSection.parse({}),
|
|
3216
3180
|
CABProductsSection.parse({})
|
|
3217
3181
|
]),
|
|
3218
|
-
sectionType:
|
|
3182
|
+
sectionType: import_zod32.z.literal(SectionType.offers).default(SectionType.offers)
|
|
3219
3183
|
})
|
|
3220
3184
|
);
|
|
3221
3185
|
|
|
3222
3186
|
// src/schema/widgets/checkout-and-beyond/carousel.ts
|
|
3223
|
-
var CABCarouselSection =
|
|
3187
|
+
var CABCarouselSection = import_zod33.z.lazy(
|
|
3224
3188
|
() => CABLayoutSection.omit({ sections: true, sectionType: true }).extend({
|
|
3225
|
-
autoAdvanceInterval:
|
|
3226
|
-
itemsAtOnce:
|
|
3189
|
+
autoAdvanceInterval: import_zod33.z.number().default(0),
|
|
3190
|
+
itemsAtOnce: import_zod33.z.number().min(1).default(1),
|
|
3227
3191
|
/** Card arrangement for the offers child (`horizontal` = side-by-side) — NOT the carousel's own `direction`. */
|
|
3228
|
-
offersDirection:
|
|
3229
|
-
sections:
|
|
3230
|
-
sectionType:
|
|
3192
|
+
offersDirection: import_zod33.z.enum(offersDirections).default("vertical"),
|
|
3193
|
+
sections: import_zod33.z.union([import_zod33.z.array(import_zod33.z.lazy(() => CABSection)), import_zod33.z.strictObject({}).transform(() => [])]).default(() => [CABOffersSection.parse({})]),
|
|
3194
|
+
sectionType: import_zod33.z.literal(SectionType.carousel).default(SectionType.carousel)
|
|
3231
3195
|
})
|
|
3232
3196
|
);
|
|
3233
3197
|
|
|
3234
3198
|
// src/schema/widgets/checkout-and-beyond/cartLine.ts
|
|
3235
|
-
var
|
|
3236
|
-
var CABCartLineSection =
|
|
3199
|
+
var import_zod34 = require("zod");
|
|
3200
|
+
var CABCartLineSection = import_zod34.z.lazy(
|
|
3237
3201
|
() => CABLayoutSection.omit({ sections: true, sectionType: true }).extend({
|
|
3238
|
-
sections:
|
|
3239
|
-
sectionType:
|
|
3202
|
+
sections: import_zod34.z.union([import_zod34.z.array(import_zod34.z.lazy(() => CABSection)), import_zod34.z.strictObject({}).transform(() => [])]).default(() => [CABButtonSection.parse({ action: ButtonAction.switchToSubscription })]),
|
|
3203
|
+
sectionType: import_zod34.z.literal(SectionType.cartLine).default(SectionType.cartLine)
|
|
3240
3204
|
})
|
|
3241
3205
|
);
|
|
3242
3206
|
|
|
3243
3207
|
// src/schema/widgets/checkout-and-beyond/discount.ts
|
|
3244
3208
|
var import_uuid9 = require("uuid");
|
|
3245
|
-
var
|
|
3246
|
-
var CABDiscountSection =
|
|
3209
|
+
var import_zod35 = require("zod");
|
|
3210
|
+
var CABDiscountSection = import_zod35.z.object({
|
|
3247
3211
|
...CABVariableFields,
|
|
3248
|
-
amount:
|
|
3249
|
-
discountedBy:
|
|
3250
|
-
discountedFrom:
|
|
3251
|
-
message:
|
|
3252
|
-
name:
|
|
3253
|
-
quantity:
|
|
3254
|
-
sectionId:
|
|
3255
|
-
sectionType:
|
|
3256
|
-
type:
|
|
3212
|
+
amount: import_zod35.z.union([import_zod35.z.number(), import_zod35.z.string()]).catch(0),
|
|
3213
|
+
discountedBy: import_zod35.z.string().optional(),
|
|
3214
|
+
discountedFrom: import_zod35.z.enum(discountSources).optional().catch(void 0),
|
|
3215
|
+
message: import_zod35.z.string().optional(),
|
|
3216
|
+
name: import_zod35.z.string().optional(),
|
|
3217
|
+
quantity: import_zod35.z.number().default(1),
|
|
3218
|
+
sectionId: import_zod35.z.uuid().default(() => (0, import_uuid9.v7)()),
|
|
3219
|
+
sectionType: import_zod35.z.literal(SectionType.discount).default(SectionType.discount),
|
|
3220
|
+
type: import_zod35.z.enum(discountTypes).catch("none")
|
|
3257
3221
|
});
|
|
3258
3222
|
|
|
3259
3223
|
// src/schema/widgets/checkout-and-beyond/monetize.ts
|
|
3260
3224
|
var import_uuid10 = require("uuid");
|
|
3261
|
-
var
|
|
3262
|
-
var CABMonetizeAds =
|
|
3263
|
-
requestId:
|
|
3225
|
+
var import_zod36 = require("zod");
|
|
3226
|
+
var CABMonetizeAds = import_zod36.z.object({
|
|
3227
|
+
requestId: import_zod36.z.string().optional(),
|
|
3264
3228
|
/** Defaulted here, never in the beacon: absence of information is `ads` itself being absent. */
|
|
3265
|
-
testing:
|
|
3229
|
+
testing: import_zod36.z.boolean().default(false)
|
|
3266
3230
|
});
|
|
3267
|
-
var CABMonetizeSection =
|
|
3231
|
+
var CABMonetizeSection = import_zod36.z.object({
|
|
3268
3232
|
...CABVariableFields,
|
|
3269
3233
|
ads: CABMonetizeAds.optional(),
|
|
3270
|
-
name:
|
|
3234
|
+
name: import_zod36.z.string().optional(),
|
|
3271
3235
|
/**
|
|
3272
3236
|
* Server-hydrated offer cards (inline hydration): when `/cab/sections` was asked with a `monetize`
|
|
3273
3237
|
* context block, the composed cards ride the marker itself — `[]` means "hydrated, no fill" (render
|
|
3274
3238
|
* nothing, skip the fetch); ABSENT means "not hydrated" (the client fetches via `/cab/monetize`).
|
|
3275
3239
|
*/
|
|
3276
|
-
offers:
|
|
3240
|
+
offers: import_zod36.z.array(import_zod36.z.lazy(() => CABSection)).optional(),
|
|
3277
3241
|
/** Privacy Policy footer href (the widget's `privacy_policy_url` setting); read server-side for hydration, relayed by the client only on the legacy `/cab/monetize` fallback. */
|
|
3278
|
-
privacyPolicyUrl:
|
|
3279
|
-
sectionId:
|
|
3280
|
-
sectionType:
|
|
3242
|
+
privacyPolicyUrl: import_zod36.z.string().optional(),
|
|
3243
|
+
sectionId: import_zod36.z.uuid().default(() => (0, import_uuid10.v7)()),
|
|
3244
|
+
sectionType: import_zod36.z.literal(SectionType.monetize).default(SectionType.monetize),
|
|
3281
3245
|
/** Ads-taxonomy sub-vertical id (the widget's `sub_vertical` setting); paired with `vertical`. */
|
|
3282
|
-
subVertical:
|
|
3246
|
+
subVertical: import_zod36.z.string().optional(),
|
|
3283
3247
|
/** Ads-taxonomy vertical id (the widget's `vertical` setting) — with `subVertical`, the admin Monetize editor's two configurables. */
|
|
3284
|
-
vertical:
|
|
3248
|
+
vertical: import_zod36.z.string().optional()
|
|
3285
3249
|
});
|
|
3286
3250
|
|
|
3287
3251
|
// src/schema/widgets/checkout-and-beyond/progressBar.ts
|
|
3288
|
-
var
|
|
3252
|
+
var import_zod37 = require("zod");
|
|
3289
3253
|
|
|
3290
3254
|
// src/schema/widgets/checkout-and-beyond/giftLabels.ts
|
|
3291
3255
|
var GIFT_LABELS = {
|
|
@@ -3404,34 +3368,34 @@ var GIFT_LABELS = {
|
|
|
3404
3368
|
};
|
|
3405
3369
|
|
|
3406
3370
|
// src/schema/widgets/checkout-and-beyond/progressBar.ts
|
|
3407
|
-
var CABProgressTierExclusion =
|
|
3408
|
-
collectionIds:
|
|
3409
|
-
productIds:
|
|
3410
|
-
tags:
|
|
3411
|
-
type:
|
|
3371
|
+
var CABProgressTierExclusion = import_zod37.z.object({
|
|
3372
|
+
collectionIds: import_zod37.z.array(import_zod37.z.number().int().positive()).default(() => []),
|
|
3373
|
+
productIds: import_zod37.z.array(import_zod37.z.number().int().positive()).default(() => []),
|
|
3374
|
+
tags: import_zod37.z.array(import_zod37.z.string().min(1)).default(() => []),
|
|
3375
|
+
type: import_zod37.z.enum(progressTierExclusionTypes)
|
|
3412
3376
|
});
|
|
3413
|
-
var CABProgressTier =
|
|
3377
|
+
var CABProgressTier = import_zod37.z.object({
|
|
3414
3378
|
/**
|
|
3415
3379
|
* Order-discount tiers only (onsite `discount`): the reward the order-discount Function applies at
|
|
3416
3380
|
* cart time, carried so the client can resolve the `{{discountAmount}}` token in this tier's copy.
|
|
3417
3381
|
* `fixedAmount`: shop-currency CENTS (FX-scaled by the client, like {@link CABProgressTier.threshold});
|
|
3418
3382
|
* `percentage`: the whole-percent number rendered raw (`{n}%`). Absent on non-discount tiers.
|
|
3419
3383
|
*/
|
|
3420
|
-
discount:
|
|
3384
|
+
discount: import_zod37.z.object({ amount: import_zod37.z.number().nonnegative(), type: import_zod37.z.enum(["fixedAmount", "percentage"]) }).optional(),
|
|
3421
3385
|
/**
|
|
3422
3386
|
* Per-tier exclusion rules (onsite `exclusions` when `exclusions_enabled`): lines they match don't count
|
|
3423
3387
|
* toward this tier. Empty (the default, and the converter's output for a disabled or ruleless tier) means
|
|
3424
3388
|
* the tier measures the plain bar-level adjusted progress. Consumers read ONLY the list named by the rule's
|
|
3425
3389
|
* `type` — the converter leaves the other two at `[]`, so a populated off-type list never reaches the tree.
|
|
3426
3390
|
*/
|
|
3427
|
-
exclusions:
|
|
3391
|
+
exclusions: import_zod37.z.array(CABProgressTierExclusion).default(() => []),
|
|
3428
3392
|
/**
|
|
3429
3393
|
* Smart-cart product (gift) tiers only (onsite `filter_oos_variants`): when set, the client drops this
|
|
3430
3394
|
* tier entirely once its gift has NO in-stock eligible variant — the milestone, fill slot and gift
|
|
3431
3395
|
* controls all disappear, mirroring onsite removing the tier from `bar.tiers` before it renders. Absent
|
|
3432
3396
|
* on shipping/discount/decorative tiers and left off by default (the tier renders regardless of stock).
|
|
3433
3397
|
*/
|
|
3434
|
-
filterOosVariants:
|
|
3398
|
+
filterOosVariants: import_zod37.z.boolean().default(false),
|
|
3435
3399
|
/**
|
|
3436
3400
|
* Smart-cart product (gift) tiers only: the reward unlocked at this tier. The client enriches
|
|
3437
3401
|
* `productId`/`variantIds` to live variants (availability, price) and adds the chosen one to the cart
|
|
@@ -3439,10 +3403,10 @@ var CABProgressTier = import_zod40.z.object({
|
|
|
3439
3403
|
* tiers and on tiers with no configured product. Cart add/remove is a later stage; carried here so the
|
|
3440
3404
|
* tree is complete.
|
|
3441
3405
|
*/
|
|
3442
|
-
gift:
|
|
3443
|
-
productId:
|
|
3444
|
-
title:
|
|
3445
|
-
variantIds:
|
|
3406
|
+
gift: import_zod37.z.object({
|
|
3407
|
+
productId: import_zod37.z.number().int().positive(),
|
|
3408
|
+
title: import_zod37.z.string().optional(),
|
|
3409
|
+
variantIds: import_zod37.z.array(import_zod37.z.number().int().positive()).default(() => [])
|
|
3446
3410
|
}).optional(),
|
|
3447
3411
|
/**
|
|
3448
3412
|
* The step-row icon's square size in PIXELS (onsite `product_tier_element_size`, an admin px string the
|
|
@@ -3462,7 +3426,7 @@ var CABProgressTier = import_zod40.z.object({
|
|
|
3462
3426
|
* renderer never spells a fallback), which also makes a tree authored before this field render at
|
|
3463
3427
|
* React's size rather than the old hardcoded 20.
|
|
3464
3428
|
*/
|
|
3465
|
-
iconSizePx:
|
|
3429
|
+
iconSizePx: import_zod37.z.number().int().min(1).max(64).default(18),
|
|
3466
3430
|
/**
|
|
3467
3431
|
* The step-row label at this tier's slot (onsite `getTierLabel`): the merchant custom label, else the
|
|
3468
3432
|
* type default — 'Free Shipping' or '{n}% Discount'. A PRODUCT tier gets NO converter label: its name is
|
|
@@ -3472,35 +3436,35 @@ var CABProgressTier = import_zod40.z.object({
|
|
|
3472
3436
|
* turns a blank label into an absent key, and a client-authored blank means the same thing — the renderer
|
|
3473
3437
|
* emits no caption slot rather than an empty one). Plain text — a compact icon+label.
|
|
3474
3438
|
*/
|
|
3475
|
-
label:
|
|
3439
|
+
label: import_zod37.z.record(import_zod37.z.string(), import_zod37.z.string()).optional(),
|
|
3476
3440
|
/**
|
|
3477
3441
|
* Smart-cart product (gift) tiers only (onsite `product_tier_image`): show the gift's product image in
|
|
3478
3442
|
* the step-row slot instead of the generic bag icon. The converter can't supply the image URL (config
|
|
3479
3443
|
* carries only product IDs), so the client resolves it (authoritative Shopify featured image, React
|
|
3480
3444
|
* parity) and falls back to the bag icon when the flag is off or no image resolves. Default false.
|
|
3481
3445
|
*/
|
|
3482
|
-
productTierImage:
|
|
3446
|
+
productTierImage: import_zod37.z.boolean().default(false),
|
|
3483
3447
|
/**
|
|
3484
3448
|
* The tier's goal, measured per `unit`. `currency` (default): SHOP-currency cents — the canonical
|
|
3485
3449
|
* fallback: when the buyer's presentment currency has no entry in `thresholds`, the client
|
|
3486
3450
|
* multiplies this by the live FX rate (converter maps the v1 `unlock_price`, e.g. `75` → `7500`).
|
|
3487
3451
|
* `item`: a raw item count — no cents, no FX, no `thresholds` overrides.
|
|
3488
3452
|
*/
|
|
3489
|
-
threshold:
|
|
3453
|
+
threshold: import_zod37.z.number().int().nonnegative(),
|
|
3490
3454
|
/**
|
|
3491
3455
|
* Per-presentment-currency goal overrides — lowercased ISO currency code → cents (e.g. `{ cad: 9900 }`).
|
|
3492
3456
|
* When the buyer's currency has an entry, the client uses it verbatim INSTEAD of FX-converting
|
|
3493
3457
|
* `threshold`, so merchants show intentional, clean per-market amounts (Shopify Markets) rather than a
|
|
3494
3458
|
* converted base. Defaults to `{}` — no overrides means always fall back to `threshold`.
|
|
3495
3459
|
*/
|
|
3496
|
-
thresholds:
|
|
3460
|
+
thresholds: import_zod37.z.record(import_zod37.z.string(), import_zod37.z.number().int().nonnegative()).default(() => ({})),
|
|
3497
3461
|
/**
|
|
3498
3462
|
* Smart-cart tier identifier, mirrored onto the gift cart line's `_tier` attribute so the client can
|
|
3499
3463
|
* match an in-cart gift back to its tier (add on reach, remove on downgrade/decline). Absent on the
|
|
3500
3464
|
* shipping bar (single unlabeled tier, no gift).
|
|
3501
3465
|
*/
|
|
3502
|
-
tierId:
|
|
3503
|
-
tierType:
|
|
3466
|
+
tierId: import_zod37.z.string().optional(),
|
|
3467
|
+
tierType: import_zod37.z.enum(progressTierTypes).default(ProgressTierType.shipping),
|
|
3504
3468
|
/**
|
|
3505
3469
|
* What this tier's progress is measured in — PER TIER (onsite's `unlock_condition_type` model, NOT
|
|
3506
3470
|
* the React port's bar-level `tiers[0]` shortcut). `currency` compares money cents against the
|
|
@@ -3511,9 +3475,9 @@ var CABProgressTier = import_zod40.z.object({
|
|
|
3511
3475
|
* count carries no injected noun (no English `item`/`items` inflection on localized copy); merchant
|
|
3512
3476
|
* template text supplies grammatically-neutral wording around the token.
|
|
3513
3477
|
*/
|
|
3514
|
-
unit:
|
|
3478
|
+
unit: import_zod37.z.enum(progressTierUnits).default(ProgressTierUnit.currency)
|
|
3515
3479
|
});
|
|
3516
|
-
var CABProgressBarSection =
|
|
3480
|
+
var CABProgressBarSection = import_zod37.z.lazy(
|
|
3517
3481
|
() => CABLayoutSection.omit({ sectionType: true }).extend({
|
|
3518
3482
|
/**
|
|
3519
3483
|
* The onsite bar id (smart-cart TPB bars only). The client mirrors it to the cart's `_barId` attribute
|
|
@@ -3522,35 +3486,35 @@ var CABProgressBarSection = import_zod40.z.lazy(
|
|
|
3522
3486
|
* checkout reaches the extension without it, so the client writes it or the tier gift's 100% discount
|
|
3523
3487
|
* (and any tier order discount) never applies. Absent on the v1 shipping bar (no gift tiers, no id).
|
|
3524
3488
|
*/
|
|
3525
|
-
barId:
|
|
3489
|
+
barId: import_zod37.z.string().optional(),
|
|
3526
3490
|
/** Empty = shown everywhere; otherwise uppercase ISO country codes. */
|
|
3527
|
-
countryCodes:
|
|
3491
|
+
countryCodes: import_zod37.z.array(import_zod37.z.string().transform((code) => code.trim().toUpperCase())).default(() => []),
|
|
3528
3492
|
/**
|
|
3529
3493
|
* Uppercase ISO codes where a higher-precedence geo bar applies, so this (default, non-geo) bar is
|
|
3530
3494
|
* hidden there — replicates React `getbar`'s geo-match-over-default precedence. Empty = never excluded.
|
|
3531
3495
|
*/
|
|
3532
|
-
excludeCountryCodes:
|
|
3496
|
+
excludeCountryCodes: import_zod37.z.array(import_zod37.z.string().transform((code) => code.trim().toUpperCase())).default(() => []),
|
|
3533
3497
|
/**
|
|
3534
3498
|
* Measure progress against the PRE-discount subtotal (onsite `exclude_discount_in_subtotal`, and
|
|
3535
3499
|
* forced on for bars with a discount tier so its own reward can't un-reach the tier). The client
|
|
3536
3500
|
* adds the cart's discount allocations back to the live subtotal.
|
|
3537
3501
|
*/
|
|
3538
|
-
excludeDiscountInSubtotal:
|
|
3502
|
+
excludeDiscountInSubtotal: import_zod37.z.boolean().default(false),
|
|
3539
3503
|
/** Variant ids the client subtracts from the adjusted subtotal (React `bar.excluded_products`). */
|
|
3540
|
-
excludedVariantIds:
|
|
3504
|
+
excludedVariantIds: import_zod37.z.array(import_zod37.z.number().int().positive()).default(() => []),
|
|
3541
3505
|
/**
|
|
3542
3506
|
* When the cart holds a subscription item, treat the bar as reached regardless of subtotal (React
|
|
3543
3507
|
* `free_shipping_on_subscription(s)`). `freeShippingOnAll` is already a zero-threshold tier instead.
|
|
3544
3508
|
*/
|
|
3545
|
-
freeShippingOnSubscription:
|
|
3509
|
+
freeShippingOnSubscription: import_zod37.z.boolean().default(false),
|
|
3546
3510
|
/** Localized heading over the gift controls (onsite `gift_area_title`, default 'FREE GIFTS'). */
|
|
3547
|
-
giftAreaTitle:
|
|
3511
|
+
giftAreaTitle: import_zod37.z.record(import_zod37.z.string(), import_zod37.z.string()).default(() => ({ en: "FREE GIFTS" })),
|
|
3548
3512
|
/** Localized gift-control labels (add/remove/heading); a tier's gift `title` beats `yourGift`. */
|
|
3549
|
-
giftLabels:
|
|
3550
|
-
addGift:
|
|
3551
|
-
remove:
|
|
3552
|
-
selectOptions:
|
|
3553
|
-
yourGift:
|
|
3513
|
+
giftLabels: import_zod37.z.object({
|
|
3514
|
+
addGift: import_zod37.z.record(import_zod37.z.string(), import_zod37.z.string()).default(() => ({ ...GIFT_LABELS.addGift })),
|
|
3515
|
+
remove: import_zod37.z.record(import_zod37.z.string(), import_zod37.z.string()).default(() => ({ ...GIFT_LABELS.remove })),
|
|
3516
|
+
selectOptions: import_zod37.z.record(import_zod37.z.string(), import_zod37.z.string()).default(() => ({ ...GIFT_LABELS.selectOptions })),
|
|
3517
|
+
yourGift: import_zod37.z.record(import_zod37.z.string(), import_zod37.z.string()).default(() => ({ ...GIFT_LABELS.yourGift }))
|
|
3554
3518
|
}).default(() => ({
|
|
3555
3519
|
addGift: { ...GIFT_LABELS.addGift },
|
|
3556
3520
|
remove: { ...GIFT_LABELS.remove },
|
|
@@ -3558,38 +3522,38 @@ var CABProgressBarSection = import_zod40.z.lazy(
|
|
|
3558
3522
|
yourGift: { ...GIFT_LABELS.yourGift }
|
|
3559
3523
|
})),
|
|
3560
3524
|
/** The bar's a11y label; the merchant names it in the editor, else this default (React parity). */
|
|
3561
|
-
name:
|
|
3525
|
+
name: import_zod37.z.string().default("Order progress"),
|
|
3562
3526
|
/**
|
|
3563
3527
|
* Bar fill color. An explicit (widget-authored) value is used verbatim; when absent the server
|
|
3564
3528
|
* fills it with the live shop theme's `buttonBackground` (React `useRebuyTheme` parity). Still
|
|
3565
3529
|
* absent after that ⇒ the theme fetch failed and the client renders its platform-default bar —
|
|
3566
3530
|
* optional, not defaulted, so "merchant chose no color" stays distinguishable from any real value.
|
|
3567
3531
|
*/
|
|
3568
|
-
progressColor:
|
|
3569
|
-
sectionType:
|
|
3532
|
+
progressColor: import_zod37.z.string().optional(),
|
|
3533
|
+
sectionType: import_zod37.z.literal(SectionType.progressBar).default(SectionType.progressBar),
|
|
3570
3534
|
/**
|
|
3571
3535
|
* The bar's milestones in the merchant's CONFIGURED order — the renderer does NOT sort them (022
|
|
3572
3536
|
* O-B2: sorting by resolved threshold reversed configured milestones on out-of-order or mixed-unit
|
|
3573
3537
|
* count-vs-cents bars). Drives the fill (even slot per tier) and, for smart-cart product tiers, the
|
|
3574
3538
|
* gift add/remove. The visual tier display lives in `sections` (composable), NOT here.
|
|
3575
3539
|
*/
|
|
3576
|
-
tiers:
|
|
3540
|
+
tiers: import_zod37.z.union([import_zod37.z.array(CABProgressTier), import_zod37.z.strictObject({}).transform(() => [])]).default(() => [])
|
|
3577
3541
|
})
|
|
3578
3542
|
);
|
|
3579
3543
|
|
|
3580
3544
|
// src/schema/widgets/checkout-and-beyond/quantity.ts
|
|
3581
3545
|
var import_uuid11 = require("uuid");
|
|
3582
|
-
var
|
|
3583
|
-
var CABQuantitySection =
|
|
3546
|
+
var import_zod38 = require("zod");
|
|
3547
|
+
var CABQuantitySection = import_zod38.z.object({
|
|
3584
3548
|
...CABVariableFields,
|
|
3585
|
-
errorMessages:
|
|
3586
|
-
|
|
3587
|
-
|
|
3549
|
+
errorMessages: import_zod38.z.record(
|
|
3550
|
+
import_zod38.z.string(),
|
|
3551
|
+
import_zod38.z.object({
|
|
3588
3552
|
/** `{{step}}` is interpolated at render — the off-increment message React never gave a merchant key. */
|
|
3589
|
-
increment:
|
|
3590
|
-
max:
|
|
3591
|
-
min:
|
|
3592
|
-
neg:
|
|
3553
|
+
increment: import_zod38.z.string().optional(),
|
|
3554
|
+
max: import_zod38.z.string().optional(),
|
|
3555
|
+
min: import_zod38.z.string().optional(),
|
|
3556
|
+
neg: import_zod38.z.string().optional()
|
|
3593
3557
|
})
|
|
3594
3558
|
).default({
|
|
3595
3559
|
en: {
|
|
@@ -3599,18 +3563,18 @@ var CABQuantitySection = import_zod41.z.object({
|
|
|
3599
3563
|
neg: "Quantity cannot be negative"
|
|
3600
3564
|
}
|
|
3601
3565
|
}),
|
|
3602
|
-
inputType:
|
|
3603
|
-
max:
|
|
3604
|
-
min:
|
|
3566
|
+
inputType: import_zod38.z.enum(quantityInputs).default(QuantityInput.select),
|
|
3567
|
+
max: import_zod38.z.number().min(1).max(100).default(10),
|
|
3568
|
+
min: import_zod38.z.number().min(1).default(1),
|
|
3605
3569
|
/** The a11y label for the quantity control; the merchant names it in the editor, else this default. */
|
|
3606
|
-
name:
|
|
3607
|
-
sectionId:
|
|
3608
|
-
sectionType:
|
|
3570
|
+
name: import_zod38.z.string().default("Quantity"),
|
|
3571
|
+
sectionId: import_zod38.z.uuid().default(() => (0, import_uuid11.v7)()),
|
|
3572
|
+
sectionType: import_zod38.z.literal(SectionType.quantity).default(SectionType.quantity)
|
|
3609
3573
|
});
|
|
3610
3574
|
|
|
3611
3575
|
// src/schema/widgets/checkout-and-beyond/reviews.ts
|
|
3612
3576
|
var import_uuid12 = require("uuid");
|
|
3613
|
-
var
|
|
3577
|
+
var import_zod39 = require("zod");
|
|
3614
3578
|
|
|
3615
3579
|
// src/schema/widgets/checkout-and-beyond/reviewLabels.ts
|
|
3616
3580
|
var REVIEW_LABELS = {
|
|
@@ -3673,68 +3637,68 @@ var REVIEW_LABELS = {
|
|
|
3673
3637
|
};
|
|
3674
3638
|
|
|
3675
3639
|
// src/schema/widgets/checkout-and-beyond/reviews.ts
|
|
3676
|
-
var CABReviewsSection =
|
|
3640
|
+
var CABReviewsSection = import_zod39.z.object({
|
|
3677
3641
|
...CABVariableFields,
|
|
3678
|
-
color:
|
|
3642
|
+
color: import_zod39.z.string().default("#fadb14"),
|
|
3679
3643
|
/**
|
|
3680
3644
|
* Localized review-count templates (`{{reviewCount}}`), one/other plural forms; the client picks the
|
|
3681
3645
|
* form via `Intl.PluralRules`. Defaults here (schema-first) so every tree localizes without converter
|
|
3682
3646
|
* or merchant work.
|
|
3683
3647
|
*/
|
|
3684
|
-
countLabels:
|
|
3685
|
-
one:
|
|
3686
|
-
other:
|
|
3648
|
+
countLabels: import_zod39.z.object({
|
|
3649
|
+
one: import_zod39.z.record(import_zod39.z.string(), import_zod39.z.string()).default(() => ({ ...REVIEW_LABELS.one })),
|
|
3650
|
+
other: import_zod39.z.record(import_zod39.z.string(), import_zod39.z.string()).default(() => ({ ...REVIEW_LABELS.other }))
|
|
3687
3651
|
}).default(() => ({ one: { ...REVIEW_LABELS.one }, other: { ...REVIEW_LABELS.other } })),
|
|
3688
|
-
name:
|
|
3689
|
-
sectionId:
|
|
3690
|
-
sectionType:
|
|
3691
|
-
size:
|
|
3652
|
+
name: import_zod39.z.string().optional(),
|
|
3653
|
+
sectionId: import_zod39.z.uuid().default(() => (0, import_uuid12.v7)()),
|
|
3654
|
+
sectionType: import_zod39.z.literal(SectionType.reviews).default(SectionType.reviews),
|
|
3655
|
+
size: import_zod39.z.enum(reviewsSizes).default(ReviewsSize.default),
|
|
3692
3656
|
/**
|
|
3693
3657
|
* Star outline color, interpolated into a style by the renderer, so it is hex-constrained like
|
|
3694
3658
|
* `CABButtonSection.color`. The legacy source (`PostPurchaseSettings.styles.starStrokeColor`) is a free
|
|
3695
3659
|
* string: its converter must validate and fall back to this default rather than let one odd value drop
|
|
3696
3660
|
* the whole reviews section.
|
|
3697
3661
|
*/
|
|
3698
|
-
strokeColor:
|
|
3662
|
+
strokeColor: import_zod39.z.string().regex(HEX_COLOR_REGEX).default("#fadb14"),
|
|
3699
3663
|
/** Star outline width in px; `0` draws no outline. The legacy `styles.strokeWidth` is a STRING ('1') — its converter coerces. */
|
|
3700
|
-
strokeWidth:
|
|
3664
|
+
strokeWidth: import_zod39.z.number().nonnegative().default(0)
|
|
3701
3665
|
});
|
|
3702
3666
|
|
|
3703
3667
|
// src/schema/widgets/checkout-and-beyond/separator.ts
|
|
3704
3668
|
var import_uuid13 = require("uuid");
|
|
3705
|
-
var
|
|
3706
|
-
var CABSeparatorSection =
|
|
3669
|
+
var import_zod40 = require("zod");
|
|
3670
|
+
var CABSeparatorSection = import_zod40.z.object({
|
|
3707
3671
|
...CABVariableFields,
|
|
3708
|
-
sectionId:
|
|
3709
|
-
sectionType:
|
|
3672
|
+
sectionId: import_zod40.z.uuid().default(() => (0, import_uuid13.v7)()),
|
|
3673
|
+
sectionType: import_zod40.z.literal(SectionType.separator).default(SectionType.separator)
|
|
3710
3674
|
});
|
|
3711
3675
|
|
|
3712
3676
|
// src/schema/widgets/checkout-and-beyond/variants.ts
|
|
3713
3677
|
var import_compat5 = require("es-toolkit/compat");
|
|
3714
3678
|
var import_uuid14 = require("uuid");
|
|
3715
|
-
var
|
|
3716
|
-
var CABVariantsSection =
|
|
3679
|
+
var import_zod41 = require("zod");
|
|
3680
|
+
var CABVariantsSection = import_zod41.z.object({
|
|
3717
3681
|
...CABVariableFields,
|
|
3718
|
-
hideOutOfStockVariants:
|
|
3719
|
-
name:
|
|
3720
|
-
sectionId:
|
|
3721
|
-
sectionType:
|
|
3722
|
-
selector:
|
|
3723
|
-
variantMode:
|
|
3682
|
+
hideOutOfStockVariants: import_zod41.z.boolean().default(false),
|
|
3683
|
+
name: import_zod41.z.string().optional(),
|
|
3684
|
+
sectionId: import_zod41.z.uuid().default(() => (0, import_uuid14.v7)()),
|
|
3685
|
+
sectionType: import_zod41.z.literal(SectionType.variants).default(SectionType.variants),
|
|
3686
|
+
selector: import_zod41.z.enum((0, import_compat5.slice)(variantSelectors, 0, 3)).default(VariantSelector.menu),
|
|
3687
|
+
variantMode: import_zod41.z.enum(variantModes).default(VariantMode.multiple)
|
|
3724
3688
|
});
|
|
3725
3689
|
|
|
3726
3690
|
// src/schema/widgets/checkout-and-beyond/shared.ts
|
|
3727
|
-
var CABBorder =
|
|
3728
|
-
radius:
|
|
3729
|
-
style:
|
|
3730
|
-
width:
|
|
3691
|
+
var CABBorder = import_zod42.z.object({
|
|
3692
|
+
radius: import_zod42.z.enum(borderRadii).default(BorderRadius.base),
|
|
3693
|
+
style: import_zod42.z.enum(borderStyles).default(BorderStyle.none),
|
|
3694
|
+
width: import_zod42.z.enum(borderWidths).default(BorderWidth.base)
|
|
3731
3695
|
}).default({
|
|
3732
3696
|
radius: BorderRadius.base,
|
|
3733
3697
|
style: BorderStyle.none,
|
|
3734
3698
|
width: BorderWidth.base
|
|
3735
3699
|
});
|
|
3736
|
-
var CABSection =
|
|
3737
|
-
() =>
|
|
3700
|
+
var CABSection = import_zod42.z.lazy(
|
|
3701
|
+
() => import_zod42.z.discriminatedUnion("sectionType", [
|
|
3738
3702
|
CABBannerSection,
|
|
3739
3703
|
CABButtonSection,
|
|
3740
3704
|
CABCarouselSection,
|
|
@@ -3757,41 +3721,41 @@ var CABSection = import_zod45.z.lazy(
|
|
|
3757
3721
|
);
|
|
3758
3722
|
|
|
3759
3723
|
// src/schema/widgets/checkout-and-beyond/layout.ts
|
|
3760
|
-
var GridItem =
|
|
3761
|
-
var CABLayoutWrapping =
|
|
3762
|
-
breakAt:
|
|
3763
|
-
maxPerLine:
|
|
3724
|
+
var GridItem = import_zod43.z.union([import_zod43.z.literal("auto"), import_zod43.z.literal("fill"), import_zod43.z.string().regex(/^\d+%$/), import_zod43.z.number()]);
|
|
3725
|
+
var CABLayoutWrapping = import_zod43.z.object({
|
|
3726
|
+
breakAt: import_zod43.z.number().positive(),
|
|
3727
|
+
maxPerLine: import_zod43.z.number().int().positive()
|
|
3764
3728
|
});
|
|
3765
|
-
var CABLayoutSection =
|
|
3729
|
+
var CABLayoutSection = import_zod43.z.object({
|
|
3766
3730
|
...CABVariableFields,
|
|
3767
|
-
alignment:
|
|
3768
|
-
horizontal:
|
|
3769
|
-
vertical:
|
|
3731
|
+
alignment: import_zod43.z.object({
|
|
3732
|
+
horizontal: import_zod43.z.enum(horizontalAlignments).default(HorizontalAlignment.start),
|
|
3733
|
+
vertical: import_zod43.z.enum(verticalAlignments).default(VerticalAlignment.top)
|
|
3770
3734
|
}).default({
|
|
3771
3735
|
horizontal: HorizontalAlignment.start,
|
|
3772
3736
|
vertical: VerticalAlignment.top
|
|
3773
3737
|
}),
|
|
3774
|
-
border:
|
|
3775
|
-
buttonField:
|
|
3776
|
-
direction:
|
|
3738
|
+
border: import_zod43.z.lazy(() => CABBorder),
|
|
3739
|
+
buttonField: import_zod43.z.enum(buttonFields).optional(),
|
|
3740
|
+
direction: import_zod43.z.enum(directions).default(Direction.rows),
|
|
3777
3741
|
/**
|
|
3778
3742
|
* Platform chrome around the section, not a layout behavior: `callout` is a subdued box with block borders
|
|
3779
3743
|
* (the legacy post-purchase callout banner), `offer-content` the post-purchase offer's own content card.
|
|
3780
3744
|
*/
|
|
3781
|
-
frame:
|
|
3782
|
-
grid:
|
|
3783
|
-
columns:
|
|
3784
|
-
rows:
|
|
3745
|
+
frame: import_zod43.z.enum(layoutFrames).optional(),
|
|
3746
|
+
grid: import_zod43.z.object({
|
|
3747
|
+
columns: import_zod43.z.union([import_zod43.z.array(GridItem), import_zod43.z.undefined()]).default(() => ["auto"]),
|
|
3748
|
+
rows: import_zod43.z.union([import_zod43.z.array(GridItem), import_zod43.z.undefined()]).default(() => ["auto"])
|
|
3785
3749
|
}).default({ columns: ["auto"], rows: ["auto"] }).optional(),
|
|
3786
|
-
name:
|
|
3787
|
-
padding:
|
|
3788
|
-
sectionId:
|
|
3789
|
-
sections:
|
|
3790
|
-
sectionType:
|
|
3791
|
-
spacing:
|
|
3750
|
+
name: import_zod43.z.string().optional(),
|
|
3751
|
+
padding: import_zod43.z.enum(spacings).default(Spacing.none),
|
|
3752
|
+
sectionId: import_zod43.z.uuid().default(() => (0, import_uuid15.v7)()),
|
|
3753
|
+
sections: import_zod43.z.union([import_zod43.z.array(import_zod43.z.lazy(() => CABSection)), import_zod43.z.strictObject({}).transform(() => [])]).default(() => []),
|
|
3754
|
+
sectionType: import_zod43.z.literal(SectionType.layout).default(SectionType.layout),
|
|
3755
|
+
spacing: import_zod43.z.enum(spacings).default(Spacing.base),
|
|
3792
3756
|
/** Fire-and-forget impression pixel POSTed once when the section is shown (e.g. a Monetize offer view). */
|
|
3793
|
-
viewUrl:
|
|
3794
|
-
width:
|
|
3757
|
+
viewUrl: import_zod43.z.string().optional(),
|
|
3758
|
+
width: import_zod43.z.number().default(100),
|
|
3795
3759
|
wrapping: CABLayoutWrapping.optional()
|
|
3796
3760
|
});
|
|
3797
3761
|
|
|
@@ -3813,8 +3777,8 @@ var UI_LABELS = {
|
|
|
3813
3777
|
};
|
|
3814
3778
|
|
|
3815
3779
|
// src/schema/widgets/checkout-and-beyond/root.ts
|
|
3816
|
-
var localized = (fallback) =>
|
|
3817
|
-
var CABUILabels =
|
|
3780
|
+
var localized = (fallback) => import_zod44.z.record(import_zod44.z.string(), import_zod44.z.string()).default(() => ({ ...fallback })).transform((labels) => Object.keys(labels).length > 0 ? labels : { ...fallback });
|
|
3781
|
+
var CABUILabels = import_zod44.z.object({
|
|
3818
3782
|
currentPage: localized(UI_LABELS.currentPage),
|
|
3819
3783
|
guest: localized(UI_LABELS.guest),
|
|
3820
3784
|
loadingOptions: localized(UI_LABELS.loadingOptions),
|
|
@@ -3839,42 +3803,141 @@ var CABUILabels = import_zod47.z.object({
|
|
|
3839
3803
|
subscriptionOptions: { ...UI_LABELS.subscriptionOptions },
|
|
3840
3804
|
updating: { ...UI_LABELS.updating }
|
|
3841
3805
|
}));
|
|
3842
|
-
var TargetArea =
|
|
3843
|
-
fill:
|
|
3844
|
-
flip:
|
|
3845
|
-
icon:
|
|
3846
|
-
label:
|
|
3847
|
-
width:
|
|
3806
|
+
var TargetArea = import_zod44.z.object({
|
|
3807
|
+
fill: import_zod44.z.boolean().optional(),
|
|
3808
|
+
flip: import_zod44.z.enum(["both", "horizontal", "vertical"]).optional(),
|
|
3809
|
+
icon: import_zod44.z.string(),
|
|
3810
|
+
label: import_zod44.z.string(),
|
|
3811
|
+
width: import_zod44.z.string()
|
|
3848
3812
|
}).default(targetAreas[EditorMode.checkoutExtension][1]);
|
|
3849
|
-
var CABTracking =
|
|
3850
|
-
enableAttribution:
|
|
3851
|
-
enableSource:
|
|
3852
|
-
enableWidget:
|
|
3813
|
+
var CABTracking = import_zod44.z.object({
|
|
3814
|
+
enableAttribution: import_zod44.z.boolean().nullish().transform((value) => value ?? true),
|
|
3815
|
+
enableSource: import_zod44.z.boolean().nullish().transform((value) => value ?? true),
|
|
3816
|
+
enableWidget: import_zod44.z.boolean().nullish().transform((value) => value ?? true)
|
|
3853
3817
|
}).nullish().transform((value) => value ?? { enableAttribution: true, enableSource: true, enableWidget: true });
|
|
3854
|
-
var CABExperiment =
|
|
3855
|
-
elementId:
|
|
3856
|
-
experimentId:
|
|
3857
|
-
experimentType:
|
|
3858
|
-
selectedId:
|
|
3818
|
+
var CABExperiment = import_zod44.z.object({
|
|
3819
|
+
elementId: import_zod44.z.number(),
|
|
3820
|
+
experimentId: import_zod44.z.number(),
|
|
3821
|
+
experimentType: import_zod44.z.string(),
|
|
3822
|
+
selectedId: import_zod44.z.number()
|
|
3859
3823
|
});
|
|
3860
3824
|
var CABRootSection = CABLayoutSection.extend({
|
|
3861
|
-
editorMode:
|
|
3825
|
+
editorMode: import_zod44.z.enum(editorModes).default(EditorMode.checkoutExtension),
|
|
3862
3826
|
experiment: CABExperiment.optional(),
|
|
3863
3827
|
// Same rule as CABTracking above: the v1 converters pass raw legacy `previewMode` through, so a
|
|
3864
3828
|
// `null` must fall back rather than throw the widget; malformed values still throw.
|
|
3865
|
-
previewMode:
|
|
3866
|
-
storeId:
|
|
3829
|
+
previewMode: import_zod44.z.boolean().nullish().transform((value) => value ?? false),
|
|
3830
|
+
storeId: import_zod44.z.number().nullable().default(null),
|
|
3867
3831
|
targetArea: TargetArea.nullable(),
|
|
3868
3832
|
tracking: CABTracking,
|
|
3869
|
-
type:
|
|
3833
|
+
type: import_zod44.z.enum(widgetTypes).default(WidgetType.ui_extension_content_block),
|
|
3870
3834
|
uiLabels: CABUILabels,
|
|
3871
|
-
version:
|
|
3872
|
-
widgetId:
|
|
3835
|
+
version: import_zod44.z.literal(2).default(2),
|
|
3836
|
+
widgetId: import_zod44.z.number().nullable().default(null)
|
|
3837
|
+
});
|
|
3838
|
+
|
|
3839
|
+
// src/schema/postPurchaseProductView.ts
|
|
3840
|
+
var PostPurchaseProductView = import_zod45.z.union([
|
|
3841
|
+
import_zod45.z.object({
|
|
3842
|
+
groupCatalog: PostPurchaseGroupCatalog.optional(),
|
|
3843
|
+
initialVariant: PostPurchaseVariantSelector.optional(),
|
|
3844
|
+
planCatalog: PostPurchasePlanCatalog.nullable().optional(),
|
|
3845
|
+
preparation: PreparedPostPurchaseProduct.extend({
|
|
3846
|
+
display: PreparedPostPurchaseProduct.shape.display.extend({ description: import_zod45.z.string().nullable() }).refine(
|
|
3847
|
+
({ description, descriptionDocument }) => description === null === (descriptionDocument !== void 0),
|
|
3848
|
+
"Exactly one of the plain and rich descriptions is shown"
|
|
3849
|
+
)
|
|
3850
|
+
}),
|
|
3851
|
+
purchaseOptions: PostPurchaseOptions.optional(),
|
|
3852
|
+
sections: CABRootSection,
|
|
3853
|
+
variantCatalog: PostPurchaseVariantCatalog.optional()
|
|
3854
|
+
}),
|
|
3855
|
+
import_zod45.z.object({
|
|
3856
|
+
groupCatalog: PostPurchaseGroupCatalog.optional(),
|
|
3857
|
+
initialVariant: PostPurchaseVariantSelector.optional(),
|
|
3858
|
+
planCatalog: PostPurchasePlanCatalog.nullable().optional(),
|
|
3859
|
+
preparation: PostPurchasePreparation.options[1],
|
|
3860
|
+
purchaseOptions: PostPurchaseOptions.optional(),
|
|
3861
|
+
sections: import_zod45.z.null(),
|
|
3862
|
+
variantCatalog: PostPurchaseVariantCatalog.optional()
|
|
3863
|
+
})
|
|
3864
|
+
]);
|
|
3865
|
+
|
|
3866
|
+
// src/schema/postPurchaseProductCollectionView.ts
|
|
3867
|
+
var PostPurchaseProductCollectionView = import_zod46.z.object({
|
|
3868
|
+
members: import_zod46.z.array(
|
|
3869
|
+
import_zod46.z.object({
|
|
3870
|
+
productId: PostPurchaseProductId,
|
|
3871
|
+
productIndex: import_zod46.z.number().int().nonnegative(),
|
|
3872
|
+
view: PostPurchaseProductView
|
|
3873
|
+
})
|
|
3874
|
+
)
|
|
3875
|
+
});
|
|
3876
|
+
var PostPurchaseCollectionChoice = import_zod46.z.object({
|
|
3877
|
+
choice: PostPurchaseChoice.optional(),
|
|
3878
|
+
productId: PostPurchaseProductId,
|
|
3879
|
+
variantId: PostPurchaseVariantSelector.shape.variantId.optional()
|
|
3880
|
+
}).strict();
|
|
3881
|
+
var PostPurchaseExcludedProductIds = import_zod46.z.array(PostPurchaseProductId).default([]);
|
|
3882
|
+
|
|
3883
|
+
// src/schema/postPurchaseQuantity.ts
|
|
3884
|
+
var quantity = PreparedPostPurchaseProduct.shape.selection.shape.quantity;
|
|
3885
|
+
var PostPurchaseQuantityChoice = PostPurchaseCollectionChoice.extend({ quantity: quantity.optional() });
|
|
3886
|
+
var PostPurchaseQuantityPolicy = PostPurchaseSettings.shape.quantityInputs.omit({ defaultQuantity: true }).extend({
|
|
3887
|
+
initialQuantity: quantity,
|
|
3888
|
+
maxValue: quantity,
|
|
3889
|
+
minValue: import_zod47.z.literal(0).transform(() => 1).or(quantity)
|
|
3890
|
+
}).refine(({ maxValue, minValue }) => minValue <= maxValue, "Quantity bounds are reversed");
|
|
3891
|
+
|
|
3892
|
+
// src/schema/postPurchaseGroup.ts
|
|
3893
|
+
var PostPurchaseGroupChoice = PostPurchaseQuantityChoice.extend({
|
|
3894
|
+
memberProductId: PreparedPostPurchaseProduct.shape.selection.shape.productId
|
|
3895
|
+
});
|
|
3896
|
+
|
|
3897
|
+
// src/schema/postPurchaseIdentity.ts
|
|
3898
|
+
var import_zod48 = require("zod");
|
|
3899
|
+
var POST_PURCHASE_ID_MAX = 128;
|
|
3900
|
+
var PostPurchaseTimestampSchema = import_zod48.z.number().int().nonnegative();
|
|
3901
|
+
var PostPurchaseOrderIdSchema = import_zod48.z.string().regex(/^gid:\/\/shopify\/Order\/[1-9]\d*$/);
|
|
3902
|
+
var ShopifyDomainSchema = import_zod48.z.string().max(POST_PURCHASE_ID_MAX).regex(/^[a-z0-9]([a-z0-9-]*[a-z0-9])?\.myshopify\.com$/);
|
|
3903
|
+
var DecideRequestSchema = import_zod48.z.object({
|
|
3904
|
+
checkoutToken: import_zod48.z.string().min(1).max(POST_PURCHASE_ID_MAX),
|
|
3905
|
+
shop: ShopifyDomainSchema
|
|
3906
|
+
});
|
|
3907
|
+
var PostPurchaseAppIdSchema = import_zod48.z.string().min(1).max(POST_PURCHASE_ID_MAX);
|
|
3908
|
+
var DecisionEntrySchema = import_zod48.z.object({
|
|
3909
|
+
blockId: import_zod48.z.number().int().positive(),
|
|
3910
|
+
blockIndex: import_zod48.z.string(),
|
|
3911
|
+
blockParentIndex: import_zod48.z.string(),
|
|
3912
|
+
flowId: import_zod48.z.number().int().positive(),
|
|
3913
|
+
sectionId: import_zod48.z.number().int().positive(),
|
|
3914
|
+
widgetId: import_zod48.z.number().int().positive(),
|
|
3915
|
+
widgetTraffic: import_zod48.z.number().min(0).max(100)
|
|
3916
|
+
});
|
|
3917
|
+
|
|
3918
|
+
// src/schema/postPurchaseOfferEligibility.ts
|
|
3919
|
+
var import_zod49 = require("zod");
|
|
3920
|
+
var selection = PreparedPostPurchaseProduct.shape.selection;
|
|
3921
|
+
var PostPurchaseOfferSkipReason = import_zod49.z.enum(["empty", "no-eligible-subscription"]);
|
|
3922
|
+
var PostPurchaseOfferEligibilityContext = import_zod49.z.object({
|
|
3923
|
+
excludedProductIds: PostPurchaseExcludedProductIds,
|
|
3924
|
+
originalLineItems: import_zod49.z.array(selection.pick({ productId: true, sellingPlanId: true, variantId: true }))
|
|
3873
3925
|
});
|
|
3926
|
+
var PostPurchaseOfferEligibility = import_zod49.z.discriminatedUnion("status", [
|
|
3927
|
+
import_zod49.z.object({
|
|
3928
|
+
members: import_zod49.z.array(
|
|
3929
|
+
import_zod49.z.object({ productId: selection.shape.productId, productIndex: import_zod49.z.number().int().nonnegative() })
|
|
3930
|
+
),
|
|
3931
|
+
status: import_zod49.z.literal("retain")
|
|
3932
|
+
}),
|
|
3933
|
+
import_zod49.z.object({ reason: PostPurchaseOfferSkipReason, status: import_zod49.z.literal("skip") }),
|
|
3934
|
+
import_zod49.z.object({ reason: import_zod49.z.literal("eligible-upgrade").optional(), status: import_zod49.z.literal("unavailable") })
|
|
3935
|
+
]);
|
|
3874
3936
|
|
|
3875
3937
|
// src/schema/postPurchaseOfferPresentation.ts
|
|
3938
|
+
var import_zod50 = require("zod");
|
|
3876
3939
|
var language2 = PostPurchaseSettings.shape.language.shape.global.unwrap().unwrap();
|
|
3877
|
-
var PostPurchaseOfferPresentation =
|
|
3940
|
+
var PostPurchaseOfferPresentation = import_zod50.z.strictObject({
|
|
3878
3941
|
labels: language2.pick({ declineAll: true, declineThisOffer: true }),
|
|
3879
3942
|
layout: PostPurchaseSettings.shape.offersLayout,
|
|
3880
3943
|
sections: CABRootSection.nullable(),
|
|
@@ -3882,22 +3945,22 @@ var PostPurchaseOfferPresentation = import_zod48.z.strictObject({
|
|
|
3882
3945
|
});
|
|
3883
3946
|
|
|
3884
3947
|
// src/schema/postPurchaseOrderDecision.ts
|
|
3885
|
-
var
|
|
3886
|
-
var OrderDecisionSchema =
|
|
3887
|
-
|
|
3888
|
-
|
|
3948
|
+
var import_zod51 = require("zod");
|
|
3949
|
+
var OrderDecisionSchema = import_zod51.z.discriminatedUnion("owner", [
|
|
3950
|
+
import_zod51.z.object({ owner: import_zod51.z.literal("session"), sessionId: import_zod51.z.string().regex(/^[a-f0-9]{64}$/) }),
|
|
3951
|
+
import_zod51.z.object({ owner: import_zod51.z.literal("release"), sessionId: import_zod51.z.null() })
|
|
3889
3952
|
]);
|
|
3890
3953
|
|
|
3891
3954
|
// src/schema/postPurchasePolicy.ts
|
|
3892
|
-
var
|
|
3893
|
-
var HoldSettingSchema =
|
|
3894
|
-
|
|
3895
|
-
|
|
3955
|
+
var import_zod52 = require("zod");
|
|
3956
|
+
var HoldSettingSchema = import_zod52.z.discriminatedUnion("enabled", [
|
|
3957
|
+
import_zod52.z.object({ durationMinutes: import_zod52.z.number().int().min(1).max(60), enabled: import_zod52.z.literal(true) }),
|
|
3958
|
+
import_zod52.z.object({ durationMinutes: import_zod52.z.null(), enabled: import_zod52.z.literal(false) })
|
|
3896
3959
|
]);
|
|
3897
|
-
var TimingSettingsSchema =
|
|
3960
|
+
var TimingSettingsSchema = import_zod52.z.object({ flowHold: HoldSettingSchema, shopHold: HoldSettingSchema });
|
|
3898
3961
|
var SessionPolicySchema = TimingSettingsSchema.extend({
|
|
3899
|
-
durationMinutes:
|
|
3900
|
-
source:
|
|
3962
|
+
durationMinutes: import_zod52.z.number().int().min(1).max(60).nullable(),
|
|
3963
|
+
source: import_zod52.z.enum(["shop", "flow", "native"])
|
|
3901
3964
|
}).refine(
|
|
3902
3965
|
(policy) => {
|
|
3903
3966
|
const expectedSource = policy.shopHold.enabled ? "shop" : policy.flowHold.enabled ? "flow" : "native";
|
|
@@ -3910,9 +3973,73 @@ var SessionPolicySchema = TimingSettingsSchema.extend({
|
|
|
3910
3973
|
}
|
|
3911
3974
|
);
|
|
3912
3975
|
|
|
3976
|
+
// src/schema/postPurchaseProductCalculation.ts
|
|
3977
|
+
var import_zod53 = require("zod");
|
|
3978
|
+
var MoneyBag = import_zod53.z.object({
|
|
3979
|
+
presentmentMoney: import_zod53.z.object({
|
|
3980
|
+
amount: PostPurchaseAmount,
|
|
3981
|
+
currencyCode: import_zod53.z.string().regex(/^[A-Z]{3}$/)
|
|
3982
|
+
})
|
|
3983
|
+
});
|
|
3984
|
+
var PostPurchaseProductCalculation = import_zod53.z.object({
|
|
3985
|
+
calculatedPurchase: import_zod53.z.object({
|
|
3986
|
+
addedShippingLines: import_zod53.z.array(import_zod53.z.object({ priceSet: MoneyBag })),
|
|
3987
|
+
addedTaxLines: import_zod53.z.array(import_zod53.z.object({ priceSet: MoneyBag })),
|
|
3988
|
+
totalOutstandingSet: MoneyBag,
|
|
3989
|
+
updatedLineItems: import_zod53.z.array(
|
|
3990
|
+
import_zod53.z.object({
|
|
3991
|
+
priceSet: import_zod53.z.unknown().optional(),
|
|
3992
|
+
productId: import_zod53.z.number().int().positive(),
|
|
3993
|
+
sellingPlanId: import_zod53.z.unknown().optional(),
|
|
3994
|
+
variantId: import_zod53.z.number().int().positive()
|
|
3995
|
+
})
|
|
3996
|
+
)
|
|
3997
|
+
}),
|
|
3998
|
+
errors: import_zod53.z.array(import_zod53.z.unknown()).length(0),
|
|
3999
|
+
status: import_zod53.z.literal("processed")
|
|
4000
|
+
});
|
|
4001
|
+
var Minor = import_zod53.z.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER);
|
|
4002
|
+
var PostPurchaseProductCosts = import_zod53.z.object({
|
|
4003
|
+
currencyCode: MoneyBag.shape.presentmentMoney.shape.currencyCode,
|
|
4004
|
+
recurringDisplay: import_zod53.z.object({ shippingMinor: Minor, subtotalMinor: Minor, totalMinor: Minor }).optional(),
|
|
4005
|
+
shippingMinor: Minor,
|
|
4006
|
+
subtotalMinor: Minor,
|
|
4007
|
+
taxesMinor: Minor,
|
|
4008
|
+
totalMinor: Minor
|
|
4009
|
+
});
|
|
4010
|
+
var ChangesetDiscount = import_zod53.z.object({
|
|
4011
|
+
title: import_zod53.z.string(),
|
|
4012
|
+
value: import_zod53.z.number().nonnegative(),
|
|
4013
|
+
valueType: import_zod53.z.enum(["percentage", "fixed_amount"])
|
|
4014
|
+
}).optional();
|
|
4015
|
+
var PostPurchaseProductChangeset = import_zod53.z.object({
|
|
4016
|
+
changes: import_zod53.z.array(
|
|
4017
|
+
import_zod53.z.union([
|
|
4018
|
+
import_zod53.z.object({
|
|
4019
|
+
discount: ChangesetDiscount,
|
|
4020
|
+
quantity: import_zod53.z.number().int().positive(),
|
|
4021
|
+
type: import_zod53.z.literal("add_variant"),
|
|
4022
|
+
variantId: import_zod53.z.number().int().positive()
|
|
4023
|
+
}),
|
|
4024
|
+
import_zod53.z.object({ price: import_zod53.z.number().nonnegative(), title: import_zod53.z.string(), type: import_zod53.z.literal("add_shipping_line") }),
|
|
4025
|
+
PostPurchaseSubscriptionTerms.pick({
|
|
4026
|
+
initialShippingPrice: true,
|
|
4027
|
+
recurringShippingPrice: true,
|
|
4028
|
+
shippingOption: true
|
|
4029
|
+
}).extend({
|
|
4030
|
+
discount: ChangesetDiscount,
|
|
4031
|
+
quantity: import_zod53.z.number().int().positive(),
|
|
4032
|
+
sellingPlanId: import_zod53.z.number().int().positive(),
|
|
4033
|
+
type: import_zod53.z.literal("add_subscription"),
|
|
4034
|
+
variantId: import_zod53.z.number().int().positive()
|
|
4035
|
+
})
|
|
4036
|
+
])
|
|
4037
|
+
)
|
|
4038
|
+
});
|
|
4039
|
+
|
|
3913
4040
|
// src/schema/postPurchaseProductSettings.ts
|
|
3914
|
-
var
|
|
3915
|
-
var amount =
|
|
4041
|
+
var import_zod54 = require("zod");
|
|
4042
|
+
var amount = import_zod54.z.union([import_zod54.z.number().nonnegative(), PostPurchaseAmount.transform(Number)]);
|
|
3916
4043
|
var PostPurchaseProductSettings = PostPurchaseSettings.pick({
|
|
3917
4044
|
discountedFrom: true,
|
|
3918
4045
|
language: true,
|
|
@@ -3924,45 +4051,36 @@ var PostPurchaseProductSettings = PostPurchaseSettings.pick({
|
|
|
3924
4051
|
subscriptionIsDefault: true,
|
|
3925
4052
|
upgradeToSubscription: true
|
|
3926
4053
|
}).extend({
|
|
3927
|
-
advance:
|
|
3928
|
-
blocks:
|
|
4054
|
+
advance: import_zod54.z.unknown().default({}),
|
|
4055
|
+
blocks: import_zod54.z.array(import_zod54.z.unknown()).optional(),
|
|
3929
4056
|
discount: PostPurchaseSettings.shape.discount.extend({ amount: amount.default(30) }),
|
|
3930
|
-
integrations:
|
|
4057
|
+
integrations: import_zod54.z.unknown().default({}),
|
|
3931
4058
|
shipping: PostPurchaseSettings.shape.shipping.extend({ amount: amount.default(10) }),
|
|
3932
|
-
styles:
|
|
4059
|
+
styles: import_zod54.z.unknown().default({}),
|
|
3933
4060
|
subImages: PostPurchaseSettings.shape.subImages.catch(null),
|
|
3934
|
-
subscription:
|
|
4061
|
+
subscription: import_zod54.z.unknown().default(PostPurchaseSettings.shape.subscription.parse(void 0))
|
|
3935
4062
|
});
|
|
3936
4063
|
|
|
3937
|
-
// src/schema/postPurchaseQuantity.ts
|
|
3938
|
-
var import_zod52 = require("zod");
|
|
3939
|
-
var quantity = PreparedPostPurchaseProduct.shape.selection.shape.quantity;
|
|
3940
|
-
var PostPurchaseQuantityPolicy = PostPurchaseSettings.shape.quantityInputs.omit({ defaultQuantity: true }).extend({
|
|
3941
|
-
initialQuantity: quantity,
|
|
3942
|
-
maxValue: quantity,
|
|
3943
|
-
minValue: import_zod52.z.literal(0).transform(() => 1).or(quantity)
|
|
3944
|
-
}).refine(({ maxValue, minValue }) => minValue <= maxValue, "Quantity bounds are reversed");
|
|
3945
|
-
|
|
3946
4064
|
// src/schema/postPurchaseSelection.ts
|
|
3947
|
-
var
|
|
4065
|
+
var import_zod55 = require("zod");
|
|
3948
4066
|
var SelectionClaimsSchema = DecideRequestSchema.extend({
|
|
3949
4067
|
appId: PostPurchaseAppIdSchema,
|
|
3950
4068
|
entry: DecisionEntrySchema,
|
|
3951
|
-
iss:
|
|
3952
|
-
purpose:
|
|
4069
|
+
iss: import_zod55.z.literal("rebuy-api"),
|
|
4070
|
+
purpose: import_zod55.z.literal("post-purchase-selection")
|
|
3953
4071
|
});
|
|
3954
4072
|
var SessionStartRequestSchema = DecideRequestSchema.extend({
|
|
3955
|
-
selectionToken:
|
|
4073
|
+
selectionToken: import_zod55.z.string().min(1).max(8192).optional()
|
|
3956
4074
|
}).strict();
|
|
3957
4075
|
|
|
3958
4076
|
// src/schema/postPurchaseSession.ts
|
|
3959
|
-
var
|
|
4077
|
+
var import_zod56 = require("zod");
|
|
3960
4078
|
var SessionIdentitySchema = DecideRequestSchema.extend({ appId: PostPurchaseAppIdSchema });
|
|
3961
|
-
var SessionOrderTimingSchema =
|
|
4079
|
+
var SessionOrderTimingSchema = import_zod56.z.object({
|
|
3962
4080
|
nativeDeadline: PostPurchaseTimestampSchema,
|
|
3963
4081
|
orderCreatedAt: PostPurchaseTimestampSchema,
|
|
3964
4082
|
orderId: PostPurchaseOrderIdSchema,
|
|
3965
|
-
timingSource:
|
|
4083
|
+
timingSource: import_zod56.z.literal("shopify-order-created-at")
|
|
3966
4084
|
});
|
|
3967
4085
|
var ReadySessionTimingSchema = SessionOrderTimingSchema.extend({
|
|
3968
4086
|
deadline: PostPurchaseTimestampSchema,
|
|
@@ -3979,39 +4097,39 @@ var ReadySessionTimingSchema = SessionOrderTimingSchema.extend({
|
|
|
3979
4097
|
message: "deadline must not exceed nativeDeadline",
|
|
3980
4098
|
path: ["deadline"]
|
|
3981
4099
|
});
|
|
3982
|
-
var SessionStartResponseSchema =
|
|
3983
|
-
data:
|
|
3984
|
-
phase:
|
|
4100
|
+
var SessionStartResponseSchema = import_zod56.z.object({
|
|
4101
|
+
data: import_zod56.z.object({
|
|
4102
|
+
phase: import_zod56.z.literal("render"),
|
|
3985
4103
|
serverNow: PostPurchaseTimestampSchema,
|
|
3986
4104
|
session: ReadySessionTimingSchema,
|
|
3987
|
-
workflowPhase:
|
|
4105
|
+
workflowPhase: import_zod56.z.literal("start")
|
|
3988
4106
|
}),
|
|
3989
|
-
successful:
|
|
4107
|
+
successful: import_zod56.z.literal(true)
|
|
3990
4108
|
});
|
|
3991
4109
|
|
|
3992
4110
|
// src/schema/postPurchaseSessionClose.ts
|
|
3993
|
-
var
|
|
3994
|
-
var SessionClosureSchema =
|
|
4111
|
+
var import_zod57 = require("zod");
|
|
4112
|
+
var SessionClosureSchema = import_zod57.z.object({ closedAt: PostPurchaseTimestampSchema, status: import_zod57.z.literal("closed") });
|
|
3995
4113
|
var SessionCloseRequestSchema = DecideRequestSchema.strict();
|
|
3996
|
-
var SessionCloseResponseSchema =
|
|
4114
|
+
var SessionCloseResponseSchema = import_zod57.z.object({ data: SessionClosureSchema, successful: import_zod57.z.literal(true) });
|
|
3997
4115
|
|
|
3998
4116
|
// src/schema/postPurchaseShadow.ts
|
|
3999
|
-
var
|
|
4000
|
-
var PostPurchaseShadowSelectionSchema =
|
|
4001
|
-
|
|
4002
|
-
|
|
4117
|
+
var import_zod58 = require("zod");
|
|
4118
|
+
var PostPurchaseShadowSelectionSchema = import_zod58.z.discriminatedUnion("verdict", [
|
|
4119
|
+
import_zod58.z.object({ entry: DecisionEntrySchema, verdict: import_zod58.z.literal("render") }),
|
|
4120
|
+
import_zod58.z.object({ verdict: import_zod58.z.literal("skip") })
|
|
4003
4121
|
]);
|
|
4004
|
-
var PostPurchaseShadowReportFields =
|
|
4005
|
-
differences:
|
|
4122
|
+
var PostPurchaseShadowReportFields = import_zod58.z.object({
|
|
4123
|
+
differences: import_zod58.z.array(import_zod58.z.enum(["verdict", "entry", "targeting", "incomplete-capture", "unsupported-configuration"])).refine((differences) => new Set(differences).size === differences.length, {
|
|
4006
4124
|
message: "differences must not contain duplicate entries"
|
|
4007
4125
|
}),
|
|
4008
4126
|
legacySelection: PostPurchaseShadowSelectionSchema,
|
|
4009
|
-
phase:
|
|
4010
|
-
sampleId:
|
|
4127
|
+
phase: import_zod58.z.literal("shouldRender"),
|
|
4128
|
+
sampleId: import_zod58.z.string(),
|
|
4011
4129
|
serverSelection: PostPurchaseShadowSelectionSchema.optional(),
|
|
4012
|
-
status:
|
|
4013
|
-
targetingFlowIds:
|
|
4014
|
-
workflowPhase:
|
|
4130
|
+
status: import_zod58.z.enum(["match", "diverged", "incomplete"]),
|
|
4131
|
+
targetingFlowIds: import_zod58.z.array(import_zod58.z.number().int().positive()),
|
|
4132
|
+
workflowPhase: import_zod58.z.literal("decide")
|
|
4015
4133
|
});
|
|
4016
4134
|
var PostPurchaseShadowReportSchema = PostPurchaseShadowReportFields.refine(
|
|
4017
4135
|
(report) => report.status !== "match" || report.differences.length === 0,
|
|
@@ -4025,30 +4143,30 @@ var PostPurchaseShadowReportSchema = PostPurchaseShadowReportFields.refine(
|
|
|
4025
4143
|
});
|
|
4026
4144
|
|
|
4027
4145
|
// src/schema/postPurchaseSkipTrace.ts
|
|
4028
|
-
var
|
|
4146
|
+
var import_zod59 = require("zod");
|
|
4029
4147
|
var POST_PURCHASE_SKIP_LIMIT = 32;
|
|
4030
|
-
var PostPurchaseSkipTraceSchema =
|
|
4031
|
-
|
|
4148
|
+
var PostPurchaseSkipTraceSchema = import_zod59.z.array(
|
|
4149
|
+
import_zod59.z.object({
|
|
4032
4150
|
entry: DecisionEntrySchema,
|
|
4033
4151
|
reason: PostPurchaseSkipReasonSchema
|
|
4034
4152
|
})
|
|
4035
4153
|
).max(POST_PURCHASE_SKIP_LIMIT);
|
|
4036
4154
|
|
|
4037
4155
|
// src/schema/postPurchaseSubscriptionDisplay.ts
|
|
4038
|
-
var
|
|
4039
|
-
var
|
|
4040
|
-
var PostPurchaseSubscriptionDisplay =
|
|
4041
|
-
comparisonMinor:
|
|
4042
|
-
currencyCode:
|
|
4043
|
-
priceMinor:
|
|
4044
|
-
savingMinor:
|
|
4045
|
-
savingPercent:
|
|
4156
|
+
var import_zod60 = require("zod");
|
|
4157
|
+
var Minor2 = import_zod60.z.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER);
|
|
4158
|
+
var PostPurchaseSubscriptionDisplay = import_zod60.z.object({
|
|
4159
|
+
comparisonMinor: Minor2,
|
|
4160
|
+
currencyCode: import_zod60.z.string().regex(/^[A-Z]{3}$/),
|
|
4161
|
+
priceMinor: Minor2,
|
|
4162
|
+
savingMinor: Minor2,
|
|
4163
|
+
savingPercent: import_zod60.z.number().int().min(0).max(100)
|
|
4046
4164
|
});
|
|
4047
4165
|
|
|
4048
4166
|
// src/schema/postPurchaseSubscriptionProduct.ts
|
|
4049
|
-
var
|
|
4167
|
+
var import_zod61 = require("zod");
|
|
4050
4168
|
var PreparedPostPurchaseSubscription = PreparedPostPurchaseProduct.extend({
|
|
4051
|
-
selection: PreparedPostPurchaseProduct.shape.selection.extend({ sellingPlanId:
|
|
4169
|
+
selection: PreparedPostPurchaseProduct.shape.selection.extend({ sellingPlanId: import_zod61.z.number().int().positive() }),
|
|
4052
4170
|
terms: PreparedPostPurchaseProduct.shape.terms.extend({
|
|
4053
4171
|
subscription: PostPurchaseSubscriptionTerms
|
|
4054
4172
|
}).refine(
|
|
@@ -4061,93 +4179,93 @@ var readPostPurchaseSubscription = (prepared) => {
|
|
|
4061
4179
|
};
|
|
4062
4180
|
|
|
4063
4181
|
// src/schema/postPurchaseVariantDefault.ts
|
|
4064
|
-
var
|
|
4182
|
+
var import_zod62 = require("zod");
|
|
4065
4183
|
var values = PostPurchaseVariantValues.partial().extend({
|
|
4066
4184
|
option1: PostPurchaseVariantValues.shape.option1.nullish()
|
|
4067
4185
|
});
|
|
4068
4186
|
var variant = values.extend({
|
|
4069
4187
|
id: PostPurchaseVariantId,
|
|
4070
|
-
inventoryManagement:
|
|
4071
|
-
inventoryPolicy:
|
|
4072
|
-
inventoryQuantity:
|
|
4188
|
+
inventoryManagement: import_zod62.z.string().nullable(),
|
|
4189
|
+
inventoryPolicy: import_zod62.z.string(),
|
|
4190
|
+
inventoryQuantity: import_zod62.z.number()
|
|
4073
4191
|
});
|
|
4074
|
-
var options =
|
|
4075
|
-
var PostPurchaseVariantDefaultProduct =
|
|
4192
|
+
var options = import_zod62.z.array(PostPurchaseVariantOption.pick({ name: true, values: true }));
|
|
4193
|
+
var PostPurchaseVariantDefaultProduct = import_zod62.z.object({
|
|
4076
4194
|
id: PostPurchaseProductId,
|
|
4077
4195
|
options,
|
|
4078
4196
|
selectedVariant: variant.optional(),
|
|
4079
|
-
variants:
|
|
4197
|
+
variants: import_zod62.z.array(variant)
|
|
4080
4198
|
});
|
|
4081
4199
|
var PostPurchaseVariantDefaultSettings = PostPurchaseSettings.shape.productOptions.pick({
|
|
4082
4200
|
hideOutOfStockVariants: true,
|
|
4083
4201
|
matchVariant: true
|
|
4084
4202
|
});
|
|
4085
|
-
var PostPurchaseOrderAttributes =
|
|
4086
|
-
var PostPurchaseOriginalVariants =
|
|
4087
|
-
|
|
4203
|
+
var PostPurchaseOrderAttributes = import_zod62.z.record(import_zod62.z.string(), import_zod62.z.array(import_zod62.z.string())).default({});
|
|
4204
|
+
var PostPurchaseOriginalVariants = import_zod62.z.array(
|
|
4205
|
+
import_zod62.z.object({ productId: PostPurchaseProductId, variantId: PostPurchaseVariantId })
|
|
4088
4206
|
);
|
|
4089
|
-
var PostPurchaseAttributeProducts =
|
|
4090
|
-
|
|
4207
|
+
var PostPurchaseAttributeProducts = import_zod62.z.array(
|
|
4208
|
+
import_zod62.z.object({ id: PostPurchaseProductId, options, variants: import_zod62.z.array(values.extend({ id: PostPurchaseVariantId })) })
|
|
4091
4209
|
);
|
|
4092
4210
|
|
|
4093
4211
|
// src/schema/postPurchaseVariantDefaultContext.ts
|
|
4094
|
-
var
|
|
4095
|
-
var PostPurchaseVariantDefaultContext =
|
|
4096
|
-
enrichedLineItems:
|
|
4212
|
+
var import_zod63 = require("zod");
|
|
4213
|
+
var PostPurchaseVariantDefaultContext = import_zod63.z.object({
|
|
4214
|
+
enrichedLineItems: import_zod63.z.unknown().optional(),
|
|
4097
4215
|
originalVariants: PostPurchaseOriginalVariants
|
|
4098
4216
|
});
|
|
4099
4217
|
|
|
4100
4218
|
// src/schema/shopConfig.ts
|
|
4101
|
-
var
|
|
4102
|
-
var ShopConfig =
|
|
4103
|
-
activeExperiments:
|
|
4104
|
-
|
|
4105
|
-
data:
|
|
4106
|
-
|
|
4107
|
-
aliasName:
|
|
4108
|
-
cssInput:
|
|
4109
|
-
elementId:
|
|
4110
|
-
id:
|
|
4111
|
-
javascriptInput:
|
|
4112
|
-
traffic:
|
|
4219
|
+
var import_zod64 = require("zod");
|
|
4220
|
+
var ShopConfig = import_zod64.z.object({
|
|
4221
|
+
activeExperiments: import_zod64.z.array(
|
|
4222
|
+
import_zod64.z.object({
|
|
4223
|
+
data: import_zod64.z.array(
|
|
4224
|
+
import_zod64.z.object({
|
|
4225
|
+
aliasName: import_zod64.z.string(),
|
|
4226
|
+
cssInput: import_zod64.z.string().nullish(),
|
|
4227
|
+
elementId: import_zod64.z.coerce.number(),
|
|
4228
|
+
id: import_zod64.z.coerce.number(),
|
|
4229
|
+
javascriptInput: import_zod64.z.string().nullish(),
|
|
4230
|
+
traffic: import_zod64.z.coerce.number()
|
|
4113
4231
|
})
|
|
4114
4232
|
),
|
|
4115
|
-
id:
|
|
4116
|
-
name:
|
|
4117
|
-
pageTarget:
|
|
4118
|
-
pageTargetUrl:
|
|
4119
|
-
placeholderId:
|
|
4120
|
-
type:
|
|
4233
|
+
id: import_zod64.z.coerce.number(),
|
|
4234
|
+
name: import_zod64.z.string(),
|
|
4235
|
+
pageTarget: import_zod64.z.string().nullable(),
|
|
4236
|
+
pageTargetUrl: import_zod64.z.string().nullable(),
|
|
4237
|
+
placeholderId: import_zod64.z.coerce.number().nullable(),
|
|
4238
|
+
type: import_zod64.z.string()
|
|
4121
4239
|
})
|
|
4122
4240
|
),
|
|
4123
|
-
activePackages:
|
|
4124
|
-
|
|
4125
|
-
cancelledAt:
|
|
4126
|
-
id:
|
|
4127
|
-
installedAt:
|
|
4128
|
-
isActive:
|
|
4129
|
-
isBillable:
|
|
4130
|
-
packageId:
|
|
4131
|
-
packageName:
|
|
4132
|
-
shortName:
|
|
4133
|
-
trialDays:
|
|
4134
|
-
uninstalledAt:
|
|
4241
|
+
activePackages: import_zod64.z.array(
|
|
4242
|
+
import_zod64.z.object({
|
|
4243
|
+
cancelledAt: import_zod64.z.string().nullable(),
|
|
4244
|
+
id: import_zod64.z.number(),
|
|
4245
|
+
installedAt: import_zod64.z.string().nullable(),
|
|
4246
|
+
isActive: import_zod64.z.boolean(),
|
|
4247
|
+
isBillable: import_zod64.z.boolean(),
|
|
4248
|
+
packageId: import_zod64.z.number(),
|
|
4249
|
+
packageName: import_zod64.z.string(),
|
|
4250
|
+
shortName: import_zod64.z.string(),
|
|
4251
|
+
trialDays: import_zod64.z.number(),
|
|
4252
|
+
uninstalledAt: import_zod64.z.string().nullable()
|
|
4135
4253
|
})
|
|
4136
4254
|
),
|
|
4137
|
-
apiKey:
|
|
4138
|
-
billingVersion:
|
|
4139
|
-
cacheKey:
|
|
4140
|
-
carousel:
|
|
4141
|
-
currency:
|
|
4142
|
-
currencySymbol:
|
|
4143
|
-
domain:
|
|
4144
|
-
enabledJquery:
|
|
4145
|
-
enabledPresentmentCurrencies:
|
|
4146
|
-
hasSmartCollectionsEnabled:
|
|
4147
|
-
hasSmartSearchEnabled:
|
|
4148
|
-
id:
|
|
4149
|
-
integrations:
|
|
4150
|
-
|
|
4255
|
+
apiKey: import_zod64.z.string(),
|
|
4256
|
+
billingVersion: import_zod64.z.string().nullable(),
|
|
4257
|
+
cacheKey: import_zod64.z.coerce.number(),
|
|
4258
|
+
carousel: import_zod64.z.enum(["flickity", "splide"]),
|
|
4259
|
+
currency: import_zod64.z.string(),
|
|
4260
|
+
currencySymbol: import_zod64.z.string(),
|
|
4261
|
+
domain: import_zod64.z.string(),
|
|
4262
|
+
enabledJquery: import_zod64.z.boolean(),
|
|
4263
|
+
enabledPresentmentCurrencies: import_zod64.z.array(import_zod64.z.string()),
|
|
4264
|
+
hasSmartCollectionsEnabled: import_zod64.z.boolean(),
|
|
4265
|
+
hasSmartSearchEnabled: import_zod64.z.boolean(),
|
|
4266
|
+
id: import_zod64.z.coerce.number(),
|
|
4267
|
+
integrations: import_zod64.z.record(
|
|
4268
|
+
import_zod64.z.enum([
|
|
4151
4269
|
"attentive",
|
|
4152
4270
|
"judgeme",
|
|
4153
4271
|
"junip",
|
|
@@ -4160,170 +4278,170 @@ var ShopConfig = import_zod62.z.object({
|
|
|
4160
4278
|
"stamped",
|
|
4161
4279
|
"yotpo"
|
|
4162
4280
|
]),
|
|
4163
|
-
|
|
4281
|
+
import_zod64.z.union([import_zod64.z.boolean(), import_zod64.z.unknown()])
|
|
4164
4282
|
),
|
|
4165
|
-
markets:
|
|
4166
|
-
enabled:
|
|
4283
|
+
markets: import_zod64.z.object({
|
|
4284
|
+
enabled: import_zod64.z.boolean()
|
|
4167
4285
|
}),
|
|
4168
|
-
monetize:
|
|
4169
|
-
publisherKey:
|
|
4286
|
+
monetize: import_zod64.z.object({
|
|
4287
|
+
publisherKey: import_zod64.z.string().nullable()
|
|
4170
4288
|
}).nullish(),
|
|
4171
|
-
moneyFormat:
|
|
4172
|
-
myshopifyDomain:
|
|
4173
|
-
primaryLocale:
|
|
4174
|
-
productGroupsEnabled:
|
|
4175
|
-
rechargeCustomDomain:
|
|
4176
|
-
sellingPlansEnabled:
|
|
4177
|
-
shopId:
|
|
4178
|
-
shopifySellingPlansEnabled:
|
|
4179
|
-
shopName:
|
|
4180
|
-
storefrontAccessToken:
|
|
4181
|
-
useRebuyIcons:
|
|
4289
|
+
moneyFormat: import_zod64.z.string(),
|
|
4290
|
+
myshopifyDomain: import_zod64.z.string(),
|
|
4291
|
+
primaryLocale: import_zod64.z.string(),
|
|
4292
|
+
productGroupsEnabled: import_zod64.z.enum(["no", "yes"]).transform((value) => value === "yes"),
|
|
4293
|
+
rechargeCustomDomain: import_zod64.z.string().nullable(),
|
|
4294
|
+
sellingPlansEnabled: import_zod64.z.boolean(),
|
|
4295
|
+
shopId: import_zod64.z.number(),
|
|
4296
|
+
shopifySellingPlansEnabled: import_zod64.z.boolean(),
|
|
4297
|
+
shopName: import_zod64.z.string(),
|
|
4298
|
+
storefrontAccessToken: import_zod64.z.string().nullable(),
|
|
4299
|
+
useRebuyIcons: import_zod64.z.boolean()
|
|
4182
4300
|
});
|
|
4183
4301
|
|
|
4184
4302
|
// src/schema/userConfig.ts
|
|
4185
|
-
var
|
|
4186
|
-
var UserConfig =
|
|
4303
|
+
var import_zod65 = require("zod");
|
|
4304
|
+
var UserConfig = import_zod65.z.object({
|
|
4187
4305
|
shop: ShopConfig,
|
|
4188
4306
|
/**
|
|
4189
4307
|
* `.catch(undefined)` is the safety bar: smart-cart shape drift can NEVER fail `fetchUserConfig`,
|
|
4190
4308
|
* which resolves the apiKey for every offers/monetize/analytics/gift request.
|
|
4191
4309
|
*/
|
|
4192
4310
|
smartCart: SmartCartConfig.nullish().catch(void 0),
|
|
4193
|
-
smartFlows:
|
|
4311
|
+
smartFlows: import_zod65.z.array(import_zod65.z.unknown())
|
|
4194
4312
|
});
|
|
4195
4313
|
|
|
4196
4314
|
// src/schema/widgetData.ts
|
|
4197
|
-
var
|
|
4315
|
+
var import_zod74 = require("zod");
|
|
4198
4316
|
|
|
4199
4317
|
// src/schema/widgets/abTestingPlaceholder.ts
|
|
4200
|
-
var
|
|
4201
|
-
var ABTestingPlaceholder =
|
|
4202
|
-
type:
|
|
4318
|
+
var import_zod66 = require("zod");
|
|
4319
|
+
var ABTestingPlaceholder = import_zod66.z.looseObject({
|
|
4320
|
+
type: import_zod66.z.literal("placeholder")
|
|
4203
4321
|
});
|
|
4204
4322
|
|
|
4205
4323
|
// src/schema/widgets/checkoutExtension.ts
|
|
4206
|
-
var
|
|
4207
|
-
var CheckoutExtension =
|
|
4208
|
-
type:
|
|
4324
|
+
var import_zod67 = require("zod");
|
|
4325
|
+
var CheckoutExtension = import_zod67.z.looseObject({
|
|
4326
|
+
type: import_zod67.z.literal(WidgetType.shopify_checkout_extension).default(WidgetType.shopify_checkout_extension)
|
|
4209
4327
|
});
|
|
4210
4328
|
|
|
4211
4329
|
// src/schema/widgets/contentBlock.ts
|
|
4212
|
-
var
|
|
4213
|
-
var ContentBlockV1 =
|
|
4214
|
-
blockSpacing:
|
|
4215
|
-
imageBlocks:
|
|
4216
|
-
|
|
4217
|
-
|
|
4218
|
-
altText:
|
|
4219
|
-
description:
|
|
4220
|
-
id:
|
|
4221
|
-
imagePlacement:
|
|
4222
|
-
imageSize:
|
|
4223
|
-
imageUrl:
|
|
4224
|
-
textAlignment:
|
|
4330
|
+
var import_zod68 = require("zod");
|
|
4331
|
+
var ContentBlockV1 = import_zod68.z.object({
|
|
4332
|
+
blockSpacing: import_zod68.z.enum(spacings).optional(),
|
|
4333
|
+
imageBlocks: import_zod68.z.union([
|
|
4334
|
+
import_zod68.z.array(
|
|
4335
|
+
import_zod68.z.object({
|
|
4336
|
+
altText: import_zod68.z.string().nullable(),
|
|
4337
|
+
description: import_zod68.z.string().nullable(),
|
|
4338
|
+
id: import_zod68.z.uuid(),
|
|
4339
|
+
imagePlacement: import_zod68.z.enum(["top", "right", "bottom", "left"]),
|
|
4340
|
+
imageSize: import_zod68.z.number(),
|
|
4341
|
+
imageUrl: import_zod68.z.url(),
|
|
4342
|
+
textAlignment: import_zod68.z.enum(["left", "center", "right"]),
|
|
4225
4343
|
/** Inline scale only: an image caption can never be a block-level heading. */
|
|
4226
|
-
textSize:
|
|
4344
|
+
textSize: import_zod68.z.enum(inlineTextSizeNames)
|
|
4227
4345
|
})
|
|
4228
4346
|
),
|
|
4229
|
-
|
|
4347
|
+
import_zod68.z.strictObject({}).transform(() => [])
|
|
4230
4348
|
]).optional(),
|
|
4231
|
-
imageLayout:
|
|
4232
|
-
language:
|
|
4233
|
-
description:
|
|
4234
|
-
superTitle:
|
|
4235
|
-
title:
|
|
4349
|
+
imageLayout: import_zod68.z.enum(["row", "column"]).optional(),
|
|
4350
|
+
language: import_zod68.z.object({
|
|
4351
|
+
description: import_zod68.z.string(),
|
|
4352
|
+
superTitle: import_zod68.z.string(),
|
|
4353
|
+
title: import_zod68.z.string()
|
|
4236
4354
|
}),
|
|
4237
|
-
previewMode:
|
|
4238
|
-
type:
|
|
4239
|
-
version:
|
|
4355
|
+
previewMode: import_zod68.z.boolean(),
|
|
4356
|
+
type: import_zod68.z.literal(WidgetType.ui_extension_content_block).default(WidgetType.ui_extension_content_block),
|
|
4357
|
+
version: import_zod68.z.literal(1)
|
|
4240
4358
|
});
|
|
4241
|
-
var ContentBlock =
|
|
4359
|
+
var ContentBlock = import_zod68.z.discriminatedUnion("version", [
|
|
4242
4360
|
ContentBlockV1,
|
|
4243
4361
|
CABRootSection.extend({
|
|
4244
|
-
type:
|
|
4362
|
+
type: import_zod68.z.literal(WidgetType.ui_extension_content_block).default(WidgetType.ui_extension_content_block)
|
|
4245
4363
|
})
|
|
4246
4364
|
]);
|
|
4247
4365
|
|
|
4248
4366
|
// src/schema/widgets/giftWithPurchase.ts
|
|
4249
|
-
var
|
|
4250
|
-
var GiftWithPurchase =
|
|
4251
|
-
type:
|
|
4367
|
+
var import_zod69 = require("zod");
|
|
4368
|
+
var GiftWithPurchase = import_zod69.z.looseObject({
|
|
4369
|
+
type: import_zod69.z.literal(WidgetType.gift_with_purchase).default(WidgetType.gift_with_purchase)
|
|
4252
4370
|
});
|
|
4253
4371
|
|
|
4254
4372
|
// src/schema/widgets/lineItemEditor.ts
|
|
4255
|
-
var
|
|
4256
|
-
var LineItemEditorSwitchLanguageV1 =
|
|
4257
|
-
downgradeToOneTimeLabel:
|
|
4373
|
+
var import_zod70 = require("zod");
|
|
4374
|
+
var LineItemEditorSwitchLanguageV1 = import_zod70.z.object({
|
|
4375
|
+
downgradeToOneTimeLabel: import_zod70.z.string().optional(),
|
|
4258
4376
|
/** Frequency-option template (`{{frequency}}`/`{{interval}}`) for the plan select. */
|
|
4259
|
-
subscriptionOptionLabel:
|
|
4260
|
-
upgradeToSubscriptionLabel:
|
|
4261
|
-
upgradeToSubscriptionWithoutDiscountLabel:
|
|
4377
|
+
subscriptionOptionLabel: import_zod70.z.string().optional(),
|
|
4378
|
+
upgradeToSubscriptionLabel: import_zod70.z.string().optional(),
|
|
4379
|
+
upgradeToSubscriptionWithoutDiscountLabel: import_zod70.z.string().optional()
|
|
4262
4380
|
});
|
|
4263
|
-
var LineItemEditorV1 =
|
|
4381
|
+
var LineItemEditorV1 = import_zod70.z.object({
|
|
4264
4382
|
/** Legacy `getStyles` button style; the converter carries a valid kind, defaulting to `plain`. */
|
|
4265
|
-
button:
|
|
4266
|
-
previewMode:
|
|
4267
|
-
switchToSubscription:
|
|
4268
|
-
disableDowngrade:
|
|
4383
|
+
button: import_zod70.z.object({ kind: import_zod70.z.enum(["plain", "primary", "secondary"]).optional() }).optional(),
|
|
4384
|
+
previewMode: import_zod70.z.boolean().optional(),
|
|
4385
|
+
switchToSubscription: import_zod70.z.object({
|
|
4386
|
+
disableDowngrade: import_zod70.z.boolean().optional(),
|
|
4269
4387
|
language: LineItemEditorSwitchLanguageV1.optional()
|
|
4270
4388
|
}).optional(),
|
|
4271
|
-
switchToSubscriptionEnabled:
|
|
4272
|
-
tracking:
|
|
4273
|
-
enableAttribution:
|
|
4274
|
-
enableSource:
|
|
4275
|
-
enableWidget:
|
|
4389
|
+
switchToSubscriptionEnabled: import_zod70.z.boolean().optional(),
|
|
4390
|
+
tracking: import_zod70.z.object({
|
|
4391
|
+
enableAttribution: import_zod70.z.boolean().optional(),
|
|
4392
|
+
enableSource: import_zod70.z.boolean().optional(),
|
|
4393
|
+
enableWidget: import_zod70.z.boolean().optional()
|
|
4276
4394
|
}).optional(),
|
|
4277
|
-
type:
|
|
4278
|
-
version:
|
|
4395
|
+
type: import_zod70.z.literal(WidgetType.ui_extension_line_item_editor).default(WidgetType.ui_extension_line_item_editor),
|
|
4396
|
+
version: import_zod70.z.literal(1)
|
|
4279
4397
|
});
|
|
4280
|
-
var LineItemEditor =
|
|
4398
|
+
var LineItemEditor = import_zod70.z.discriminatedUnion("version", [
|
|
4281
4399
|
LineItemEditorV1,
|
|
4282
4400
|
CABRootSection.extend({
|
|
4283
|
-
type:
|
|
4401
|
+
type: import_zod70.z.literal(WidgetType.ui_extension_line_item_editor).default(WidgetType.ui_extension_line_item_editor)
|
|
4284
4402
|
})
|
|
4285
4403
|
]);
|
|
4286
4404
|
|
|
4287
4405
|
// src/schema/widgets/progressBar.ts
|
|
4288
|
-
var
|
|
4289
|
-
var ProgressBar =
|
|
4290
|
-
type:
|
|
4406
|
+
var import_zod71 = require("zod");
|
|
4407
|
+
var ProgressBar = import_zod71.z.looseObject({
|
|
4408
|
+
type: import_zod71.z.literal(WidgetType.ui_extension_progress_bar).default(WidgetType.ui_extension_progress_bar)
|
|
4291
4409
|
});
|
|
4292
4410
|
|
|
4293
4411
|
// src/schema/widgets/rebuyButton.ts
|
|
4294
|
-
var
|
|
4295
|
-
var RebuyButtonV1 =
|
|
4296
|
-
type:
|
|
4297
|
-
version:
|
|
4412
|
+
var import_zod72 = require("zod");
|
|
4413
|
+
var RebuyButtonV1 = import_zod72.z.looseObject({
|
|
4414
|
+
type: import_zod72.z.literal(WidgetType.ui_extension_button).default(WidgetType.ui_extension_button),
|
|
4415
|
+
version: import_zod72.z.literal(1)
|
|
4298
4416
|
});
|
|
4299
|
-
var RebuyButton =
|
|
4417
|
+
var RebuyButton = import_zod72.z.discriminatedUnion("version", [
|
|
4300
4418
|
RebuyButtonV1,
|
|
4301
4419
|
CABRootSection.extend({
|
|
4302
|
-
type:
|
|
4420
|
+
type: import_zod72.z.literal(WidgetType.ui_extension_button).default(WidgetType.ui_extension_button)
|
|
4303
4421
|
})
|
|
4304
4422
|
]);
|
|
4305
4423
|
|
|
4306
4424
|
// src/schema/widgets/rebuyMonetize.ts
|
|
4307
|
-
var
|
|
4308
|
-
var RebuyMonetize =
|
|
4309
|
-
type:
|
|
4425
|
+
var import_zod73 = require("zod");
|
|
4426
|
+
var RebuyMonetize = import_zod73.z.looseObject({
|
|
4427
|
+
type: import_zod73.z.literal(WidgetType.ui_extension_ad).default(WidgetType.ui_extension_ad)
|
|
4310
4428
|
});
|
|
4311
|
-
var RebuyMonetizeV1 =
|
|
4312
|
-
name:
|
|
4313
|
-
previewMode:
|
|
4429
|
+
var RebuyMonetizeV1 = import_zod73.z.object({
|
|
4430
|
+
name: import_zod73.z.string().nullable().optional(),
|
|
4431
|
+
previewMode: import_zod73.z.boolean().optional(),
|
|
4314
4432
|
/** Privacy Policy footer href → the marker section's `privacyPolicyUrl`. */
|
|
4315
|
-
privacyPolicyUrl:
|
|
4433
|
+
privacyPolicyUrl: import_zod73.z.string().nullable().optional(),
|
|
4316
4434
|
/** Ads-taxonomy sub-vertical id — one of the admin Monetize editor's two configurables. */
|
|
4317
|
-
subVertical:
|
|
4318
|
-
tracking:
|
|
4319
|
-
enableAttribution:
|
|
4320
|
-
enableSource:
|
|
4321
|
-
enableWidget:
|
|
4435
|
+
subVertical: import_zod73.z.string().nullable().optional(),
|
|
4436
|
+
tracking: import_zod73.z.object({
|
|
4437
|
+
enableAttribution: import_zod73.z.boolean().optional(),
|
|
4438
|
+
enableSource: import_zod73.z.boolean().optional(),
|
|
4439
|
+
enableWidget: import_zod73.z.boolean().optional()
|
|
4322
4440
|
}).optional(),
|
|
4323
|
-
type:
|
|
4324
|
-
version:
|
|
4441
|
+
type: import_zod73.z.literal(WidgetType.ui_extension_ad).default(WidgetType.ui_extension_ad),
|
|
4442
|
+
version: import_zod73.z.literal(1),
|
|
4325
4443
|
/** Ads-taxonomy vertical id — one of the admin Monetize editor's two configurables. */
|
|
4326
|
-
vertical:
|
|
4444
|
+
vertical: import_zod73.z.string().nullable().optional()
|
|
4327
4445
|
});
|
|
4328
4446
|
|
|
4329
4447
|
// src/schema/widgetData.ts
|
|
@@ -4337,7 +4455,7 @@ var extensionWidgetTypes = [
|
|
|
4337
4455
|
WidgetType.ui_extension_line_item_editor,
|
|
4338
4456
|
WidgetType.ui_extension_progress_bar
|
|
4339
4457
|
];
|
|
4340
|
-
var WidgetData =
|
|
4458
|
+
var WidgetData = import_zod74.z.discriminatedUnion("type", [
|
|
4341
4459
|
ABTestingPlaceholder,
|
|
4342
4460
|
CheckoutExtension,
|
|
4343
4461
|
ContentBlock,
|
|
@@ -4697,36 +4815,36 @@ var SWITCH_LABELS = {
|
|
|
4697
4815
|
};
|
|
4698
4816
|
|
|
4699
4817
|
// src/schema/widgets/post-purchase-offer/postPurchaseOffer.ts
|
|
4700
|
-
var
|
|
4818
|
+
var import_zod76 = require("zod");
|
|
4701
4819
|
|
|
4702
4820
|
// src/schema/widgets/post-purchase-offer/postPurchaseWidget.ts
|
|
4703
|
-
var
|
|
4704
|
-
var PostPurchaseWidgetLinkedFlow =
|
|
4705
|
-
id:
|
|
4706
|
-
name:
|
|
4707
|
-
});
|
|
4708
|
-
var PostPurchaseWidget =
|
|
4709
|
-
classification:
|
|
4710
|
-
createdAtTime:
|
|
4711
|
-
customEndpointName:
|
|
4712
|
-
id:
|
|
4713
|
-
lastViewed:
|
|
4714
|
-
linkedCustomEndpointId:
|
|
4715
|
-
linkedFlows:
|
|
4716
|
-
name:
|
|
4717
|
-
owner:
|
|
4821
|
+
var import_zod75 = require("zod");
|
|
4822
|
+
var PostPurchaseWidgetLinkedFlow = import_zod75.z.object({
|
|
4823
|
+
id: import_zod75.z.number(),
|
|
4824
|
+
name: import_zod75.z.string()
|
|
4825
|
+
});
|
|
4826
|
+
var PostPurchaseWidget = import_zod75.z.object({
|
|
4827
|
+
classification: import_zod75.z.literal("post_purchase_offer_page").default("post_purchase_offer_page"),
|
|
4828
|
+
createdAtTime: import_zod75.z.iso.datetime({ offset: true }).optional(),
|
|
4829
|
+
customEndpointName: import_zod75.z.string().nullish(),
|
|
4830
|
+
id: import_zod75.z.number().default(0),
|
|
4831
|
+
lastViewed: import_zod75.z.iso.datetime({ offset: true }).nullish(),
|
|
4832
|
+
linkedCustomEndpointId: import_zod75.z.number().nullish(),
|
|
4833
|
+
linkedFlows: import_zod75.z.array(PostPurchaseWidgetLinkedFlow).optional(),
|
|
4834
|
+
name: import_zod75.z.string().default(""),
|
|
4835
|
+
owner: import_zod75.z.number().nullish(),
|
|
4718
4836
|
settings: PostPurchaseSettings
|
|
4719
4837
|
});
|
|
4720
4838
|
|
|
4721
4839
|
// src/schema/widgets/post-purchase-offer/postPurchaseOffer.ts
|
|
4722
|
-
var PostPurchaseOffer =
|
|
4723
|
-
|
|
4724
|
-
errors:
|
|
4725
|
-
message:
|
|
4726
|
-
successful:
|
|
4840
|
+
var PostPurchaseOffer = import_zod76.z.discriminatedUnion("successful", [
|
|
4841
|
+
import_zod76.z.strictObject({
|
|
4842
|
+
errors: import_zod76.z.array(import_zod76.z.object({ message: import_zod76.z.string() })),
|
|
4843
|
+
message: import_zod76.z.string(),
|
|
4844
|
+
successful: import_zod76.z.literal(false)
|
|
4727
4845
|
}),
|
|
4728
|
-
|
|
4729
|
-
successful:
|
|
4846
|
+
import_zod76.z.strictObject({
|
|
4847
|
+
successful: import_zod76.z.literal(true),
|
|
4730
4848
|
widget: PostPurchaseWidget
|
|
4731
4849
|
})
|
|
4732
4850
|
]);
|