@rebuy/rebuy 3.35.0 → 3.36.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +689 -571
- package/dist/index.mjs +689 -571
- package/dist/schema/index.d.ts +3 -0
- package/dist/schema/postPurchaseGroup.d.ts +15 -0
- package/dist/schema/postPurchaseProduct.d.ts +74 -24
- package/dist/schema/postPurchaseProductCalculation.d.ts +87 -0
- package/dist/schema/postPurchaseProductCollectionView.d.ts +724 -3
- package/dist/schema/postPurchaseProductDisplay.d.ts +41 -12
- package/dist/schema/postPurchaseProductView.d.ts +708 -0
- package/dist/schema/postPurchaseQuantity.d.ts +16 -3
- package/dist/schema/postPurchaseSubscriptionProduct.d.ts +74 -17
- package/dist/server/__fixtures__/postPurchaseGroup.d.ts +3 -0
- package/dist/server/index.cjs +818 -310
- package/dist/server/index.d.ts +13 -2
- package/dist/server/index.mjs +818 -310
- package/dist/server/postPurchaseProductDisplay.d.ts +38 -6
- package/dist/server/preparePostPurchaseAdmissionView.d.ts +418 -0
- package/dist/server/preparePostPurchaseCollectionGroup.d.ts +458 -0
- package/dist/server/preparePostPurchaseCollectionView.d.ts +442 -0
- package/dist/server/preparePostPurchaseGroupAdmissionView.d.ts +459 -0
- package/dist/server/preparePostPurchaseGroupDefault.d.ts +459 -0
- package/dist/server/preparePostPurchaseGroupView.d.ts +458 -0
- package/dist/server/preparePostPurchaseMemberView.d.ts +1466 -0
- package/dist/server/preparePostPurchaseProduct.d.ts +11 -0
- package/dist/server/preparePostPurchaseQuantityAdmissionView.d.ts +440 -0
- package/dist/server/preparePostPurchaseQuantityView.d.ts +427 -0
- package/dist/server/preparePostPurchaseSubscription.d.ts +37 -5
- package/dist/server/preparePostPurchaseView.d.ts +8 -0
- package/dist/server/projectPostPurchaseProduct.d.ts +37 -5
- package/dist/transforms/postPurchase/convertDescriptionRte.d.ts +11 -0
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -2190,9 +2190,6 @@ var ExitPolicySchema = z18.discriminatedUnion("status", [
|
|
|
2190
2190
|
})
|
|
2191
2191
|
]);
|
|
2192
2192
|
|
|
2193
|
-
// src/schema/postPurchaseGroupCatalog.ts
|
|
2194
|
-
import { z as z25 } from "zod";
|
|
2195
|
-
|
|
2196
2193
|
// src/schema/postPurchaseProduct.ts
|
|
2197
2194
|
import { z as z23 } from "zod";
|
|
2198
2195
|
|
|
@@ -2219,14 +2216,10 @@ var PostPurchasePrimaryImageSource = z20.string().default(
|
|
|
2219
2216
|
"https://cdn.shopify.com/shopifycloud/shopify/assets/no-image-2048-5e88c1b20e087fb7bbe9a3771824e743c244f437e4f8ba93bbf7b11b53f7824c.gif"
|
|
2220
2217
|
);
|
|
2221
2218
|
var PostPurchaseProductDisplay = z20.object({
|
|
2219
|
+
descriptionDocument: TiptapDocument.optional(),
|
|
2222
2220
|
discountedFrom: PostPurchaseSettings.shape.discountedFrom,
|
|
2223
2221
|
gallery: PostPurchaseProductGallery.optional(),
|
|
2224
|
-
language: language.pick({
|
|
2225
|
-
description: true,
|
|
2226
|
-
descriptionEnabled: true,
|
|
2227
|
-
descriptionRte: true,
|
|
2228
|
-
descriptionSpacing: true
|
|
2229
|
-
}),
|
|
2222
|
+
language: language.pick({ description: true, descriptionEnabled: true }),
|
|
2230
2223
|
primaryImage: z20.object({ description: z20.string(), source: z20.string() }),
|
|
2231
2224
|
productOptions: PostPurchaseSettings.shape.productOptions.pick({
|
|
2232
2225
|
showDeclineAll: true,
|
|
@@ -2353,6 +2346,18 @@ var PostPurchasePreparation = z23.discriminatedUnion("status", [
|
|
|
2353
2346
|
z23.object({ reason: z23.string(), status: z23.literal("unsupported") })
|
|
2354
2347
|
]);
|
|
2355
2348
|
|
|
2349
|
+
// src/schema/postPurchaseQuantity.ts
|
|
2350
|
+
import { z as z47 } from "zod";
|
|
2351
|
+
|
|
2352
|
+
// src/schema/postPurchaseProductCollectionView.ts
|
|
2353
|
+
import { z as z46 } from "zod";
|
|
2354
|
+
|
|
2355
|
+
// src/schema/postPurchaseProductView.ts
|
|
2356
|
+
import { z as z45 } from "zod";
|
|
2357
|
+
|
|
2358
|
+
// src/schema/postPurchaseGroupCatalog.ts
|
|
2359
|
+
import { z as z25 } from "zod";
|
|
2360
|
+
|
|
2356
2361
|
// src/schema/postPurchaseVariantCatalog.ts
|
|
2357
2362
|
import { z as z24 } from "zod";
|
|
2358
2363
|
var PostPurchaseVariantSelector = z24.object({ variantId: PostPurchaseVariantId }).strict();
|
|
@@ -2397,57 +2402,8 @@ var PostPurchaseGroupSelection = z25.object({
|
|
|
2397
2402
|
productId
|
|
2398
2403
|
});
|
|
2399
2404
|
|
|
2400
|
-
// src/schema/postPurchaseIdentity.ts
|
|
2401
|
-
import { z as z26 } from "zod";
|
|
2402
|
-
var POST_PURCHASE_ID_MAX = 128;
|
|
2403
|
-
var PostPurchaseTimestampSchema = z26.number().int().nonnegative();
|
|
2404
|
-
var PostPurchaseOrderIdSchema = z26.string().regex(/^gid:\/\/shopify\/Order\/[1-9]\d*$/);
|
|
2405
|
-
var ShopifyDomainSchema = z26.string().max(POST_PURCHASE_ID_MAX).regex(/^[a-z0-9]([a-z0-9-]*[a-z0-9])?\.myshopify\.com$/);
|
|
2406
|
-
var DecideRequestSchema = z26.object({
|
|
2407
|
-
checkoutToken: z26.string().min(1).max(POST_PURCHASE_ID_MAX),
|
|
2408
|
-
shop: ShopifyDomainSchema
|
|
2409
|
-
});
|
|
2410
|
-
var PostPurchaseAppIdSchema = z26.string().min(1).max(POST_PURCHASE_ID_MAX);
|
|
2411
|
-
var DecisionEntrySchema = z26.object({
|
|
2412
|
-
blockId: z26.number().int().positive(),
|
|
2413
|
-
blockIndex: z26.string(),
|
|
2414
|
-
blockParentIndex: z26.string(),
|
|
2415
|
-
flowId: z26.number().int().positive(),
|
|
2416
|
-
sectionId: z26.number().int().positive(),
|
|
2417
|
-
widgetId: z26.number().int().positive(),
|
|
2418
|
-
widgetTraffic: z26.number().min(0).max(100)
|
|
2419
|
-
});
|
|
2420
|
-
|
|
2421
|
-
// src/schema/postPurchaseOfferEligibility.ts
|
|
2422
|
-
import { z as z28 } from "zod";
|
|
2423
|
-
|
|
2424
|
-
// src/schema/postPurchaseProductCollectionView.ts
|
|
2425
|
-
import { z as z27 } from "zod";
|
|
2426
|
-
var PostPurchaseExcludedProductIds = z27.array(PostPurchaseProductId).default([]);
|
|
2427
|
-
|
|
2428
|
-
// src/schema/postPurchaseOfferEligibility.ts
|
|
2429
|
-
var selection = PreparedPostPurchaseProduct.shape.selection;
|
|
2430
|
-
var PostPurchaseOfferSkipReason = z28.enum(["empty", "no-eligible-subscription"]);
|
|
2431
|
-
var PostPurchaseOfferEligibilityContext = z28.object({
|
|
2432
|
-
excludedProductIds: PostPurchaseExcludedProductIds,
|
|
2433
|
-
originalLineItems: z28.array(selection.pick({ productId: true, sellingPlanId: true, variantId: true }))
|
|
2434
|
-
});
|
|
2435
|
-
var PostPurchaseOfferEligibility = z28.discriminatedUnion("status", [
|
|
2436
|
-
z28.object({
|
|
2437
|
-
members: z28.array(
|
|
2438
|
-
z28.object({ productId: selection.shape.productId, productIndex: z28.number().int().nonnegative() })
|
|
2439
|
-
),
|
|
2440
|
-
status: z28.literal("retain")
|
|
2441
|
-
}),
|
|
2442
|
-
z28.object({ reason: PostPurchaseOfferSkipReason, status: z28.literal("skip") }),
|
|
2443
|
-
z28.object({ reason: z28.literal("eligible-upgrade").optional(), status: z28.literal("unavailable") })
|
|
2444
|
-
]);
|
|
2445
|
-
|
|
2446
|
-
// src/schema/postPurchaseOfferPresentation.ts
|
|
2447
|
-
import { z as z48 } from "zod";
|
|
2448
|
-
|
|
2449
2405
|
// src/schema/widgets/checkout-and-beyond/root.ts
|
|
2450
|
-
import { z as
|
|
2406
|
+
import { z as z44 } from "zod";
|
|
2451
2407
|
|
|
2452
2408
|
// src/schema/widgets/checkout-and-beyond/constants.ts
|
|
2453
2409
|
import { uniqBy } from "es-toolkit";
|
|
@@ -2502,18 +2458,18 @@ var targetAreas = {
|
|
|
2502
2458
|
|
|
2503
2459
|
// src/schema/widgets/checkout-and-beyond/layout.ts
|
|
2504
2460
|
import { v7 as uuidv713 } from "uuid";
|
|
2505
|
-
import { z as
|
|
2461
|
+
import { z as z43 } from "zod";
|
|
2506
2462
|
|
|
2507
2463
|
// src/schema/widgets/checkout-and-beyond/shared.ts
|
|
2508
|
-
import { z as
|
|
2464
|
+
import { z as z42 } from "zod";
|
|
2509
2465
|
|
|
2510
2466
|
// src/schema/widgets/checkout-and-beyond/banner.ts
|
|
2511
|
-
import { z as
|
|
2512
|
-
var CABBannerSection =
|
|
2467
|
+
import { z as z26 } from "zod";
|
|
2468
|
+
var CABBannerSection = z26.lazy(
|
|
2513
2469
|
() => CABLayoutSection.omit({ sectionType: true }).extend({
|
|
2514
|
-
buttonField:
|
|
2515
|
-
color:
|
|
2516
|
-
dismissible:
|
|
2470
|
+
buttonField: z26.enum(buttonFields).optional(),
|
|
2471
|
+
color: z26.enum(bannerColors).default("info"),
|
|
2472
|
+
dismissible: z26.boolean().default(true),
|
|
2517
2473
|
/**
|
|
2518
2474
|
* The `s-banner` heading — localized content (a buyer can see a merchant-composed banner). Absent OR
|
|
2519
2475
|
* blank ⇒ no heading; the renderer emits no heading slot for `''` rather than an empty one.
|
|
@@ -2529,18 +2485,18 @@ var CABBannerSection = z29.lazy(
|
|
|
2529
2485
|
* not a 500. Nothing emits `heading` yet; the first converter that maps merchant banner copy into it
|
|
2530
2486
|
* either strips first or teaches `normalizeTextContent` to strip this field.
|
|
2531
2487
|
*/
|
|
2532
|
-
heading:
|
|
2533
|
-
sectionType:
|
|
2488
|
+
heading: z26.record(z26.string(), z26.string().refine(checkForHTML, NO_HTML)).optional(),
|
|
2489
|
+
sectionType: z26.literal(SectionType.banner).default(SectionType.banner)
|
|
2534
2490
|
})
|
|
2535
2491
|
);
|
|
2536
2492
|
|
|
2537
2493
|
// src/schema/widgets/checkout-and-beyond/button.ts
|
|
2538
2494
|
import { v7 as uuidv73 } from "uuid";
|
|
2539
|
-
import { z as
|
|
2495
|
+
import { z as z28 } from "zod";
|
|
2540
2496
|
|
|
2541
2497
|
// src/schema/widgets/checkout-and-beyond/image.ts
|
|
2542
2498
|
import { v7 as uuidv72 } from "uuid";
|
|
2543
|
-
import { z as
|
|
2499
|
+
import { z as z27 } from "zod";
|
|
2544
2500
|
|
|
2545
2501
|
// src/schema/widgets/checkout-and-beyond/icons.ts
|
|
2546
2502
|
var iconNames = [
|
|
@@ -2627,17 +2583,17 @@ var iconTones = ["auto", "critical", "custom", "info", "neutral", "success", "wa
|
|
|
2627
2583
|
var IconTone = freezeEnum(iconTones);
|
|
2628
2584
|
|
|
2629
2585
|
// src/schema/widgets/checkout-and-beyond/image.ts
|
|
2630
|
-
var CABImageSectionFields =
|
|
2586
|
+
var CABImageSectionFields = z27.object({
|
|
2631
2587
|
...CABVariableFields,
|
|
2632
|
-
altText:
|
|
2588
|
+
altText: z27.string().refine(checkForHTML, NO_HTML).default(""),
|
|
2633
2589
|
/**
|
|
2634
2590
|
* Image width÷height (e.g. `46` for the progress-bar fill); `null` renders at natural size. Any POSITIVE
|
|
2635
2591
|
* ratio — never limited to 1, but never `0`/negative either: a renderer dividing by it would get `Infinity`,
|
|
2636
2592
|
* and CSS `aspect-ratio` drops a negative value and silently reverts to natural size.
|
|
2637
2593
|
*/
|
|
2638
|
-
aspectRatio:
|
|
2639
|
-
border:
|
|
2640
|
-
buttonField:
|
|
2594
|
+
aspectRatio: z27.number().positive().nullable().default(null),
|
|
2595
|
+
border: z27.lazy(() => CABBorder),
|
|
2596
|
+
buttonField: z27.enum(buttonFields).optional(),
|
|
2641
2597
|
/**
|
|
2642
2598
|
* `icon` renders `source` as a single `s-icon` by name (the uber-image path covers icons too), reading
|
|
2643
2599
|
* `iconSize`/`iconTone`. The other values are a harmless informational holdover from the previous
|
|
@@ -2656,29 +2612,29 @@ var CABImageSectionFields = z30.object({
|
|
|
2656
2612
|
* behavior degraded gracefully and told us about it. The client-assembled half of the invariant was never
|
|
2657
2613
|
* the risky half.
|
|
2658
2614
|
*/
|
|
2659
|
-
category:
|
|
2615
|
+
category: z27.enum(["gallery", "icon", "icons", "payment-methods", "secure-checkout"]).nullable().default(null),
|
|
2660
2616
|
/** `icon`-mode only: the `s-icon` `size`; `null` ⇒ the component default (`base`). Ignored by image treatments. */
|
|
2661
|
-
iconSize:
|
|
2617
|
+
iconSize: z27.enum(iconSizes).nullable().default(null),
|
|
2662
2618
|
/** `icon`-mode only: the `s-icon` `tone`; `null` ⇒ the component default (`auto`). Ignored by image treatments. */
|
|
2663
|
-
iconTone:
|
|
2664
|
-
name:
|
|
2665
|
-
naturalHeight:
|
|
2666
|
-
naturalWidth:
|
|
2619
|
+
iconTone: z27.enum(iconTones).nullable().default(null),
|
|
2620
|
+
name: z27.string().optional(),
|
|
2621
|
+
naturalHeight: z27.number().default(0),
|
|
2622
|
+
naturalWidth: z27.number().default(0),
|
|
2667
2623
|
/**
|
|
2668
2624
|
* `contain` (the component default): dimensionless images render in s-image's 1/1 default frame, and
|
|
2669
2625
|
* `cover` would crop non-square art (payment badges lost their edges — 15993); `contain` letterboxes.
|
|
2670
2626
|
*/
|
|
2671
|
-
objectFit:
|
|
2672
|
-
sectionId:
|
|
2673
|
-
sectionType:
|
|
2627
|
+
objectFit: z27.enum(objectFits).default(ObjectFit.contain),
|
|
2628
|
+
sectionId: z27.uuid().default(() => uuidv72()),
|
|
2629
|
+
sectionType: z27.literal(SectionType.image).default(SectionType.image),
|
|
2674
2630
|
/**
|
|
2675
2631
|
* An image URL or dynamic token, an empty default, or — when `category: 'icon'` — an icon NAME. Icon mode
|
|
2676
2632
|
* takes a name or `''` only, NOT a token: no renderer resolves a token to an icon today, so accepting one
|
|
2677
2633
|
* would promise a capability that doesn't exist. Widen the refine's carve-out to `DYNAMIC_TOKEN_REGEX` when a
|
|
2678
2634
|
* server-chosen tier icon actually needs it.
|
|
2679
2635
|
*/
|
|
2680
|
-
source:
|
|
2681
|
-
width:
|
|
2636
|
+
source: z27.union([z27.url(), z27.literal(""), z27.string().regex(DYNAMIC_TOKEN_REGEX), z27.enum(iconNames)]).default(""),
|
|
2637
|
+
width: z27.number().default(100)
|
|
2682
2638
|
});
|
|
2683
2639
|
var iconNameSet = new Set(iconNames);
|
|
2684
2640
|
var isIconName = (source2) => iconNameSet.has(source2);
|
|
@@ -2698,35 +2654,35 @@ var CABImageSection = CABImageSectionFields.superRefine(({ category, source: sou
|
|
|
2698
2654
|
});
|
|
2699
2655
|
|
|
2700
2656
|
// src/schema/widgets/checkout-and-beyond/button.ts
|
|
2701
|
-
var CABButtonContent =
|
|
2702
|
-
() =>
|
|
2657
|
+
var CABButtonContent = z28.lazy(
|
|
2658
|
+
() => z28.discriminatedUnion("sectionType", [CABImageSection, CABLayoutSection, CABTextSection])
|
|
2703
2659
|
);
|
|
2704
|
-
var CABButtonSection =
|
|
2660
|
+
var CABButtonSection = z28.object({
|
|
2705
2661
|
...CABVariableFields,
|
|
2706
|
-
action:
|
|
2707
|
-
buttonStyle:
|
|
2708
|
-
custom:
|
|
2709
|
-
color:
|
|
2710
|
-
height:
|
|
2711
|
-
width:
|
|
2662
|
+
action: z28.union([z28.literal(""), z28.enum(buttonActions)]).default(""),
|
|
2663
|
+
buttonStyle: z28.enum(buttonStyles).default(ButtonStyle.primary),
|
|
2664
|
+
custom: z28.object({
|
|
2665
|
+
color: z28.string().regex(HEX_COLOR_REGEX).default("#005bd3"),
|
|
2666
|
+
height: z28.number().default(52),
|
|
2667
|
+
width: z28.number().default(300)
|
|
2712
2668
|
}).default({
|
|
2713
2669
|
color: "#005bd3",
|
|
2714
2670
|
height: 52,
|
|
2715
2671
|
width: 300
|
|
2716
2672
|
}),
|
|
2717
|
-
disableDowngrade:
|
|
2718
|
-
name:
|
|
2719
|
-
optionId:
|
|
2720
|
-
popover:
|
|
2721
|
-
alignment:
|
|
2722
|
-
position:
|
|
2673
|
+
disableDowngrade: z28.boolean().default(false),
|
|
2674
|
+
name: z28.string().optional(),
|
|
2675
|
+
optionId: z28.number().optional(),
|
|
2676
|
+
popover: z28.object({
|
|
2677
|
+
alignment: z28.enum(textAlignments).default(TextAlignment.center),
|
|
2678
|
+
position: z28.enum(popoverPositions).default(PopoverPosition.blockStart)
|
|
2723
2679
|
}).optional().default(() => ({
|
|
2724
2680
|
alignment: TextAlignment.center,
|
|
2725
2681
|
position: PopoverPosition.blockStart
|
|
2726
2682
|
})),
|
|
2727
|
-
sectionId:
|
|
2728
|
-
sections:
|
|
2729
|
-
sectionType:
|
|
2683
|
+
sectionId: z28.uuid().default(() => uuidv73()),
|
|
2684
|
+
sections: z28.union([z28.array(CABButtonContent), z28.strictObject({}).transform(() => [])]).default(() => []),
|
|
2685
|
+
sectionType: z28.literal(SectionType.button).default(SectionType.button),
|
|
2730
2686
|
/**
|
|
2731
2687
|
* The smart-cart tier this button acts on (`addGift`/`removeGift`): scopes the click to one tier's gift. The
|
|
2732
2688
|
* client resolves the tier's gift (productId) from the progress-bar context by this `tierId` — the button node
|
|
@@ -2741,91 +2697,91 @@ var CABButtonSection = z31.object({
|
|
|
2741
2697
|
* lookup finds no tier and the click resolves to nothing. Safe to bound — the field is new, so there are no
|
|
2742
2698
|
* stored payloads to grandfather, and the producer is client code, not a merchant form.
|
|
2743
2699
|
*/
|
|
2744
|
-
tier:
|
|
2700
|
+
tier: z28.object({ tierId: z28.string().min(1) }).optional(),
|
|
2745
2701
|
/** Fire-and-forget pixel POSTed when the button is clicked (e.g. a Monetize decline). */
|
|
2746
|
-
trackingUrl:
|
|
2702
|
+
trackingUrl: z28.string().optional(),
|
|
2747
2703
|
/**
|
|
2748
2704
|
* Secondary effects applied to in-scope variables on click, alongside (never instead of) the primary
|
|
2749
2705
|
* `action` — an `addToOrder` button can also flip a variable. Applied in array order.
|
|
2750
2706
|
*/
|
|
2751
|
-
variableEffects:
|
|
2707
|
+
variableEffects: z28.array(CABVariableEffect).optional()
|
|
2752
2708
|
});
|
|
2753
2709
|
|
|
2754
2710
|
// src/schema/widgets/checkout-and-beyond/carousel.ts
|
|
2755
|
-
import { z as
|
|
2711
|
+
import { z as z33 } from "zod";
|
|
2756
2712
|
|
|
2757
2713
|
// src/schema/widgets/checkout-and-beyond/offers.ts
|
|
2758
|
-
import { z as
|
|
2714
|
+
import { z as z32 } from "zod";
|
|
2759
2715
|
|
|
2760
2716
|
// src/schema/widgets/checkout-and-beyond/dataSource.ts
|
|
2761
2717
|
import { v7 as uuidv74 } from "uuid";
|
|
2762
|
-
import { z as
|
|
2763
|
-
var CABDiscount =
|
|
2764
|
-
amount:
|
|
2765
|
-
discountedBy:
|
|
2766
|
-
discountedFrom:
|
|
2767
|
-
type:
|
|
2768
|
-
});
|
|
2769
|
-
var CABIntegrations =
|
|
2770
|
-
judgeme:
|
|
2771
|
-
junip:
|
|
2772
|
-
klaviyo:
|
|
2773
|
-
loox:
|
|
2774
|
-
okendo:
|
|
2775
|
-
opinew:
|
|
2776
|
-
reviewsio:
|
|
2777
|
-
stamped:
|
|
2778
|
-
yotpo:
|
|
2779
|
-
});
|
|
2780
|
-
var CABDataSourceSection =
|
|
2781
|
-
dataSourceId:
|
|
2782
|
-
dataSourcePath:
|
|
2718
|
+
import { z as z29 } from "zod";
|
|
2719
|
+
var CABDiscount = z29.object({
|
|
2720
|
+
amount: z29.union([z29.number(), z29.string()]).catch(0),
|
|
2721
|
+
discountedBy: z29.string().optional(),
|
|
2722
|
+
discountedFrom: z29.enum(discountSources).optional().catch(void 0),
|
|
2723
|
+
type: z29.enum(discountTypes).catch("none")
|
|
2724
|
+
});
|
|
2725
|
+
var CABIntegrations = z29.object({
|
|
2726
|
+
judgeme: z29.boolean().default(false),
|
|
2727
|
+
junip: z29.boolean().default(false),
|
|
2728
|
+
klaviyo: z29.boolean().default(false),
|
|
2729
|
+
loox: z29.boolean().default(false),
|
|
2730
|
+
okendo: z29.boolean().default(false),
|
|
2731
|
+
opinew: z29.boolean().default(false),
|
|
2732
|
+
reviewsio: z29.boolean().default(false),
|
|
2733
|
+
stamped: z29.boolean().default(false),
|
|
2734
|
+
yotpo: z29.boolean().default(false)
|
|
2735
|
+
});
|
|
2736
|
+
var CABDataSourceSection = z29.object({
|
|
2737
|
+
dataSourceId: z29.number().nullable().default(null),
|
|
2738
|
+
dataSourcePath: z29.string().default(DEFAULT_ENDPOINTS[0].value),
|
|
2783
2739
|
discount: CABDiscount.optional(),
|
|
2784
2740
|
integrations: CABIntegrations.optional(),
|
|
2785
|
-
limit:
|
|
2786
|
-
matchVariant:
|
|
2787
|
-
matchVariantOutOfStock:
|
|
2788
|
-
name:
|
|
2789
|
-
productType:
|
|
2790
|
-
sectionId:
|
|
2791
|
-
sectionType:
|
|
2741
|
+
limit: z29.number().default(1),
|
|
2742
|
+
matchVariant: z29.boolean().default(false),
|
|
2743
|
+
matchVariantOutOfStock: z29.boolean().default(false),
|
|
2744
|
+
name: z29.string().default(DEFAULT_ENDPOINTS[0].label),
|
|
2745
|
+
productType: z29.enum(productTypes).optional(),
|
|
2746
|
+
sectionId: z29.uuid().default(() => uuidv74()),
|
|
2747
|
+
sectionType: z29.literal(SectionType.dataSource).default(SectionType.dataSource),
|
|
2792
2748
|
/** Default subscribe-vs-one-time for `productType: both` (legacy `subscription_is_default`). */
|
|
2793
|
-
subscriptionIsDefault:
|
|
2794
|
-
treatAsGwp:
|
|
2749
|
+
subscriptionIsDefault: z29.boolean().default(false),
|
|
2750
|
+
treatAsGwp: z29.boolean().default(false)
|
|
2795
2751
|
});
|
|
2796
2752
|
|
|
2797
2753
|
// src/schema/widgets/checkout-and-beyond/products.ts
|
|
2798
2754
|
import { v7 as uuidv76 } from "uuid";
|
|
2799
|
-
import { z as
|
|
2755
|
+
import { z as z31 } from "zod";
|
|
2800
2756
|
|
|
2801
2757
|
// src/schema/widgets/checkout-and-beyond/product.ts
|
|
2802
2758
|
import { v7 as uuidv75 } from "uuid";
|
|
2803
|
-
import { z as
|
|
2804
|
-
var CABVariantContent =
|
|
2805
|
-
() =>
|
|
2759
|
+
import { z as z30 } from "zod";
|
|
2760
|
+
var CABVariantContent = z30.lazy(
|
|
2761
|
+
() => z30.discriminatedUnion("sectionType", [CABButtonSection, CABTextSection])
|
|
2806
2762
|
);
|
|
2807
|
-
var CABProductSection =
|
|
2763
|
+
var CABProductSection = z30.object({
|
|
2808
2764
|
...CABVariableFields,
|
|
2809
|
-
name:
|
|
2810
|
-
productId:
|
|
2811
|
-
sectionId:
|
|
2812
|
-
sections:
|
|
2813
|
-
sectionType:
|
|
2814
|
-
selectors:
|
|
2815
|
-
variantMode:
|
|
2765
|
+
name: z30.string().optional(),
|
|
2766
|
+
productId: z30.number().nullable().default(null),
|
|
2767
|
+
sectionId: z30.uuid().default(() => uuidv75()),
|
|
2768
|
+
sections: z30.union([z30.array(CABVariantContent), z30.strictObject({}).transform(() => [])]).default(() => []),
|
|
2769
|
+
sectionType: z30.literal(SectionType.product).default(SectionType.product),
|
|
2770
|
+
selectors: z30.record(z30.string(), z30.enum(variantSelectors).default(VariantSelector.menu)).default(() => ({})),
|
|
2771
|
+
variantMode: z30.enum(variantModes).default(VariantMode.multiple)
|
|
2816
2772
|
});
|
|
2817
2773
|
|
|
2818
2774
|
// src/schema/widgets/checkout-and-beyond/products.ts
|
|
2819
|
-
var CABProductsSection =
|
|
2775
|
+
var CABProductsSection = z31.object({
|
|
2820
2776
|
...CABVariableFields,
|
|
2821
|
-
name:
|
|
2822
|
-
sectionId:
|
|
2823
|
-
sections:
|
|
2824
|
-
sectionType:
|
|
2777
|
+
name: z31.string().optional(),
|
|
2778
|
+
sectionId: z31.uuid().default(() => uuidv76()),
|
|
2779
|
+
sections: z31.union([z31.array(z31.lazy(() => CABProductSection)), z31.strictObject({}).transform(() => [])]).default(() => []),
|
|
2780
|
+
sectionType: z31.literal(SectionType.products).default(SectionType.products)
|
|
2825
2781
|
});
|
|
2826
2782
|
|
|
2827
2783
|
// src/schema/widgets/checkout-and-beyond/offers.ts
|
|
2828
|
-
var CABOffersSection =
|
|
2784
|
+
var CABOffersSection = z32.lazy(
|
|
2829
2785
|
() => CABLayoutSection.omit({ sections: true, sectionType: true }).extend({
|
|
2830
2786
|
/**
|
|
2831
2787
|
* A rule between consecutive cards in the vertical list — legacy checkout-offers' `<Divider />`,
|
|
@@ -2833,8 +2789,8 @@ var CABOffersSection = z35.lazy(
|
|
|
2833
2789
|
* run of products). Optional, not defaulted: only the v1 converter sets it (REB-24265); a
|
|
2834
2790
|
* hand-built tree keeps React CAB's dividerless rendering.
|
|
2835
2791
|
*/
|
|
2836
|
-
divider:
|
|
2837
|
-
sections:
|
|
2792
|
+
divider: z32.boolean().optional(),
|
|
2793
|
+
sections: z32.union([z32.array(z32.lazy(() => CABSection)), z32.strictObject({}).transform(() => [])]).default(() => [
|
|
2838
2794
|
CABBannerSection.parse({
|
|
2839
2795
|
buttonField: "undoAddToOrder",
|
|
2840
2796
|
color: "success",
|
|
@@ -2848,77 +2804,77 @@ var CABOffersSection = z35.lazy(
|
|
|
2848
2804
|
CABDataSourceSection.parse({}),
|
|
2849
2805
|
CABProductsSection.parse({})
|
|
2850
2806
|
]),
|
|
2851
|
-
sectionType:
|
|
2807
|
+
sectionType: z32.literal(SectionType.offers).default(SectionType.offers)
|
|
2852
2808
|
})
|
|
2853
2809
|
);
|
|
2854
2810
|
|
|
2855
2811
|
// src/schema/widgets/checkout-and-beyond/carousel.ts
|
|
2856
|
-
var CABCarouselSection =
|
|
2812
|
+
var CABCarouselSection = z33.lazy(
|
|
2857
2813
|
() => CABLayoutSection.omit({ sections: true, sectionType: true }).extend({
|
|
2858
|
-
autoAdvanceInterval:
|
|
2859
|
-
itemsAtOnce:
|
|
2814
|
+
autoAdvanceInterval: z33.number().default(0),
|
|
2815
|
+
itemsAtOnce: z33.number().min(1).default(1),
|
|
2860
2816
|
/** Card arrangement for the offers child (`horizontal` = side-by-side) — NOT the carousel's own `direction`. */
|
|
2861
|
-
offersDirection:
|
|
2862
|
-
sections:
|
|
2863
|
-
sectionType:
|
|
2817
|
+
offersDirection: z33.enum(offersDirections).default("vertical"),
|
|
2818
|
+
sections: z33.union([z33.array(z33.lazy(() => CABSection)), z33.strictObject({}).transform(() => [])]).default(() => [CABOffersSection.parse({})]),
|
|
2819
|
+
sectionType: z33.literal(SectionType.carousel).default(SectionType.carousel)
|
|
2864
2820
|
})
|
|
2865
2821
|
);
|
|
2866
2822
|
|
|
2867
2823
|
// src/schema/widgets/checkout-and-beyond/cartLine.ts
|
|
2868
|
-
import { z as
|
|
2869
|
-
var CABCartLineSection =
|
|
2824
|
+
import { z as z34 } from "zod";
|
|
2825
|
+
var CABCartLineSection = z34.lazy(
|
|
2870
2826
|
() => CABLayoutSection.omit({ sections: true, sectionType: true }).extend({
|
|
2871
|
-
sections:
|
|
2872
|
-
sectionType:
|
|
2827
|
+
sections: z34.union([z34.array(z34.lazy(() => CABSection)), z34.strictObject({}).transform(() => [])]).default(() => [CABButtonSection.parse({ action: ButtonAction.switchToSubscription })]),
|
|
2828
|
+
sectionType: z34.literal(SectionType.cartLine).default(SectionType.cartLine)
|
|
2873
2829
|
})
|
|
2874
2830
|
);
|
|
2875
2831
|
|
|
2876
2832
|
// src/schema/widgets/checkout-and-beyond/discount.ts
|
|
2877
2833
|
import { v7 as uuidv77 } from "uuid";
|
|
2878
|
-
import { z as
|
|
2879
|
-
var CABDiscountSection =
|
|
2834
|
+
import { z as z35 } from "zod";
|
|
2835
|
+
var CABDiscountSection = z35.object({
|
|
2880
2836
|
...CABVariableFields,
|
|
2881
|
-
amount:
|
|
2882
|
-
discountedBy:
|
|
2883
|
-
discountedFrom:
|
|
2884
|
-
message:
|
|
2885
|
-
name:
|
|
2886
|
-
quantity:
|
|
2887
|
-
sectionId:
|
|
2888
|
-
sectionType:
|
|
2889
|
-
type:
|
|
2837
|
+
amount: z35.union([z35.number(), z35.string()]).catch(0),
|
|
2838
|
+
discountedBy: z35.string().optional(),
|
|
2839
|
+
discountedFrom: z35.enum(discountSources).optional().catch(void 0),
|
|
2840
|
+
message: z35.string().optional(),
|
|
2841
|
+
name: z35.string().optional(),
|
|
2842
|
+
quantity: z35.number().default(1),
|
|
2843
|
+
sectionId: z35.uuid().default(() => uuidv77()),
|
|
2844
|
+
sectionType: z35.literal(SectionType.discount).default(SectionType.discount),
|
|
2845
|
+
type: z35.enum(discountTypes).catch("none")
|
|
2890
2846
|
});
|
|
2891
2847
|
|
|
2892
2848
|
// src/schema/widgets/checkout-and-beyond/monetize.ts
|
|
2893
2849
|
import { v7 as uuidv78 } from "uuid";
|
|
2894
|
-
import { z as
|
|
2895
|
-
var CABMonetizeAds =
|
|
2896
|
-
requestId:
|
|
2850
|
+
import { z as z36 } from "zod";
|
|
2851
|
+
var CABMonetizeAds = z36.object({
|
|
2852
|
+
requestId: z36.string().optional(),
|
|
2897
2853
|
/** Defaulted here, never in the beacon: absence of information is `ads` itself being absent. */
|
|
2898
|
-
testing:
|
|
2854
|
+
testing: z36.boolean().default(false)
|
|
2899
2855
|
});
|
|
2900
|
-
var CABMonetizeSection =
|
|
2856
|
+
var CABMonetizeSection = z36.object({
|
|
2901
2857
|
...CABVariableFields,
|
|
2902
2858
|
ads: CABMonetizeAds.optional(),
|
|
2903
|
-
name:
|
|
2859
|
+
name: z36.string().optional(),
|
|
2904
2860
|
/**
|
|
2905
2861
|
* Server-hydrated offer cards (inline hydration): when `/cab/sections` was asked with a `monetize`
|
|
2906
2862
|
* context block, the composed cards ride the marker itself — `[]` means "hydrated, no fill" (render
|
|
2907
2863
|
* nothing, skip the fetch); ABSENT means "not hydrated" (the client fetches via `/cab/monetize`).
|
|
2908
2864
|
*/
|
|
2909
|
-
offers:
|
|
2865
|
+
offers: z36.array(z36.lazy(() => CABSection)).optional(),
|
|
2910
2866
|
/** 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. */
|
|
2911
|
-
privacyPolicyUrl:
|
|
2912
|
-
sectionId:
|
|
2913
|
-
sectionType:
|
|
2867
|
+
privacyPolicyUrl: z36.string().optional(),
|
|
2868
|
+
sectionId: z36.uuid().default(() => uuidv78()),
|
|
2869
|
+
sectionType: z36.literal(SectionType.monetize).default(SectionType.monetize),
|
|
2914
2870
|
/** Ads-taxonomy sub-vertical id (the widget's `sub_vertical` setting); paired with `vertical`. */
|
|
2915
|
-
subVertical:
|
|
2871
|
+
subVertical: z36.string().optional(),
|
|
2916
2872
|
/** Ads-taxonomy vertical id (the widget's `vertical` setting) — with `subVertical`, the admin Monetize editor's two configurables. */
|
|
2917
|
-
vertical:
|
|
2873
|
+
vertical: z36.string().optional()
|
|
2918
2874
|
});
|
|
2919
2875
|
|
|
2920
2876
|
// src/schema/widgets/checkout-and-beyond/progressBar.ts
|
|
2921
|
-
import { z as
|
|
2877
|
+
import { z as z37 } from "zod";
|
|
2922
2878
|
|
|
2923
2879
|
// src/schema/widgets/checkout-and-beyond/giftLabels.ts
|
|
2924
2880
|
var GIFT_LABELS = {
|
|
@@ -3037,34 +2993,34 @@ var GIFT_LABELS = {
|
|
|
3037
2993
|
};
|
|
3038
2994
|
|
|
3039
2995
|
// src/schema/widgets/checkout-and-beyond/progressBar.ts
|
|
3040
|
-
var CABProgressTierExclusion =
|
|
3041
|
-
collectionIds:
|
|
3042
|
-
productIds:
|
|
3043
|
-
tags:
|
|
3044
|
-
type:
|
|
2996
|
+
var CABProgressTierExclusion = z37.object({
|
|
2997
|
+
collectionIds: z37.array(z37.number().int().positive()).default(() => []),
|
|
2998
|
+
productIds: z37.array(z37.number().int().positive()).default(() => []),
|
|
2999
|
+
tags: z37.array(z37.string().min(1)).default(() => []),
|
|
3000
|
+
type: z37.enum(progressTierExclusionTypes)
|
|
3045
3001
|
});
|
|
3046
|
-
var CABProgressTier =
|
|
3002
|
+
var CABProgressTier = z37.object({
|
|
3047
3003
|
/**
|
|
3048
3004
|
* Order-discount tiers only (onsite `discount`): the reward the order-discount Function applies at
|
|
3049
3005
|
* cart time, carried so the client can resolve the `{{discountAmount}}` token in this tier's copy.
|
|
3050
3006
|
* `fixedAmount`: shop-currency CENTS (FX-scaled by the client, like {@link CABProgressTier.threshold});
|
|
3051
3007
|
* `percentage`: the whole-percent number rendered raw (`{n}%`). Absent on non-discount tiers.
|
|
3052
3008
|
*/
|
|
3053
|
-
discount:
|
|
3009
|
+
discount: z37.object({ amount: z37.number().nonnegative(), type: z37.enum(["fixedAmount", "percentage"]) }).optional(),
|
|
3054
3010
|
/**
|
|
3055
3011
|
* Per-tier exclusion rules (onsite `exclusions` when `exclusions_enabled`): lines they match don't count
|
|
3056
3012
|
* toward this tier. Empty (the default, and the converter's output for a disabled or ruleless tier) means
|
|
3057
3013
|
* the tier measures the plain bar-level adjusted progress. Consumers read ONLY the list named by the rule's
|
|
3058
3014
|
* `type` — the converter leaves the other two at `[]`, so a populated off-type list never reaches the tree.
|
|
3059
3015
|
*/
|
|
3060
|
-
exclusions:
|
|
3016
|
+
exclusions: z37.array(CABProgressTierExclusion).default(() => []),
|
|
3061
3017
|
/**
|
|
3062
3018
|
* Smart-cart product (gift) tiers only (onsite `filter_oos_variants`): when set, the client drops this
|
|
3063
3019
|
* tier entirely once its gift has NO in-stock eligible variant — the milestone, fill slot and gift
|
|
3064
3020
|
* controls all disappear, mirroring onsite removing the tier from `bar.tiers` before it renders. Absent
|
|
3065
3021
|
* on shipping/discount/decorative tiers and left off by default (the tier renders regardless of stock).
|
|
3066
3022
|
*/
|
|
3067
|
-
filterOosVariants:
|
|
3023
|
+
filterOosVariants: z37.boolean().default(false),
|
|
3068
3024
|
/**
|
|
3069
3025
|
* Smart-cart product (gift) tiers only: the reward unlocked at this tier. The client enriches
|
|
3070
3026
|
* `productId`/`variantIds` to live variants (availability, price) and adds the chosen one to the cart
|
|
@@ -3072,10 +3028,10 @@ var CABProgressTier = z40.object({
|
|
|
3072
3028
|
* tiers and on tiers with no configured product. Cart add/remove is a later stage; carried here so the
|
|
3073
3029
|
* tree is complete.
|
|
3074
3030
|
*/
|
|
3075
|
-
gift:
|
|
3076
|
-
productId:
|
|
3077
|
-
title:
|
|
3078
|
-
variantIds:
|
|
3031
|
+
gift: z37.object({
|
|
3032
|
+
productId: z37.number().int().positive(),
|
|
3033
|
+
title: z37.string().optional(),
|
|
3034
|
+
variantIds: z37.array(z37.number().int().positive()).default(() => [])
|
|
3079
3035
|
}).optional(),
|
|
3080
3036
|
/**
|
|
3081
3037
|
* The step-row icon's square size in PIXELS (onsite `product_tier_element_size`, an admin px string the
|
|
@@ -3095,7 +3051,7 @@ var CABProgressTier = z40.object({
|
|
|
3095
3051
|
* renderer never spells a fallback), which also makes a tree authored before this field render at
|
|
3096
3052
|
* React's size rather than the old hardcoded 20.
|
|
3097
3053
|
*/
|
|
3098
|
-
iconSizePx:
|
|
3054
|
+
iconSizePx: z37.number().int().min(1).max(64).default(18),
|
|
3099
3055
|
/**
|
|
3100
3056
|
* The step-row label at this tier's slot (onsite `getTierLabel`): the merchant custom label, else the
|
|
3101
3057
|
* type default — 'Free Shipping' or '{n}% Discount'. A PRODUCT tier gets NO converter label: its name is
|
|
@@ -3105,35 +3061,35 @@ var CABProgressTier = z40.object({
|
|
|
3105
3061
|
* turns a blank label into an absent key, and a client-authored blank means the same thing — the renderer
|
|
3106
3062
|
* emits no caption slot rather than an empty one). Plain text — a compact icon+label.
|
|
3107
3063
|
*/
|
|
3108
|
-
label:
|
|
3064
|
+
label: z37.record(z37.string(), z37.string()).optional(),
|
|
3109
3065
|
/**
|
|
3110
3066
|
* Smart-cart product (gift) tiers only (onsite `product_tier_image`): show the gift's product image in
|
|
3111
3067
|
* the step-row slot instead of the generic bag icon. The converter can't supply the image URL (config
|
|
3112
3068
|
* carries only product IDs), so the client resolves it (authoritative Shopify featured image, React
|
|
3113
3069
|
* parity) and falls back to the bag icon when the flag is off or no image resolves. Default false.
|
|
3114
3070
|
*/
|
|
3115
|
-
productTierImage:
|
|
3071
|
+
productTierImage: z37.boolean().default(false),
|
|
3116
3072
|
/**
|
|
3117
3073
|
* The tier's goal, measured per `unit`. `currency` (default): SHOP-currency cents — the canonical
|
|
3118
3074
|
* fallback: when the buyer's presentment currency has no entry in `thresholds`, the client
|
|
3119
3075
|
* multiplies this by the live FX rate (converter maps the v1 `unlock_price`, e.g. `75` → `7500`).
|
|
3120
3076
|
* `item`: a raw item count — no cents, no FX, no `thresholds` overrides.
|
|
3121
3077
|
*/
|
|
3122
|
-
threshold:
|
|
3078
|
+
threshold: z37.number().int().nonnegative(),
|
|
3123
3079
|
/**
|
|
3124
3080
|
* Per-presentment-currency goal overrides — lowercased ISO currency code → cents (e.g. `{ cad: 9900 }`).
|
|
3125
3081
|
* When the buyer's currency has an entry, the client uses it verbatim INSTEAD of FX-converting
|
|
3126
3082
|
* `threshold`, so merchants show intentional, clean per-market amounts (Shopify Markets) rather than a
|
|
3127
3083
|
* converted base. Defaults to `{}` — no overrides means always fall back to `threshold`.
|
|
3128
3084
|
*/
|
|
3129
|
-
thresholds:
|
|
3085
|
+
thresholds: z37.record(z37.string(), z37.number().int().nonnegative()).default(() => ({})),
|
|
3130
3086
|
/**
|
|
3131
3087
|
* Smart-cart tier identifier, mirrored onto the gift cart line's `_tier` attribute so the client can
|
|
3132
3088
|
* match an in-cart gift back to its tier (add on reach, remove on downgrade/decline). Absent on the
|
|
3133
3089
|
* shipping bar (single unlabeled tier, no gift).
|
|
3134
3090
|
*/
|
|
3135
|
-
tierId:
|
|
3136
|
-
tierType:
|
|
3091
|
+
tierId: z37.string().optional(),
|
|
3092
|
+
tierType: z37.enum(progressTierTypes).default(ProgressTierType.shipping),
|
|
3137
3093
|
/**
|
|
3138
3094
|
* What this tier's progress is measured in — PER TIER (onsite's `unlock_condition_type` model, NOT
|
|
3139
3095
|
* the React port's bar-level `tiers[0]` shortcut). `currency` compares money cents against the
|
|
@@ -3144,9 +3100,9 @@ var CABProgressTier = z40.object({
|
|
|
3144
3100
|
* count carries no injected noun (no English `item`/`items` inflection on localized copy); merchant
|
|
3145
3101
|
* template text supplies grammatically-neutral wording around the token.
|
|
3146
3102
|
*/
|
|
3147
|
-
unit:
|
|
3103
|
+
unit: z37.enum(progressTierUnits).default(ProgressTierUnit.currency)
|
|
3148
3104
|
});
|
|
3149
|
-
var CABProgressBarSection =
|
|
3105
|
+
var CABProgressBarSection = z37.lazy(
|
|
3150
3106
|
() => CABLayoutSection.omit({ sectionType: true }).extend({
|
|
3151
3107
|
/**
|
|
3152
3108
|
* The onsite bar id (smart-cart TPB bars only). The client mirrors it to the cart's `_barId` attribute
|
|
@@ -3155,35 +3111,35 @@ var CABProgressBarSection = z40.lazy(
|
|
|
3155
3111
|
* checkout reaches the extension without it, so the client writes it or the tier gift's 100% discount
|
|
3156
3112
|
* (and any tier order discount) never applies. Absent on the v1 shipping bar (no gift tiers, no id).
|
|
3157
3113
|
*/
|
|
3158
|
-
barId:
|
|
3114
|
+
barId: z37.string().optional(),
|
|
3159
3115
|
/** Empty = shown everywhere; otherwise uppercase ISO country codes. */
|
|
3160
|
-
countryCodes:
|
|
3116
|
+
countryCodes: z37.array(z37.string().transform((code) => code.trim().toUpperCase())).default(() => []),
|
|
3161
3117
|
/**
|
|
3162
3118
|
* Uppercase ISO codes where a higher-precedence geo bar applies, so this (default, non-geo) bar is
|
|
3163
3119
|
* hidden there — replicates React `getbar`'s geo-match-over-default precedence. Empty = never excluded.
|
|
3164
3120
|
*/
|
|
3165
|
-
excludeCountryCodes:
|
|
3121
|
+
excludeCountryCodes: z37.array(z37.string().transform((code) => code.trim().toUpperCase())).default(() => []),
|
|
3166
3122
|
/**
|
|
3167
3123
|
* Measure progress against the PRE-discount subtotal (onsite `exclude_discount_in_subtotal`, and
|
|
3168
3124
|
* forced on for bars with a discount tier so its own reward can't un-reach the tier). The client
|
|
3169
3125
|
* adds the cart's discount allocations back to the live subtotal.
|
|
3170
3126
|
*/
|
|
3171
|
-
excludeDiscountInSubtotal:
|
|
3127
|
+
excludeDiscountInSubtotal: z37.boolean().default(false),
|
|
3172
3128
|
/** Variant ids the client subtracts from the adjusted subtotal (React `bar.excluded_products`). */
|
|
3173
|
-
excludedVariantIds:
|
|
3129
|
+
excludedVariantIds: z37.array(z37.number().int().positive()).default(() => []),
|
|
3174
3130
|
/**
|
|
3175
3131
|
* When the cart holds a subscription item, treat the bar as reached regardless of subtotal (React
|
|
3176
3132
|
* `free_shipping_on_subscription(s)`). `freeShippingOnAll` is already a zero-threshold tier instead.
|
|
3177
3133
|
*/
|
|
3178
|
-
freeShippingOnSubscription:
|
|
3134
|
+
freeShippingOnSubscription: z37.boolean().default(false),
|
|
3179
3135
|
/** Localized heading over the gift controls (onsite `gift_area_title`, default 'FREE GIFTS'). */
|
|
3180
|
-
giftAreaTitle:
|
|
3136
|
+
giftAreaTitle: z37.record(z37.string(), z37.string()).default(() => ({ en: "FREE GIFTS" })),
|
|
3181
3137
|
/** Localized gift-control labels (add/remove/heading); a tier's gift `title` beats `yourGift`. */
|
|
3182
|
-
giftLabels:
|
|
3183
|
-
addGift:
|
|
3184
|
-
remove:
|
|
3185
|
-
selectOptions:
|
|
3186
|
-
yourGift:
|
|
3138
|
+
giftLabels: z37.object({
|
|
3139
|
+
addGift: z37.record(z37.string(), z37.string()).default(() => ({ ...GIFT_LABELS.addGift })),
|
|
3140
|
+
remove: z37.record(z37.string(), z37.string()).default(() => ({ ...GIFT_LABELS.remove })),
|
|
3141
|
+
selectOptions: z37.record(z37.string(), z37.string()).default(() => ({ ...GIFT_LABELS.selectOptions })),
|
|
3142
|
+
yourGift: z37.record(z37.string(), z37.string()).default(() => ({ ...GIFT_LABELS.yourGift }))
|
|
3187
3143
|
}).default(() => ({
|
|
3188
3144
|
addGift: { ...GIFT_LABELS.addGift },
|
|
3189
3145
|
remove: { ...GIFT_LABELS.remove },
|
|
@@ -3191,38 +3147,38 @@ var CABProgressBarSection = z40.lazy(
|
|
|
3191
3147
|
yourGift: { ...GIFT_LABELS.yourGift }
|
|
3192
3148
|
})),
|
|
3193
3149
|
/** The bar's a11y label; the merchant names it in the editor, else this default (React parity). */
|
|
3194
|
-
name:
|
|
3150
|
+
name: z37.string().default("Order progress"),
|
|
3195
3151
|
/**
|
|
3196
3152
|
* Bar fill color. An explicit (widget-authored) value is used verbatim; when absent the server
|
|
3197
3153
|
* fills it with the live shop theme's `buttonBackground` (React `useRebuyTheme` parity). Still
|
|
3198
3154
|
* absent after that ⇒ the theme fetch failed and the client renders its platform-default bar —
|
|
3199
3155
|
* optional, not defaulted, so "merchant chose no color" stays distinguishable from any real value.
|
|
3200
3156
|
*/
|
|
3201
|
-
progressColor:
|
|
3202
|
-
sectionType:
|
|
3157
|
+
progressColor: z37.string().optional(),
|
|
3158
|
+
sectionType: z37.literal(SectionType.progressBar).default(SectionType.progressBar),
|
|
3203
3159
|
/**
|
|
3204
3160
|
* The bar's milestones in the merchant's CONFIGURED order — the renderer does NOT sort them (022
|
|
3205
3161
|
* O-B2: sorting by resolved threshold reversed configured milestones on out-of-order or mixed-unit
|
|
3206
3162
|
* count-vs-cents bars). Drives the fill (even slot per tier) and, for smart-cart product tiers, the
|
|
3207
3163
|
* gift add/remove. The visual tier display lives in `sections` (composable), NOT here.
|
|
3208
3164
|
*/
|
|
3209
|
-
tiers:
|
|
3165
|
+
tiers: z37.union([z37.array(CABProgressTier), z37.strictObject({}).transform(() => [])]).default(() => [])
|
|
3210
3166
|
})
|
|
3211
3167
|
);
|
|
3212
3168
|
|
|
3213
3169
|
// src/schema/widgets/checkout-and-beyond/quantity.ts
|
|
3214
3170
|
import { v7 as uuidv79 } from "uuid";
|
|
3215
|
-
import { z as
|
|
3216
|
-
var CABQuantitySection =
|
|
3171
|
+
import { z as z38 } from "zod";
|
|
3172
|
+
var CABQuantitySection = z38.object({
|
|
3217
3173
|
...CABVariableFields,
|
|
3218
|
-
errorMessages:
|
|
3219
|
-
|
|
3220
|
-
|
|
3174
|
+
errorMessages: z38.record(
|
|
3175
|
+
z38.string(),
|
|
3176
|
+
z38.object({
|
|
3221
3177
|
/** `{{step}}` is interpolated at render — the off-increment message React never gave a merchant key. */
|
|
3222
|
-
increment:
|
|
3223
|
-
max:
|
|
3224
|
-
min:
|
|
3225
|
-
neg:
|
|
3178
|
+
increment: z38.string().optional(),
|
|
3179
|
+
max: z38.string().optional(),
|
|
3180
|
+
min: z38.string().optional(),
|
|
3181
|
+
neg: z38.string().optional()
|
|
3226
3182
|
})
|
|
3227
3183
|
).default({
|
|
3228
3184
|
en: {
|
|
@@ -3232,18 +3188,18 @@ var CABQuantitySection = z41.object({
|
|
|
3232
3188
|
neg: "Quantity cannot be negative"
|
|
3233
3189
|
}
|
|
3234
3190
|
}),
|
|
3235
|
-
inputType:
|
|
3236
|
-
max:
|
|
3237
|
-
min:
|
|
3191
|
+
inputType: z38.enum(quantityInputs).default(QuantityInput.select),
|
|
3192
|
+
max: z38.number().min(1).max(100).default(10),
|
|
3193
|
+
min: z38.number().min(1).default(1),
|
|
3238
3194
|
/** The a11y label for the quantity control; the merchant names it in the editor, else this default. */
|
|
3239
|
-
name:
|
|
3240
|
-
sectionId:
|
|
3241
|
-
sectionType:
|
|
3195
|
+
name: z38.string().default("Quantity"),
|
|
3196
|
+
sectionId: z38.uuid().default(() => uuidv79()),
|
|
3197
|
+
sectionType: z38.literal(SectionType.quantity).default(SectionType.quantity)
|
|
3242
3198
|
});
|
|
3243
3199
|
|
|
3244
3200
|
// src/schema/widgets/checkout-and-beyond/reviews.ts
|
|
3245
3201
|
import { v7 as uuidv710 } from "uuid";
|
|
3246
|
-
import { z as
|
|
3202
|
+
import { z as z39 } from "zod";
|
|
3247
3203
|
|
|
3248
3204
|
// src/schema/widgets/checkout-and-beyond/reviewLabels.ts
|
|
3249
3205
|
var REVIEW_LABELS = {
|
|
@@ -3306,68 +3262,68 @@ var REVIEW_LABELS = {
|
|
|
3306
3262
|
};
|
|
3307
3263
|
|
|
3308
3264
|
// src/schema/widgets/checkout-and-beyond/reviews.ts
|
|
3309
|
-
var CABReviewsSection =
|
|
3265
|
+
var CABReviewsSection = z39.object({
|
|
3310
3266
|
...CABVariableFields,
|
|
3311
|
-
color:
|
|
3267
|
+
color: z39.string().default("#fadb14"),
|
|
3312
3268
|
/**
|
|
3313
3269
|
* Localized review-count templates (`{{reviewCount}}`), one/other plural forms; the client picks the
|
|
3314
3270
|
* form via `Intl.PluralRules`. Defaults here (schema-first) so every tree localizes without converter
|
|
3315
3271
|
* or merchant work.
|
|
3316
3272
|
*/
|
|
3317
|
-
countLabels:
|
|
3318
|
-
one:
|
|
3319
|
-
other:
|
|
3273
|
+
countLabels: z39.object({
|
|
3274
|
+
one: z39.record(z39.string(), z39.string()).default(() => ({ ...REVIEW_LABELS.one })),
|
|
3275
|
+
other: z39.record(z39.string(), z39.string()).default(() => ({ ...REVIEW_LABELS.other }))
|
|
3320
3276
|
}).default(() => ({ one: { ...REVIEW_LABELS.one }, other: { ...REVIEW_LABELS.other } })),
|
|
3321
|
-
name:
|
|
3322
|
-
sectionId:
|
|
3323
|
-
sectionType:
|
|
3324
|
-
size:
|
|
3277
|
+
name: z39.string().optional(),
|
|
3278
|
+
sectionId: z39.uuid().default(() => uuidv710()),
|
|
3279
|
+
sectionType: z39.literal(SectionType.reviews).default(SectionType.reviews),
|
|
3280
|
+
size: z39.enum(reviewsSizes).default(ReviewsSize.default),
|
|
3325
3281
|
/**
|
|
3326
3282
|
* Star outline color, interpolated into a style by the renderer, so it is hex-constrained like
|
|
3327
3283
|
* `CABButtonSection.color`. The legacy source (`PostPurchaseSettings.styles.starStrokeColor`) is a free
|
|
3328
3284
|
* string: its converter must validate and fall back to this default rather than let one odd value drop
|
|
3329
3285
|
* the whole reviews section.
|
|
3330
3286
|
*/
|
|
3331
|
-
strokeColor:
|
|
3287
|
+
strokeColor: z39.string().regex(HEX_COLOR_REGEX).default("#fadb14"),
|
|
3332
3288
|
/** Star outline width in px; `0` draws no outline. The legacy `styles.strokeWidth` is a STRING ('1') — its converter coerces. */
|
|
3333
|
-
strokeWidth:
|
|
3289
|
+
strokeWidth: z39.number().nonnegative().default(0)
|
|
3334
3290
|
});
|
|
3335
3291
|
|
|
3336
3292
|
// src/schema/widgets/checkout-and-beyond/separator.ts
|
|
3337
3293
|
import { v7 as uuidv711 } from "uuid";
|
|
3338
|
-
import { z as
|
|
3339
|
-
var CABSeparatorSection =
|
|
3294
|
+
import { z as z40 } from "zod";
|
|
3295
|
+
var CABSeparatorSection = z40.object({
|
|
3340
3296
|
...CABVariableFields,
|
|
3341
|
-
sectionId:
|
|
3342
|
-
sectionType:
|
|
3297
|
+
sectionId: z40.uuid().default(() => uuidv711()),
|
|
3298
|
+
sectionType: z40.literal(SectionType.separator).default(SectionType.separator)
|
|
3343
3299
|
});
|
|
3344
3300
|
|
|
3345
3301
|
// src/schema/widgets/checkout-and-beyond/variants.ts
|
|
3346
3302
|
import { slice } from "es-toolkit/compat";
|
|
3347
3303
|
import { v7 as uuidv712 } from "uuid";
|
|
3348
|
-
import { z as
|
|
3349
|
-
var CABVariantsSection =
|
|
3304
|
+
import { z as z41 } from "zod";
|
|
3305
|
+
var CABVariantsSection = z41.object({
|
|
3350
3306
|
...CABVariableFields,
|
|
3351
|
-
hideOutOfStockVariants:
|
|
3352
|
-
name:
|
|
3353
|
-
sectionId:
|
|
3354
|
-
sectionType:
|
|
3355
|
-
selector:
|
|
3356
|
-
variantMode:
|
|
3307
|
+
hideOutOfStockVariants: z41.boolean().default(false),
|
|
3308
|
+
name: z41.string().optional(),
|
|
3309
|
+
sectionId: z41.uuid().default(() => uuidv712()),
|
|
3310
|
+
sectionType: z41.literal(SectionType.variants).default(SectionType.variants),
|
|
3311
|
+
selector: z41.enum(slice(variantSelectors, 0, 3)).default(VariantSelector.menu),
|
|
3312
|
+
variantMode: z41.enum(variantModes).default(VariantMode.multiple)
|
|
3357
3313
|
});
|
|
3358
3314
|
|
|
3359
3315
|
// src/schema/widgets/checkout-and-beyond/shared.ts
|
|
3360
|
-
var CABBorder =
|
|
3361
|
-
radius:
|
|
3362
|
-
style:
|
|
3363
|
-
width:
|
|
3316
|
+
var CABBorder = z42.object({
|
|
3317
|
+
radius: z42.enum(borderRadii).default(BorderRadius.base),
|
|
3318
|
+
style: z42.enum(borderStyles).default(BorderStyle.none),
|
|
3319
|
+
width: z42.enum(borderWidths).default(BorderWidth.base)
|
|
3364
3320
|
}).default({
|
|
3365
3321
|
radius: BorderRadius.base,
|
|
3366
3322
|
style: BorderStyle.none,
|
|
3367
3323
|
width: BorderWidth.base
|
|
3368
3324
|
});
|
|
3369
|
-
var CABSection =
|
|
3370
|
-
() =>
|
|
3325
|
+
var CABSection = z42.lazy(
|
|
3326
|
+
() => z42.discriminatedUnion("sectionType", [
|
|
3371
3327
|
CABBannerSection,
|
|
3372
3328
|
CABButtonSection,
|
|
3373
3329
|
CABCarouselSection,
|
|
@@ -3390,41 +3346,41 @@ var CABSection = z45.lazy(
|
|
|
3390
3346
|
);
|
|
3391
3347
|
|
|
3392
3348
|
// src/schema/widgets/checkout-and-beyond/layout.ts
|
|
3393
|
-
var GridItem =
|
|
3394
|
-
var CABLayoutWrapping =
|
|
3395
|
-
breakAt:
|
|
3396
|
-
maxPerLine:
|
|
3349
|
+
var GridItem = z43.union([z43.literal("auto"), z43.literal("fill"), z43.string().regex(/^\d+%$/), z43.number()]);
|
|
3350
|
+
var CABLayoutWrapping = z43.object({
|
|
3351
|
+
breakAt: z43.number().positive(),
|
|
3352
|
+
maxPerLine: z43.number().int().positive()
|
|
3397
3353
|
});
|
|
3398
|
-
var CABLayoutSection =
|
|
3354
|
+
var CABLayoutSection = z43.object({
|
|
3399
3355
|
...CABVariableFields,
|
|
3400
|
-
alignment:
|
|
3401
|
-
horizontal:
|
|
3402
|
-
vertical:
|
|
3356
|
+
alignment: z43.object({
|
|
3357
|
+
horizontal: z43.enum(horizontalAlignments).default(HorizontalAlignment.start),
|
|
3358
|
+
vertical: z43.enum(verticalAlignments).default(VerticalAlignment.top)
|
|
3403
3359
|
}).default({
|
|
3404
3360
|
horizontal: HorizontalAlignment.start,
|
|
3405
3361
|
vertical: VerticalAlignment.top
|
|
3406
3362
|
}),
|
|
3407
|
-
border:
|
|
3408
|
-
buttonField:
|
|
3409
|
-
direction:
|
|
3363
|
+
border: z43.lazy(() => CABBorder),
|
|
3364
|
+
buttonField: z43.enum(buttonFields).optional(),
|
|
3365
|
+
direction: z43.enum(directions).default(Direction.rows),
|
|
3410
3366
|
/**
|
|
3411
3367
|
* Platform chrome around the section, not a layout behavior: `callout` is a subdued box with block borders
|
|
3412
3368
|
* (the legacy post-purchase callout banner), `offer-content` the post-purchase offer's own content card.
|
|
3413
3369
|
*/
|
|
3414
|
-
frame:
|
|
3415
|
-
grid:
|
|
3416
|
-
columns:
|
|
3417
|
-
rows:
|
|
3370
|
+
frame: z43.enum(layoutFrames).optional(),
|
|
3371
|
+
grid: z43.object({
|
|
3372
|
+
columns: z43.union([z43.array(GridItem), z43.undefined()]).default(() => ["auto"]),
|
|
3373
|
+
rows: z43.union([z43.array(GridItem), z43.undefined()]).default(() => ["auto"])
|
|
3418
3374
|
}).default({ columns: ["auto"], rows: ["auto"] }).optional(),
|
|
3419
|
-
name:
|
|
3420
|
-
padding:
|
|
3421
|
-
sectionId:
|
|
3422
|
-
sections:
|
|
3423
|
-
sectionType:
|
|
3424
|
-
spacing:
|
|
3375
|
+
name: z43.string().optional(),
|
|
3376
|
+
padding: z43.enum(spacings).default(Spacing.none),
|
|
3377
|
+
sectionId: z43.uuid().default(() => uuidv713()),
|
|
3378
|
+
sections: z43.union([z43.array(z43.lazy(() => CABSection)), z43.strictObject({}).transform(() => [])]).default(() => []),
|
|
3379
|
+
sectionType: z43.literal(SectionType.layout).default(SectionType.layout),
|
|
3380
|
+
spacing: z43.enum(spacings).default(Spacing.base),
|
|
3425
3381
|
/** Fire-and-forget impression pixel POSTed once when the section is shown (e.g. a Monetize offer view). */
|
|
3426
|
-
viewUrl:
|
|
3427
|
-
width:
|
|
3382
|
+
viewUrl: z43.string().optional(),
|
|
3383
|
+
width: z43.number().default(100),
|
|
3428
3384
|
wrapping: CABLayoutWrapping.optional()
|
|
3429
3385
|
});
|
|
3430
3386
|
|
|
@@ -3446,8 +3402,8 @@ var UI_LABELS = {
|
|
|
3446
3402
|
};
|
|
3447
3403
|
|
|
3448
3404
|
// src/schema/widgets/checkout-and-beyond/root.ts
|
|
3449
|
-
var localized = (fallback) =>
|
|
3450
|
-
var CABUILabels =
|
|
3405
|
+
var localized = (fallback) => z44.record(z44.string(), z44.string()).default(() => ({ ...fallback })).transform((labels) => Object.keys(labels).length > 0 ? labels : { ...fallback });
|
|
3406
|
+
var CABUILabels = z44.object({
|
|
3451
3407
|
currentPage: localized(UI_LABELS.currentPage),
|
|
3452
3408
|
guest: localized(UI_LABELS.guest),
|
|
3453
3409
|
loadingOptions: localized(UI_LABELS.loadingOptions),
|
|
@@ -3472,42 +3428,141 @@ var CABUILabels = z47.object({
|
|
|
3472
3428
|
subscriptionOptions: { ...UI_LABELS.subscriptionOptions },
|
|
3473
3429
|
updating: { ...UI_LABELS.updating }
|
|
3474
3430
|
}));
|
|
3475
|
-
var TargetArea =
|
|
3476
|
-
fill:
|
|
3477
|
-
flip:
|
|
3478
|
-
icon:
|
|
3479
|
-
label:
|
|
3480
|
-
width:
|
|
3431
|
+
var TargetArea = z44.object({
|
|
3432
|
+
fill: z44.boolean().optional(),
|
|
3433
|
+
flip: z44.enum(["both", "horizontal", "vertical"]).optional(),
|
|
3434
|
+
icon: z44.string(),
|
|
3435
|
+
label: z44.string(),
|
|
3436
|
+
width: z44.string()
|
|
3481
3437
|
}).default(targetAreas[EditorMode.checkoutExtension][1]);
|
|
3482
|
-
var CABTracking =
|
|
3483
|
-
enableAttribution:
|
|
3484
|
-
enableSource:
|
|
3485
|
-
enableWidget:
|
|
3438
|
+
var CABTracking = z44.object({
|
|
3439
|
+
enableAttribution: z44.boolean().nullish().transform((value) => value ?? true),
|
|
3440
|
+
enableSource: z44.boolean().nullish().transform((value) => value ?? true),
|
|
3441
|
+
enableWidget: z44.boolean().nullish().transform((value) => value ?? true)
|
|
3486
3442
|
}).nullish().transform((value) => value ?? { enableAttribution: true, enableSource: true, enableWidget: true });
|
|
3487
|
-
var CABExperiment =
|
|
3488
|
-
elementId:
|
|
3489
|
-
experimentId:
|
|
3490
|
-
experimentType:
|
|
3491
|
-
selectedId:
|
|
3443
|
+
var CABExperiment = z44.object({
|
|
3444
|
+
elementId: z44.number(),
|
|
3445
|
+
experimentId: z44.number(),
|
|
3446
|
+
experimentType: z44.string(),
|
|
3447
|
+
selectedId: z44.number()
|
|
3492
3448
|
});
|
|
3493
3449
|
var CABRootSection = CABLayoutSection.extend({
|
|
3494
|
-
editorMode:
|
|
3450
|
+
editorMode: z44.enum(editorModes).default(EditorMode.checkoutExtension),
|
|
3495
3451
|
experiment: CABExperiment.optional(),
|
|
3496
3452
|
// Same rule as CABTracking above: the v1 converters pass raw legacy `previewMode` through, so a
|
|
3497
3453
|
// `null` must fall back rather than throw the widget; malformed values still throw.
|
|
3498
|
-
previewMode:
|
|
3499
|
-
storeId:
|
|
3454
|
+
previewMode: z44.boolean().nullish().transform((value) => value ?? false),
|
|
3455
|
+
storeId: z44.number().nullable().default(null),
|
|
3500
3456
|
targetArea: TargetArea.nullable(),
|
|
3501
3457
|
tracking: CABTracking,
|
|
3502
|
-
type:
|
|
3458
|
+
type: z44.enum(widgetTypes).default(WidgetType.ui_extension_content_block),
|
|
3503
3459
|
uiLabels: CABUILabels,
|
|
3504
|
-
version:
|
|
3505
|
-
widgetId:
|
|
3460
|
+
version: z44.literal(2).default(2),
|
|
3461
|
+
widgetId: z44.number().nullable().default(null)
|
|
3462
|
+
});
|
|
3463
|
+
|
|
3464
|
+
// src/schema/postPurchaseProductView.ts
|
|
3465
|
+
var PostPurchaseProductView = z45.union([
|
|
3466
|
+
z45.object({
|
|
3467
|
+
groupCatalog: PostPurchaseGroupCatalog.optional(),
|
|
3468
|
+
initialVariant: PostPurchaseVariantSelector.optional(),
|
|
3469
|
+
planCatalog: PostPurchasePlanCatalog.nullable().optional(),
|
|
3470
|
+
preparation: PreparedPostPurchaseProduct.extend({
|
|
3471
|
+
display: PreparedPostPurchaseProduct.shape.display.extend({ description: z45.string().nullable() }).refine(
|
|
3472
|
+
({ description, descriptionDocument }) => description === null === (descriptionDocument !== void 0),
|
|
3473
|
+
"Exactly one of the plain and rich descriptions is shown"
|
|
3474
|
+
)
|
|
3475
|
+
}),
|
|
3476
|
+
purchaseOptions: PostPurchaseOptions.optional(),
|
|
3477
|
+
sections: CABRootSection,
|
|
3478
|
+
variantCatalog: PostPurchaseVariantCatalog.optional()
|
|
3479
|
+
}),
|
|
3480
|
+
z45.object({
|
|
3481
|
+
groupCatalog: PostPurchaseGroupCatalog.optional(),
|
|
3482
|
+
initialVariant: PostPurchaseVariantSelector.optional(),
|
|
3483
|
+
planCatalog: PostPurchasePlanCatalog.nullable().optional(),
|
|
3484
|
+
preparation: PostPurchasePreparation.options[1],
|
|
3485
|
+
purchaseOptions: PostPurchaseOptions.optional(),
|
|
3486
|
+
sections: z45.null(),
|
|
3487
|
+
variantCatalog: PostPurchaseVariantCatalog.optional()
|
|
3488
|
+
})
|
|
3489
|
+
]);
|
|
3490
|
+
|
|
3491
|
+
// src/schema/postPurchaseProductCollectionView.ts
|
|
3492
|
+
var PostPurchaseProductCollectionView = z46.object({
|
|
3493
|
+
members: z46.array(
|
|
3494
|
+
z46.object({
|
|
3495
|
+
productId: PostPurchaseProductId,
|
|
3496
|
+
productIndex: z46.number().int().nonnegative(),
|
|
3497
|
+
view: PostPurchaseProductView
|
|
3498
|
+
})
|
|
3499
|
+
)
|
|
3500
|
+
});
|
|
3501
|
+
var PostPurchaseCollectionChoice = z46.object({
|
|
3502
|
+
choice: PostPurchaseChoice.optional(),
|
|
3503
|
+
productId: PostPurchaseProductId,
|
|
3504
|
+
variantId: PostPurchaseVariantSelector.shape.variantId.optional()
|
|
3505
|
+
}).strict();
|
|
3506
|
+
var PostPurchaseExcludedProductIds = z46.array(PostPurchaseProductId).default([]);
|
|
3507
|
+
|
|
3508
|
+
// src/schema/postPurchaseQuantity.ts
|
|
3509
|
+
var quantity = PreparedPostPurchaseProduct.shape.selection.shape.quantity;
|
|
3510
|
+
var PostPurchaseQuantityChoice = PostPurchaseCollectionChoice.extend({ quantity: quantity.optional() });
|
|
3511
|
+
var PostPurchaseQuantityPolicy = PostPurchaseSettings.shape.quantityInputs.omit({ defaultQuantity: true }).extend({
|
|
3512
|
+
initialQuantity: quantity,
|
|
3513
|
+
maxValue: quantity,
|
|
3514
|
+
minValue: z47.literal(0).transform(() => 1).or(quantity)
|
|
3515
|
+
}).refine(({ maxValue, minValue }) => minValue <= maxValue, "Quantity bounds are reversed");
|
|
3516
|
+
|
|
3517
|
+
// src/schema/postPurchaseGroup.ts
|
|
3518
|
+
var PostPurchaseGroupChoice = PostPurchaseQuantityChoice.extend({
|
|
3519
|
+
memberProductId: PreparedPostPurchaseProduct.shape.selection.shape.productId
|
|
3520
|
+
});
|
|
3521
|
+
|
|
3522
|
+
// src/schema/postPurchaseIdentity.ts
|
|
3523
|
+
import { z as z48 } from "zod";
|
|
3524
|
+
var POST_PURCHASE_ID_MAX = 128;
|
|
3525
|
+
var PostPurchaseTimestampSchema = z48.number().int().nonnegative();
|
|
3526
|
+
var PostPurchaseOrderIdSchema = z48.string().regex(/^gid:\/\/shopify\/Order\/[1-9]\d*$/);
|
|
3527
|
+
var ShopifyDomainSchema = z48.string().max(POST_PURCHASE_ID_MAX).regex(/^[a-z0-9]([a-z0-9-]*[a-z0-9])?\.myshopify\.com$/);
|
|
3528
|
+
var DecideRequestSchema = z48.object({
|
|
3529
|
+
checkoutToken: z48.string().min(1).max(POST_PURCHASE_ID_MAX),
|
|
3530
|
+
shop: ShopifyDomainSchema
|
|
3531
|
+
});
|
|
3532
|
+
var PostPurchaseAppIdSchema = z48.string().min(1).max(POST_PURCHASE_ID_MAX);
|
|
3533
|
+
var DecisionEntrySchema = z48.object({
|
|
3534
|
+
blockId: z48.number().int().positive(),
|
|
3535
|
+
blockIndex: z48.string(),
|
|
3536
|
+
blockParentIndex: z48.string(),
|
|
3537
|
+
flowId: z48.number().int().positive(),
|
|
3538
|
+
sectionId: z48.number().int().positive(),
|
|
3539
|
+
widgetId: z48.number().int().positive(),
|
|
3540
|
+
widgetTraffic: z48.number().min(0).max(100)
|
|
3541
|
+
});
|
|
3542
|
+
|
|
3543
|
+
// src/schema/postPurchaseOfferEligibility.ts
|
|
3544
|
+
import { z as z49 } from "zod";
|
|
3545
|
+
var selection = PreparedPostPurchaseProduct.shape.selection;
|
|
3546
|
+
var PostPurchaseOfferSkipReason = z49.enum(["empty", "no-eligible-subscription"]);
|
|
3547
|
+
var PostPurchaseOfferEligibilityContext = z49.object({
|
|
3548
|
+
excludedProductIds: PostPurchaseExcludedProductIds,
|
|
3549
|
+
originalLineItems: z49.array(selection.pick({ productId: true, sellingPlanId: true, variantId: true }))
|
|
3506
3550
|
});
|
|
3551
|
+
var PostPurchaseOfferEligibility = z49.discriminatedUnion("status", [
|
|
3552
|
+
z49.object({
|
|
3553
|
+
members: z49.array(
|
|
3554
|
+
z49.object({ productId: selection.shape.productId, productIndex: z49.number().int().nonnegative() })
|
|
3555
|
+
),
|
|
3556
|
+
status: z49.literal("retain")
|
|
3557
|
+
}),
|
|
3558
|
+
z49.object({ reason: PostPurchaseOfferSkipReason, status: z49.literal("skip") }),
|
|
3559
|
+
z49.object({ reason: z49.literal("eligible-upgrade").optional(), status: z49.literal("unavailable") })
|
|
3560
|
+
]);
|
|
3507
3561
|
|
|
3508
3562
|
// src/schema/postPurchaseOfferPresentation.ts
|
|
3563
|
+
import { z as z50 } from "zod";
|
|
3509
3564
|
var language2 = PostPurchaseSettings.shape.language.shape.global.unwrap().unwrap();
|
|
3510
|
-
var PostPurchaseOfferPresentation =
|
|
3565
|
+
var PostPurchaseOfferPresentation = z50.strictObject({
|
|
3511
3566
|
labels: language2.pick({ declineAll: true, declineThisOffer: true }),
|
|
3512
3567
|
layout: PostPurchaseSettings.shape.offersLayout,
|
|
3513
3568
|
sections: CABRootSection.nullable(),
|
|
@@ -3515,22 +3570,22 @@ var PostPurchaseOfferPresentation = z48.strictObject({
|
|
|
3515
3570
|
});
|
|
3516
3571
|
|
|
3517
3572
|
// src/schema/postPurchaseOrderDecision.ts
|
|
3518
|
-
import { z as
|
|
3519
|
-
var OrderDecisionSchema =
|
|
3520
|
-
|
|
3521
|
-
|
|
3573
|
+
import { z as z51 } from "zod";
|
|
3574
|
+
var OrderDecisionSchema = z51.discriminatedUnion("owner", [
|
|
3575
|
+
z51.object({ owner: z51.literal("session"), sessionId: z51.string().regex(/^[a-f0-9]{64}$/) }),
|
|
3576
|
+
z51.object({ owner: z51.literal("release"), sessionId: z51.null() })
|
|
3522
3577
|
]);
|
|
3523
3578
|
|
|
3524
3579
|
// src/schema/postPurchasePolicy.ts
|
|
3525
|
-
import { z as
|
|
3526
|
-
var HoldSettingSchema =
|
|
3527
|
-
|
|
3528
|
-
|
|
3580
|
+
import { z as z52 } from "zod";
|
|
3581
|
+
var HoldSettingSchema = z52.discriminatedUnion("enabled", [
|
|
3582
|
+
z52.object({ durationMinutes: z52.number().int().min(1).max(60), enabled: z52.literal(true) }),
|
|
3583
|
+
z52.object({ durationMinutes: z52.null(), enabled: z52.literal(false) })
|
|
3529
3584
|
]);
|
|
3530
|
-
var TimingSettingsSchema =
|
|
3585
|
+
var TimingSettingsSchema = z52.object({ flowHold: HoldSettingSchema, shopHold: HoldSettingSchema });
|
|
3531
3586
|
var SessionPolicySchema = TimingSettingsSchema.extend({
|
|
3532
|
-
durationMinutes:
|
|
3533
|
-
source:
|
|
3587
|
+
durationMinutes: z52.number().int().min(1).max(60).nullable(),
|
|
3588
|
+
source: z52.enum(["shop", "flow", "native"])
|
|
3534
3589
|
}).refine(
|
|
3535
3590
|
(policy) => {
|
|
3536
3591
|
const expectedSource = policy.shopHold.enabled ? "shop" : policy.flowHold.enabled ? "flow" : "native";
|
|
@@ -3543,9 +3598,73 @@ var SessionPolicySchema = TimingSettingsSchema.extend({
|
|
|
3543
3598
|
}
|
|
3544
3599
|
);
|
|
3545
3600
|
|
|
3601
|
+
// src/schema/postPurchaseProductCalculation.ts
|
|
3602
|
+
import { z as z53 } from "zod";
|
|
3603
|
+
var MoneyBag = z53.object({
|
|
3604
|
+
presentmentMoney: z53.object({
|
|
3605
|
+
amount: PostPurchaseAmount,
|
|
3606
|
+
currencyCode: z53.string().regex(/^[A-Z]{3}$/)
|
|
3607
|
+
})
|
|
3608
|
+
});
|
|
3609
|
+
var PostPurchaseProductCalculation = z53.object({
|
|
3610
|
+
calculatedPurchase: z53.object({
|
|
3611
|
+
addedShippingLines: z53.array(z53.object({ priceSet: MoneyBag })),
|
|
3612
|
+
addedTaxLines: z53.array(z53.object({ priceSet: MoneyBag })),
|
|
3613
|
+
totalOutstandingSet: MoneyBag,
|
|
3614
|
+
updatedLineItems: z53.array(
|
|
3615
|
+
z53.object({
|
|
3616
|
+
priceSet: z53.unknown().optional(),
|
|
3617
|
+
productId: z53.number().int().positive(),
|
|
3618
|
+
sellingPlanId: z53.unknown().optional(),
|
|
3619
|
+
variantId: z53.number().int().positive()
|
|
3620
|
+
})
|
|
3621
|
+
)
|
|
3622
|
+
}),
|
|
3623
|
+
errors: z53.array(z53.unknown()).length(0),
|
|
3624
|
+
status: z53.literal("processed")
|
|
3625
|
+
});
|
|
3626
|
+
var Minor = z53.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER);
|
|
3627
|
+
var PostPurchaseProductCosts = z53.object({
|
|
3628
|
+
currencyCode: MoneyBag.shape.presentmentMoney.shape.currencyCode,
|
|
3629
|
+
recurringDisplay: z53.object({ shippingMinor: Minor, subtotalMinor: Minor, totalMinor: Minor }).optional(),
|
|
3630
|
+
shippingMinor: Minor,
|
|
3631
|
+
subtotalMinor: Minor,
|
|
3632
|
+
taxesMinor: Minor,
|
|
3633
|
+
totalMinor: Minor
|
|
3634
|
+
});
|
|
3635
|
+
var ChangesetDiscount = z53.object({
|
|
3636
|
+
title: z53.string(),
|
|
3637
|
+
value: z53.number().nonnegative(),
|
|
3638
|
+
valueType: z53.enum(["percentage", "fixed_amount"])
|
|
3639
|
+
}).optional();
|
|
3640
|
+
var PostPurchaseProductChangeset = z53.object({
|
|
3641
|
+
changes: z53.array(
|
|
3642
|
+
z53.union([
|
|
3643
|
+
z53.object({
|
|
3644
|
+
discount: ChangesetDiscount,
|
|
3645
|
+
quantity: z53.number().int().positive(),
|
|
3646
|
+
type: z53.literal("add_variant"),
|
|
3647
|
+
variantId: z53.number().int().positive()
|
|
3648
|
+
}),
|
|
3649
|
+
z53.object({ price: z53.number().nonnegative(), title: z53.string(), type: z53.literal("add_shipping_line") }),
|
|
3650
|
+
PostPurchaseSubscriptionTerms.pick({
|
|
3651
|
+
initialShippingPrice: true,
|
|
3652
|
+
recurringShippingPrice: true,
|
|
3653
|
+
shippingOption: true
|
|
3654
|
+
}).extend({
|
|
3655
|
+
discount: ChangesetDiscount,
|
|
3656
|
+
quantity: z53.number().int().positive(),
|
|
3657
|
+
sellingPlanId: z53.number().int().positive(),
|
|
3658
|
+
type: z53.literal("add_subscription"),
|
|
3659
|
+
variantId: z53.number().int().positive()
|
|
3660
|
+
})
|
|
3661
|
+
])
|
|
3662
|
+
)
|
|
3663
|
+
});
|
|
3664
|
+
|
|
3546
3665
|
// src/schema/postPurchaseProductSettings.ts
|
|
3547
|
-
import { z as
|
|
3548
|
-
var amount =
|
|
3666
|
+
import { z as z54 } from "zod";
|
|
3667
|
+
var amount = z54.union([z54.number().nonnegative(), PostPurchaseAmount.transform(Number)]);
|
|
3549
3668
|
var PostPurchaseProductSettings = PostPurchaseSettings.pick({
|
|
3550
3669
|
discountedFrom: true,
|
|
3551
3670
|
language: true,
|
|
@@ -3557,45 +3676,36 @@ var PostPurchaseProductSettings = PostPurchaseSettings.pick({
|
|
|
3557
3676
|
subscriptionIsDefault: true,
|
|
3558
3677
|
upgradeToSubscription: true
|
|
3559
3678
|
}).extend({
|
|
3560
|
-
advance:
|
|
3561
|
-
blocks:
|
|
3679
|
+
advance: z54.unknown().default({}),
|
|
3680
|
+
blocks: z54.array(z54.unknown()).optional(),
|
|
3562
3681
|
discount: PostPurchaseSettings.shape.discount.extend({ amount: amount.default(30) }),
|
|
3563
|
-
integrations:
|
|
3682
|
+
integrations: z54.unknown().default({}),
|
|
3564
3683
|
shipping: PostPurchaseSettings.shape.shipping.extend({ amount: amount.default(10) }),
|
|
3565
|
-
styles:
|
|
3684
|
+
styles: z54.unknown().default({}),
|
|
3566
3685
|
subImages: PostPurchaseSettings.shape.subImages.catch(null),
|
|
3567
|
-
subscription:
|
|
3686
|
+
subscription: z54.unknown().default(PostPurchaseSettings.shape.subscription.parse(void 0))
|
|
3568
3687
|
});
|
|
3569
3688
|
|
|
3570
|
-
// src/schema/postPurchaseQuantity.ts
|
|
3571
|
-
import { z as z52 } from "zod";
|
|
3572
|
-
var quantity = PreparedPostPurchaseProduct.shape.selection.shape.quantity;
|
|
3573
|
-
var PostPurchaseQuantityPolicy = PostPurchaseSettings.shape.quantityInputs.omit({ defaultQuantity: true }).extend({
|
|
3574
|
-
initialQuantity: quantity,
|
|
3575
|
-
maxValue: quantity,
|
|
3576
|
-
minValue: z52.literal(0).transform(() => 1).or(quantity)
|
|
3577
|
-
}).refine(({ maxValue, minValue }) => minValue <= maxValue, "Quantity bounds are reversed");
|
|
3578
|
-
|
|
3579
3689
|
// src/schema/postPurchaseSelection.ts
|
|
3580
|
-
import { z as
|
|
3690
|
+
import { z as z55 } from "zod";
|
|
3581
3691
|
var SelectionClaimsSchema = DecideRequestSchema.extend({
|
|
3582
3692
|
appId: PostPurchaseAppIdSchema,
|
|
3583
3693
|
entry: DecisionEntrySchema,
|
|
3584
|
-
iss:
|
|
3585
|
-
purpose:
|
|
3694
|
+
iss: z55.literal("rebuy-api"),
|
|
3695
|
+
purpose: z55.literal("post-purchase-selection")
|
|
3586
3696
|
});
|
|
3587
3697
|
var SessionStartRequestSchema = DecideRequestSchema.extend({
|
|
3588
|
-
selectionToken:
|
|
3698
|
+
selectionToken: z55.string().min(1).max(8192).optional()
|
|
3589
3699
|
}).strict();
|
|
3590
3700
|
|
|
3591
3701
|
// src/schema/postPurchaseSession.ts
|
|
3592
|
-
import { z as
|
|
3702
|
+
import { z as z56 } from "zod";
|
|
3593
3703
|
var SessionIdentitySchema = DecideRequestSchema.extend({ appId: PostPurchaseAppIdSchema });
|
|
3594
|
-
var SessionOrderTimingSchema =
|
|
3704
|
+
var SessionOrderTimingSchema = z56.object({
|
|
3595
3705
|
nativeDeadline: PostPurchaseTimestampSchema,
|
|
3596
3706
|
orderCreatedAt: PostPurchaseTimestampSchema,
|
|
3597
3707
|
orderId: PostPurchaseOrderIdSchema,
|
|
3598
|
-
timingSource:
|
|
3708
|
+
timingSource: z56.literal("shopify-order-created-at")
|
|
3599
3709
|
});
|
|
3600
3710
|
var ReadySessionTimingSchema = SessionOrderTimingSchema.extend({
|
|
3601
3711
|
deadline: PostPurchaseTimestampSchema,
|
|
@@ -3612,39 +3722,39 @@ var ReadySessionTimingSchema = SessionOrderTimingSchema.extend({
|
|
|
3612
3722
|
message: "deadline must not exceed nativeDeadline",
|
|
3613
3723
|
path: ["deadline"]
|
|
3614
3724
|
});
|
|
3615
|
-
var SessionStartResponseSchema =
|
|
3616
|
-
data:
|
|
3617
|
-
phase:
|
|
3725
|
+
var SessionStartResponseSchema = z56.object({
|
|
3726
|
+
data: z56.object({
|
|
3727
|
+
phase: z56.literal("render"),
|
|
3618
3728
|
serverNow: PostPurchaseTimestampSchema,
|
|
3619
3729
|
session: ReadySessionTimingSchema,
|
|
3620
|
-
workflowPhase:
|
|
3730
|
+
workflowPhase: z56.literal("start")
|
|
3621
3731
|
}),
|
|
3622
|
-
successful:
|
|
3732
|
+
successful: z56.literal(true)
|
|
3623
3733
|
});
|
|
3624
3734
|
|
|
3625
3735
|
// src/schema/postPurchaseSessionClose.ts
|
|
3626
|
-
import { z as
|
|
3627
|
-
var SessionClosureSchema =
|
|
3736
|
+
import { z as z57 } from "zod";
|
|
3737
|
+
var SessionClosureSchema = z57.object({ closedAt: PostPurchaseTimestampSchema, status: z57.literal("closed") });
|
|
3628
3738
|
var SessionCloseRequestSchema = DecideRequestSchema.strict();
|
|
3629
|
-
var SessionCloseResponseSchema =
|
|
3739
|
+
var SessionCloseResponseSchema = z57.object({ data: SessionClosureSchema, successful: z57.literal(true) });
|
|
3630
3740
|
|
|
3631
3741
|
// src/schema/postPurchaseShadow.ts
|
|
3632
|
-
import { z as
|
|
3633
|
-
var PostPurchaseShadowSelectionSchema =
|
|
3634
|
-
|
|
3635
|
-
|
|
3742
|
+
import { z as z58 } from "zod";
|
|
3743
|
+
var PostPurchaseShadowSelectionSchema = z58.discriminatedUnion("verdict", [
|
|
3744
|
+
z58.object({ entry: DecisionEntrySchema, verdict: z58.literal("render") }),
|
|
3745
|
+
z58.object({ verdict: z58.literal("skip") })
|
|
3636
3746
|
]);
|
|
3637
|
-
var PostPurchaseShadowReportFields =
|
|
3638
|
-
differences:
|
|
3747
|
+
var PostPurchaseShadowReportFields = z58.object({
|
|
3748
|
+
differences: z58.array(z58.enum(["verdict", "entry", "targeting", "incomplete-capture", "unsupported-configuration"])).refine((differences) => new Set(differences).size === differences.length, {
|
|
3639
3749
|
message: "differences must not contain duplicate entries"
|
|
3640
3750
|
}),
|
|
3641
3751
|
legacySelection: PostPurchaseShadowSelectionSchema,
|
|
3642
|
-
phase:
|
|
3643
|
-
sampleId:
|
|
3752
|
+
phase: z58.literal("shouldRender"),
|
|
3753
|
+
sampleId: z58.string(),
|
|
3644
3754
|
serverSelection: PostPurchaseShadowSelectionSchema.optional(),
|
|
3645
|
-
status:
|
|
3646
|
-
targetingFlowIds:
|
|
3647
|
-
workflowPhase:
|
|
3755
|
+
status: z58.enum(["match", "diverged", "incomplete"]),
|
|
3756
|
+
targetingFlowIds: z58.array(z58.number().int().positive()),
|
|
3757
|
+
workflowPhase: z58.literal("decide")
|
|
3648
3758
|
});
|
|
3649
3759
|
var PostPurchaseShadowReportSchema = PostPurchaseShadowReportFields.refine(
|
|
3650
3760
|
(report) => report.status !== "match" || report.differences.length === 0,
|
|
@@ -3658,30 +3768,30 @@ var PostPurchaseShadowReportSchema = PostPurchaseShadowReportFields.refine(
|
|
|
3658
3768
|
});
|
|
3659
3769
|
|
|
3660
3770
|
// src/schema/postPurchaseSkipTrace.ts
|
|
3661
|
-
import { z as
|
|
3771
|
+
import { z as z59 } from "zod";
|
|
3662
3772
|
var POST_PURCHASE_SKIP_LIMIT = 32;
|
|
3663
|
-
var PostPurchaseSkipTraceSchema =
|
|
3664
|
-
|
|
3773
|
+
var PostPurchaseSkipTraceSchema = z59.array(
|
|
3774
|
+
z59.object({
|
|
3665
3775
|
entry: DecisionEntrySchema,
|
|
3666
3776
|
reason: PostPurchaseSkipReasonSchema
|
|
3667
3777
|
})
|
|
3668
3778
|
).max(POST_PURCHASE_SKIP_LIMIT);
|
|
3669
3779
|
|
|
3670
3780
|
// src/schema/postPurchaseSubscriptionDisplay.ts
|
|
3671
|
-
import { z as
|
|
3672
|
-
var
|
|
3673
|
-
var PostPurchaseSubscriptionDisplay =
|
|
3674
|
-
comparisonMinor:
|
|
3675
|
-
currencyCode:
|
|
3676
|
-
priceMinor:
|
|
3677
|
-
savingMinor:
|
|
3678
|
-
savingPercent:
|
|
3781
|
+
import { z as z60 } from "zod";
|
|
3782
|
+
var Minor2 = z60.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER);
|
|
3783
|
+
var PostPurchaseSubscriptionDisplay = z60.object({
|
|
3784
|
+
comparisonMinor: Minor2,
|
|
3785
|
+
currencyCode: z60.string().regex(/^[A-Z]{3}$/),
|
|
3786
|
+
priceMinor: Minor2,
|
|
3787
|
+
savingMinor: Minor2,
|
|
3788
|
+
savingPercent: z60.number().int().min(0).max(100)
|
|
3679
3789
|
});
|
|
3680
3790
|
|
|
3681
3791
|
// src/schema/postPurchaseSubscriptionProduct.ts
|
|
3682
|
-
import { z as
|
|
3792
|
+
import { z as z61 } from "zod";
|
|
3683
3793
|
var PreparedPostPurchaseSubscription = PreparedPostPurchaseProduct.extend({
|
|
3684
|
-
selection: PreparedPostPurchaseProduct.shape.selection.extend({ sellingPlanId:
|
|
3794
|
+
selection: PreparedPostPurchaseProduct.shape.selection.extend({ sellingPlanId: z61.number().int().positive() }),
|
|
3685
3795
|
terms: PreparedPostPurchaseProduct.shape.terms.extend({
|
|
3686
3796
|
subscription: PostPurchaseSubscriptionTerms
|
|
3687
3797
|
}).refine(
|
|
@@ -3694,93 +3804,93 @@ var readPostPurchaseSubscription = (prepared) => {
|
|
|
3694
3804
|
};
|
|
3695
3805
|
|
|
3696
3806
|
// src/schema/postPurchaseVariantDefault.ts
|
|
3697
|
-
import { z as
|
|
3807
|
+
import { z as z62 } from "zod";
|
|
3698
3808
|
var values = PostPurchaseVariantValues.partial().extend({
|
|
3699
3809
|
option1: PostPurchaseVariantValues.shape.option1.nullish()
|
|
3700
3810
|
});
|
|
3701
3811
|
var variant = values.extend({
|
|
3702
3812
|
id: PostPurchaseVariantId,
|
|
3703
|
-
inventoryManagement:
|
|
3704
|
-
inventoryPolicy:
|
|
3705
|
-
inventoryQuantity:
|
|
3813
|
+
inventoryManagement: z62.string().nullable(),
|
|
3814
|
+
inventoryPolicy: z62.string(),
|
|
3815
|
+
inventoryQuantity: z62.number()
|
|
3706
3816
|
});
|
|
3707
|
-
var options =
|
|
3708
|
-
var PostPurchaseVariantDefaultProduct =
|
|
3817
|
+
var options = z62.array(PostPurchaseVariantOption.pick({ name: true, values: true }));
|
|
3818
|
+
var PostPurchaseVariantDefaultProduct = z62.object({
|
|
3709
3819
|
id: PostPurchaseProductId,
|
|
3710
3820
|
options,
|
|
3711
3821
|
selectedVariant: variant.optional(),
|
|
3712
|
-
variants:
|
|
3822
|
+
variants: z62.array(variant)
|
|
3713
3823
|
});
|
|
3714
3824
|
var PostPurchaseVariantDefaultSettings = PostPurchaseSettings.shape.productOptions.pick({
|
|
3715
3825
|
hideOutOfStockVariants: true,
|
|
3716
3826
|
matchVariant: true
|
|
3717
3827
|
});
|
|
3718
|
-
var PostPurchaseOrderAttributes =
|
|
3719
|
-
var PostPurchaseOriginalVariants =
|
|
3720
|
-
|
|
3828
|
+
var PostPurchaseOrderAttributes = z62.record(z62.string(), z62.array(z62.string())).default({});
|
|
3829
|
+
var PostPurchaseOriginalVariants = z62.array(
|
|
3830
|
+
z62.object({ productId: PostPurchaseProductId, variantId: PostPurchaseVariantId })
|
|
3721
3831
|
);
|
|
3722
|
-
var PostPurchaseAttributeProducts =
|
|
3723
|
-
|
|
3832
|
+
var PostPurchaseAttributeProducts = z62.array(
|
|
3833
|
+
z62.object({ id: PostPurchaseProductId, options, variants: z62.array(values.extend({ id: PostPurchaseVariantId })) })
|
|
3724
3834
|
);
|
|
3725
3835
|
|
|
3726
3836
|
// src/schema/postPurchaseVariantDefaultContext.ts
|
|
3727
|
-
import { z as
|
|
3728
|
-
var PostPurchaseVariantDefaultContext =
|
|
3729
|
-
enrichedLineItems:
|
|
3837
|
+
import { z as z63 } from "zod";
|
|
3838
|
+
var PostPurchaseVariantDefaultContext = z63.object({
|
|
3839
|
+
enrichedLineItems: z63.unknown().optional(),
|
|
3730
3840
|
originalVariants: PostPurchaseOriginalVariants
|
|
3731
3841
|
});
|
|
3732
3842
|
|
|
3733
3843
|
// src/schema/shopConfig.ts
|
|
3734
|
-
import { z as
|
|
3735
|
-
var ShopConfig =
|
|
3736
|
-
activeExperiments:
|
|
3737
|
-
|
|
3738
|
-
data:
|
|
3739
|
-
|
|
3740
|
-
aliasName:
|
|
3741
|
-
cssInput:
|
|
3742
|
-
elementId:
|
|
3743
|
-
id:
|
|
3744
|
-
javascriptInput:
|
|
3745
|
-
traffic:
|
|
3844
|
+
import { z as z64 } from "zod";
|
|
3845
|
+
var ShopConfig = z64.object({
|
|
3846
|
+
activeExperiments: z64.array(
|
|
3847
|
+
z64.object({
|
|
3848
|
+
data: z64.array(
|
|
3849
|
+
z64.object({
|
|
3850
|
+
aliasName: z64.string(),
|
|
3851
|
+
cssInput: z64.string().nullish(),
|
|
3852
|
+
elementId: z64.coerce.number(),
|
|
3853
|
+
id: z64.coerce.number(),
|
|
3854
|
+
javascriptInput: z64.string().nullish(),
|
|
3855
|
+
traffic: z64.coerce.number()
|
|
3746
3856
|
})
|
|
3747
3857
|
),
|
|
3748
|
-
id:
|
|
3749
|
-
name:
|
|
3750
|
-
pageTarget:
|
|
3751
|
-
pageTargetUrl:
|
|
3752
|
-
placeholderId:
|
|
3753
|
-
type:
|
|
3858
|
+
id: z64.coerce.number(),
|
|
3859
|
+
name: z64.string(),
|
|
3860
|
+
pageTarget: z64.string().nullable(),
|
|
3861
|
+
pageTargetUrl: z64.string().nullable(),
|
|
3862
|
+
placeholderId: z64.coerce.number().nullable(),
|
|
3863
|
+
type: z64.string()
|
|
3754
3864
|
})
|
|
3755
3865
|
),
|
|
3756
|
-
activePackages:
|
|
3757
|
-
|
|
3758
|
-
cancelledAt:
|
|
3759
|
-
id:
|
|
3760
|
-
installedAt:
|
|
3761
|
-
isActive:
|
|
3762
|
-
isBillable:
|
|
3763
|
-
packageId:
|
|
3764
|
-
packageName:
|
|
3765
|
-
shortName:
|
|
3766
|
-
trialDays:
|
|
3767
|
-
uninstalledAt:
|
|
3866
|
+
activePackages: z64.array(
|
|
3867
|
+
z64.object({
|
|
3868
|
+
cancelledAt: z64.string().nullable(),
|
|
3869
|
+
id: z64.number(),
|
|
3870
|
+
installedAt: z64.string().nullable(),
|
|
3871
|
+
isActive: z64.boolean(),
|
|
3872
|
+
isBillable: z64.boolean(),
|
|
3873
|
+
packageId: z64.number(),
|
|
3874
|
+
packageName: z64.string(),
|
|
3875
|
+
shortName: z64.string(),
|
|
3876
|
+
trialDays: z64.number(),
|
|
3877
|
+
uninstalledAt: z64.string().nullable()
|
|
3768
3878
|
})
|
|
3769
3879
|
),
|
|
3770
|
-
apiKey:
|
|
3771
|
-
billingVersion:
|
|
3772
|
-
cacheKey:
|
|
3773
|
-
carousel:
|
|
3774
|
-
currency:
|
|
3775
|
-
currencySymbol:
|
|
3776
|
-
domain:
|
|
3777
|
-
enabledJquery:
|
|
3778
|
-
enabledPresentmentCurrencies:
|
|
3779
|
-
hasSmartCollectionsEnabled:
|
|
3780
|
-
hasSmartSearchEnabled:
|
|
3781
|
-
id:
|
|
3782
|
-
integrations:
|
|
3783
|
-
|
|
3880
|
+
apiKey: z64.string(),
|
|
3881
|
+
billingVersion: z64.string().nullable(),
|
|
3882
|
+
cacheKey: z64.coerce.number(),
|
|
3883
|
+
carousel: z64.enum(["flickity", "splide"]),
|
|
3884
|
+
currency: z64.string(),
|
|
3885
|
+
currencySymbol: z64.string(),
|
|
3886
|
+
domain: z64.string(),
|
|
3887
|
+
enabledJquery: z64.boolean(),
|
|
3888
|
+
enabledPresentmentCurrencies: z64.array(z64.string()),
|
|
3889
|
+
hasSmartCollectionsEnabled: z64.boolean(),
|
|
3890
|
+
hasSmartSearchEnabled: z64.boolean(),
|
|
3891
|
+
id: z64.coerce.number(),
|
|
3892
|
+
integrations: z64.record(
|
|
3893
|
+
z64.enum([
|
|
3784
3894
|
"attentive",
|
|
3785
3895
|
"judgeme",
|
|
3786
3896
|
"junip",
|
|
@@ -3793,170 +3903,170 @@ var ShopConfig = z62.object({
|
|
|
3793
3903
|
"stamped",
|
|
3794
3904
|
"yotpo"
|
|
3795
3905
|
]),
|
|
3796
|
-
|
|
3906
|
+
z64.union([z64.boolean(), z64.unknown()])
|
|
3797
3907
|
),
|
|
3798
|
-
markets:
|
|
3799
|
-
enabled:
|
|
3908
|
+
markets: z64.object({
|
|
3909
|
+
enabled: z64.boolean()
|
|
3800
3910
|
}),
|
|
3801
|
-
monetize:
|
|
3802
|
-
publisherKey:
|
|
3911
|
+
monetize: z64.object({
|
|
3912
|
+
publisherKey: z64.string().nullable()
|
|
3803
3913
|
}).nullish(),
|
|
3804
|
-
moneyFormat:
|
|
3805
|
-
myshopifyDomain:
|
|
3806
|
-
primaryLocale:
|
|
3807
|
-
productGroupsEnabled:
|
|
3808
|
-
rechargeCustomDomain:
|
|
3809
|
-
sellingPlansEnabled:
|
|
3810
|
-
shopId:
|
|
3811
|
-
shopifySellingPlansEnabled:
|
|
3812
|
-
shopName:
|
|
3813
|
-
storefrontAccessToken:
|
|
3814
|
-
useRebuyIcons:
|
|
3914
|
+
moneyFormat: z64.string(),
|
|
3915
|
+
myshopifyDomain: z64.string(),
|
|
3916
|
+
primaryLocale: z64.string(),
|
|
3917
|
+
productGroupsEnabled: z64.enum(["no", "yes"]).transform((value) => value === "yes"),
|
|
3918
|
+
rechargeCustomDomain: z64.string().nullable(),
|
|
3919
|
+
sellingPlansEnabled: z64.boolean(),
|
|
3920
|
+
shopId: z64.number(),
|
|
3921
|
+
shopifySellingPlansEnabled: z64.boolean(),
|
|
3922
|
+
shopName: z64.string(),
|
|
3923
|
+
storefrontAccessToken: z64.string().nullable(),
|
|
3924
|
+
useRebuyIcons: z64.boolean()
|
|
3815
3925
|
});
|
|
3816
3926
|
|
|
3817
3927
|
// src/schema/userConfig.ts
|
|
3818
|
-
import { z as
|
|
3819
|
-
var UserConfig =
|
|
3928
|
+
import { z as z65 } from "zod";
|
|
3929
|
+
var UserConfig = z65.object({
|
|
3820
3930
|
shop: ShopConfig,
|
|
3821
3931
|
/**
|
|
3822
3932
|
* `.catch(undefined)` is the safety bar: smart-cart shape drift can NEVER fail `fetchUserConfig`,
|
|
3823
3933
|
* which resolves the apiKey for every offers/monetize/analytics/gift request.
|
|
3824
3934
|
*/
|
|
3825
3935
|
smartCart: SmartCartConfig.nullish().catch(void 0),
|
|
3826
|
-
smartFlows:
|
|
3936
|
+
smartFlows: z65.array(z65.unknown())
|
|
3827
3937
|
});
|
|
3828
3938
|
|
|
3829
3939
|
// src/schema/widgetData.ts
|
|
3830
|
-
import { z as
|
|
3940
|
+
import { z as z74 } from "zod";
|
|
3831
3941
|
|
|
3832
3942
|
// src/schema/widgets/abTestingPlaceholder.ts
|
|
3833
|
-
import { z as
|
|
3834
|
-
var ABTestingPlaceholder =
|
|
3835
|
-
type:
|
|
3943
|
+
import { z as z66 } from "zod";
|
|
3944
|
+
var ABTestingPlaceholder = z66.looseObject({
|
|
3945
|
+
type: z66.literal("placeholder")
|
|
3836
3946
|
});
|
|
3837
3947
|
|
|
3838
3948
|
// src/schema/widgets/checkoutExtension.ts
|
|
3839
|
-
import { z as
|
|
3840
|
-
var CheckoutExtension =
|
|
3841
|
-
type:
|
|
3949
|
+
import { z as z67 } from "zod";
|
|
3950
|
+
var CheckoutExtension = z67.looseObject({
|
|
3951
|
+
type: z67.literal(WidgetType.shopify_checkout_extension).default(WidgetType.shopify_checkout_extension)
|
|
3842
3952
|
});
|
|
3843
3953
|
|
|
3844
3954
|
// src/schema/widgets/contentBlock.ts
|
|
3845
|
-
import { z as
|
|
3846
|
-
var ContentBlockV1 =
|
|
3847
|
-
blockSpacing:
|
|
3848
|
-
imageBlocks:
|
|
3849
|
-
|
|
3850
|
-
|
|
3851
|
-
altText:
|
|
3852
|
-
description:
|
|
3853
|
-
id:
|
|
3854
|
-
imagePlacement:
|
|
3855
|
-
imageSize:
|
|
3856
|
-
imageUrl:
|
|
3857
|
-
textAlignment:
|
|
3955
|
+
import { z as z68 } from "zod";
|
|
3956
|
+
var ContentBlockV1 = z68.object({
|
|
3957
|
+
blockSpacing: z68.enum(spacings).optional(),
|
|
3958
|
+
imageBlocks: z68.union([
|
|
3959
|
+
z68.array(
|
|
3960
|
+
z68.object({
|
|
3961
|
+
altText: z68.string().nullable(),
|
|
3962
|
+
description: z68.string().nullable(),
|
|
3963
|
+
id: z68.uuid(),
|
|
3964
|
+
imagePlacement: z68.enum(["top", "right", "bottom", "left"]),
|
|
3965
|
+
imageSize: z68.number(),
|
|
3966
|
+
imageUrl: z68.url(),
|
|
3967
|
+
textAlignment: z68.enum(["left", "center", "right"]),
|
|
3858
3968
|
/** Inline scale only: an image caption can never be a block-level heading. */
|
|
3859
|
-
textSize:
|
|
3969
|
+
textSize: z68.enum(inlineTextSizeNames)
|
|
3860
3970
|
})
|
|
3861
3971
|
),
|
|
3862
|
-
|
|
3972
|
+
z68.strictObject({}).transform(() => [])
|
|
3863
3973
|
]).optional(),
|
|
3864
|
-
imageLayout:
|
|
3865
|
-
language:
|
|
3866
|
-
description:
|
|
3867
|
-
superTitle:
|
|
3868
|
-
title:
|
|
3974
|
+
imageLayout: z68.enum(["row", "column"]).optional(),
|
|
3975
|
+
language: z68.object({
|
|
3976
|
+
description: z68.string(),
|
|
3977
|
+
superTitle: z68.string(),
|
|
3978
|
+
title: z68.string()
|
|
3869
3979
|
}),
|
|
3870
|
-
previewMode:
|
|
3871
|
-
type:
|
|
3872
|
-
version:
|
|
3980
|
+
previewMode: z68.boolean(),
|
|
3981
|
+
type: z68.literal(WidgetType.ui_extension_content_block).default(WidgetType.ui_extension_content_block),
|
|
3982
|
+
version: z68.literal(1)
|
|
3873
3983
|
});
|
|
3874
|
-
var ContentBlock =
|
|
3984
|
+
var ContentBlock = z68.discriminatedUnion("version", [
|
|
3875
3985
|
ContentBlockV1,
|
|
3876
3986
|
CABRootSection.extend({
|
|
3877
|
-
type:
|
|
3987
|
+
type: z68.literal(WidgetType.ui_extension_content_block).default(WidgetType.ui_extension_content_block)
|
|
3878
3988
|
})
|
|
3879
3989
|
]);
|
|
3880
3990
|
|
|
3881
3991
|
// src/schema/widgets/giftWithPurchase.ts
|
|
3882
|
-
import { z as
|
|
3883
|
-
var GiftWithPurchase =
|
|
3884
|
-
type:
|
|
3992
|
+
import { z as z69 } from "zod";
|
|
3993
|
+
var GiftWithPurchase = z69.looseObject({
|
|
3994
|
+
type: z69.literal(WidgetType.gift_with_purchase).default(WidgetType.gift_with_purchase)
|
|
3885
3995
|
});
|
|
3886
3996
|
|
|
3887
3997
|
// src/schema/widgets/lineItemEditor.ts
|
|
3888
|
-
import { z as
|
|
3889
|
-
var LineItemEditorSwitchLanguageV1 =
|
|
3890
|
-
downgradeToOneTimeLabel:
|
|
3998
|
+
import { z as z70 } from "zod";
|
|
3999
|
+
var LineItemEditorSwitchLanguageV1 = z70.object({
|
|
4000
|
+
downgradeToOneTimeLabel: z70.string().optional(),
|
|
3891
4001
|
/** Frequency-option template (`{{frequency}}`/`{{interval}}`) for the plan select. */
|
|
3892
|
-
subscriptionOptionLabel:
|
|
3893
|
-
upgradeToSubscriptionLabel:
|
|
3894
|
-
upgradeToSubscriptionWithoutDiscountLabel:
|
|
4002
|
+
subscriptionOptionLabel: z70.string().optional(),
|
|
4003
|
+
upgradeToSubscriptionLabel: z70.string().optional(),
|
|
4004
|
+
upgradeToSubscriptionWithoutDiscountLabel: z70.string().optional()
|
|
3895
4005
|
});
|
|
3896
|
-
var LineItemEditorV1 =
|
|
4006
|
+
var LineItemEditorV1 = z70.object({
|
|
3897
4007
|
/** Legacy `getStyles` button style; the converter carries a valid kind, defaulting to `plain`. */
|
|
3898
|
-
button:
|
|
3899
|
-
previewMode:
|
|
3900
|
-
switchToSubscription:
|
|
3901
|
-
disableDowngrade:
|
|
4008
|
+
button: z70.object({ kind: z70.enum(["plain", "primary", "secondary"]).optional() }).optional(),
|
|
4009
|
+
previewMode: z70.boolean().optional(),
|
|
4010
|
+
switchToSubscription: z70.object({
|
|
4011
|
+
disableDowngrade: z70.boolean().optional(),
|
|
3902
4012
|
language: LineItemEditorSwitchLanguageV1.optional()
|
|
3903
4013
|
}).optional(),
|
|
3904
|
-
switchToSubscriptionEnabled:
|
|
3905
|
-
tracking:
|
|
3906
|
-
enableAttribution:
|
|
3907
|
-
enableSource:
|
|
3908
|
-
enableWidget:
|
|
4014
|
+
switchToSubscriptionEnabled: z70.boolean().optional(),
|
|
4015
|
+
tracking: z70.object({
|
|
4016
|
+
enableAttribution: z70.boolean().optional(),
|
|
4017
|
+
enableSource: z70.boolean().optional(),
|
|
4018
|
+
enableWidget: z70.boolean().optional()
|
|
3909
4019
|
}).optional(),
|
|
3910
|
-
type:
|
|
3911
|
-
version:
|
|
4020
|
+
type: z70.literal(WidgetType.ui_extension_line_item_editor).default(WidgetType.ui_extension_line_item_editor),
|
|
4021
|
+
version: z70.literal(1)
|
|
3912
4022
|
});
|
|
3913
|
-
var LineItemEditor =
|
|
4023
|
+
var LineItemEditor = z70.discriminatedUnion("version", [
|
|
3914
4024
|
LineItemEditorV1,
|
|
3915
4025
|
CABRootSection.extend({
|
|
3916
|
-
type:
|
|
4026
|
+
type: z70.literal(WidgetType.ui_extension_line_item_editor).default(WidgetType.ui_extension_line_item_editor)
|
|
3917
4027
|
})
|
|
3918
4028
|
]);
|
|
3919
4029
|
|
|
3920
4030
|
// src/schema/widgets/progressBar.ts
|
|
3921
|
-
import { z as
|
|
3922
|
-
var ProgressBar =
|
|
3923
|
-
type:
|
|
4031
|
+
import { z as z71 } from "zod";
|
|
4032
|
+
var ProgressBar = z71.looseObject({
|
|
4033
|
+
type: z71.literal(WidgetType.ui_extension_progress_bar).default(WidgetType.ui_extension_progress_bar)
|
|
3924
4034
|
});
|
|
3925
4035
|
|
|
3926
4036
|
// src/schema/widgets/rebuyButton.ts
|
|
3927
|
-
import { z as
|
|
3928
|
-
var RebuyButtonV1 =
|
|
3929
|
-
type:
|
|
3930
|
-
version:
|
|
4037
|
+
import { z as z72 } from "zod";
|
|
4038
|
+
var RebuyButtonV1 = z72.looseObject({
|
|
4039
|
+
type: z72.literal(WidgetType.ui_extension_button).default(WidgetType.ui_extension_button),
|
|
4040
|
+
version: z72.literal(1)
|
|
3931
4041
|
});
|
|
3932
|
-
var RebuyButton =
|
|
4042
|
+
var RebuyButton = z72.discriminatedUnion("version", [
|
|
3933
4043
|
RebuyButtonV1,
|
|
3934
4044
|
CABRootSection.extend({
|
|
3935
|
-
type:
|
|
4045
|
+
type: z72.literal(WidgetType.ui_extension_button).default(WidgetType.ui_extension_button)
|
|
3936
4046
|
})
|
|
3937
4047
|
]);
|
|
3938
4048
|
|
|
3939
4049
|
// src/schema/widgets/rebuyMonetize.ts
|
|
3940
|
-
import { z as
|
|
3941
|
-
var RebuyMonetize =
|
|
3942
|
-
type:
|
|
4050
|
+
import { z as z73 } from "zod";
|
|
4051
|
+
var RebuyMonetize = z73.looseObject({
|
|
4052
|
+
type: z73.literal(WidgetType.ui_extension_ad).default(WidgetType.ui_extension_ad)
|
|
3943
4053
|
});
|
|
3944
|
-
var RebuyMonetizeV1 =
|
|
3945
|
-
name:
|
|
3946
|
-
previewMode:
|
|
4054
|
+
var RebuyMonetizeV1 = z73.object({
|
|
4055
|
+
name: z73.string().nullable().optional(),
|
|
4056
|
+
previewMode: z73.boolean().optional(),
|
|
3947
4057
|
/** Privacy Policy footer href → the marker section's `privacyPolicyUrl`. */
|
|
3948
|
-
privacyPolicyUrl:
|
|
4058
|
+
privacyPolicyUrl: z73.string().nullable().optional(),
|
|
3949
4059
|
/** Ads-taxonomy sub-vertical id — one of the admin Monetize editor's two configurables. */
|
|
3950
|
-
subVertical:
|
|
3951
|
-
tracking:
|
|
3952
|
-
enableAttribution:
|
|
3953
|
-
enableSource:
|
|
3954
|
-
enableWidget:
|
|
4060
|
+
subVertical: z73.string().nullable().optional(),
|
|
4061
|
+
tracking: z73.object({
|
|
4062
|
+
enableAttribution: z73.boolean().optional(),
|
|
4063
|
+
enableSource: z73.boolean().optional(),
|
|
4064
|
+
enableWidget: z73.boolean().optional()
|
|
3955
4065
|
}).optional(),
|
|
3956
|
-
type:
|
|
3957
|
-
version:
|
|
4066
|
+
type: z73.literal(WidgetType.ui_extension_ad).default(WidgetType.ui_extension_ad),
|
|
4067
|
+
version: z73.literal(1),
|
|
3958
4068
|
/** Ads-taxonomy vertical id — one of the admin Monetize editor's two configurables. */
|
|
3959
|
-
vertical:
|
|
4069
|
+
vertical: z73.string().nullable().optional()
|
|
3960
4070
|
});
|
|
3961
4071
|
|
|
3962
4072
|
// src/schema/widgetData.ts
|
|
@@ -3970,7 +4080,7 @@ var extensionWidgetTypes = [
|
|
|
3970
4080
|
WidgetType.ui_extension_line_item_editor,
|
|
3971
4081
|
WidgetType.ui_extension_progress_bar
|
|
3972
4082
|
];
|
|
3973
|
-
var WidgetData =
|
|
4083
|
+
var WidgetData = z74.discriminatedUnion("type", [
|
|
3974
4084
|
ABTestingPlaceholder,
|
|
3975
4085
|
CheckoutExtension,
|
|
3976
4086
|
ContentBlock,
|
|
@@ -4330,36 +4440,36 @@ var SWITCH_LABELS = {
|
|
|
4330
4440
|
};
|
|
4331
4441
|
|
|
4332
4442
|
// src/schema/widgets/post-purchase-offer/postPurchaseOffer.ts
|
|
4333
|
-
import { z as
|
|
4443
|
+
import { z as z76 } from "zod";
|
|
4334
4444
|
|
|
4335
4445
|
// src/schema/widgets/post-purchase-offer/postPurchaseWidget.ts
|
|
4336
|
-
import { z as
|
|
4337
|
-
var PostPurchaseWidgetLinkedFlow =
|
|
4338
|
-
id:
|
|
4339
|
-
name:
|
|
4340
|
-
});
|
|
4341
|
-
var PostPurchaseWidget =
|
|
4342
|
-
classification:
|
|
4343
|
-
createdAtTime:
|
|
4344
|
-
customEndpointName:
|
|
4345
|
-
id:
|
|
4346
|
-
lastViewed:
|
|
4347
|
-
linkedCustomEndpointId:
|
|
4348
|
-
linkedFlows:
|
|
4349
|
-
name:
|
|
4350
|
-
owner:
|
|
4446
|
+
import { z as z75 } from "zod";
|
|
4447
|
+
var PostPurchaseWidgetLinkedFlow = z75.object({
|
|
4448
|
+
id: z75.number(),
|
|
4449
|
+
name: z75.string()
|
|
4450
|
+
});
|
|
4451
|
+
var PostPurchaseWidget = z75.object({
|
|
4452
|
+
classification: z75.literal("post_purchase_offer_page").default("post_purchase_offer_page"),
|
|
4453
|
+
createdAtTime: z75.iso.datetime({ offset: true }).optional(),
|
|
4454
|
+
customEndpointName: z75.string().nullish(),
|
|
4455
|
+
id: z75.number().default(0),
|
|
4456
|
+
lastViewed: z75.iso.datetime({ offset: true }).nullish(),
|
|
4457
|
+
linkedCustomEndpointId: z75.number().nullish(),
|
|
4458
|
+
linkedFlows: z75.array(PostPurchaseWidgetLinkedFlow).optional(),
|
|
4459
|
+
name: z75.string().default(""),
|
|
4460
|
+
owner: z75.number().nullish(),
|
|
4351
4461
|
settings: PostPurchaseSettings
|
|
4352
4462
|
});
|
|
4353
4463
|
|
|
4354
4464
|
// src/schema/widgets/post-purchase-offer/postPurchaseOffer.ts
|
|
4355
|
-
var PostPurchaseOffer =
|
|
4356
|
-
|
|
4357
|
-
errors:
|
|
4358
|
-
message:
|
|
4359
|
-
successful:
|
|
4465
|
+
var PostPurchaseOffer = z76.discriminatedUnion("successful", [
|
|
4466
|
+
z76.strictObject({
|
|
4467
|
+
errors: z76.array(z76.object({ message: z76.string() })),
|
|
4468
|
+
message: z76.string(),
|
|
4469
|
+
successful: z76.literal(false)
|
|
4360
4470
|
}),
|
|
4361
|
-
|
|
4362
|
-
successful:
|
|
4471
|
+
z76.strictObject({
|
|
4472
|
+
successful: z76.literal(true),
|
|
4363
4473
|
widget: PostPurchaseWidget
|
|
4364
4474
|
})
|
|
4365
4475
|
]);
|
|
@@ -5614,9 +5724,11 @@ export {
|
|
|
5614
5724
|
PostPurchaseAttributeProducts,
|
|
5615
5725
|
PostPurchaseBlock,
|
|
5616
5726
|
PostPurchaseChoice,
|
|
5727
|
+
PostPurchaseCollectionChoice,
|
|
5617
5728
|
PostPurchaseDiscount,
|
|
5618
5729
|
PostPurchaseExcludedProductIds,
|
|
5619
5730
|
PostPurchaseGroupCatalog,
|
|
5731
|
+
PostPurchaseGroupChoice,
|
|
5620
5732
|
PostPurchaseGroupDescription,
|
|
5621
5733
|
PostPurchaseGroupSelection,
|
|
5622
5734
|
PostPurchaseOffer,
|
|
@@ -5633,11 +5745,17 @@ export {
|
|
|
5633
5745
|
PostPurchasePlanOption,
|
|
5634
5746
|
PostPurchasePreparation,
|
|
5635
5747
|
PostPurchasePrimaryImageSource,
|
|
5748
|
+
PostPurchaseProductCalculation,
|
|
5749
|
+
PostPurchaseProductChangeset,
|
|
5750
|
+
PostPurchaseProductCollectionView,
|
|
5751
|
+
PostPurchaseProductCosts,
|
|
5636
5752
|
PostPurchaseProductDisplay,
|
|
5637
5753
|
PostPurchaseProductGallery,
|
|
5638
5754
|
PostPurchaseProductId,
|
|
5639
5755
|
PostPurchaseProductSettings,
|
|
5640
5756
|
PostPurchaseProductSource,
|
|
5757
|
+
PostPurchaseProductView,
|
|
5758
|
+
PostPurchaseQuantityChoice,
|
|
5641
5759
|
PostPurchaseQuantityPolicy,
|
|
5642
5760
|
PostPurchaseSettings,
|
|
5643
5761
|
PostPurchaseShadowReportFields,
|