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