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