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