@rebuy/rebuy 3.41.0 → 3.42.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 +698 -632
- package/dist/index.mjs +698 -632
- package/dist/schema/index.d.ts +1 -0
- package/dist/schema/postPurchaseAdmission.d.ts +33 -0
- package/dist/schema/postPurchaseFollowups.d.ts +47 -0
- package/dist/schema/postPurchaseProductCollectionView.d.ts +38 -0
- package/dist/schema/postPurchaseProductView.d.ts +40 -0
- package/dist/schema/postPurchaseRecovery.d.ts +47 -0
- package/dist/schema/postPurchaseUpgrade.d.ts +117 -0
- package/dist/server/index.cjs +133 -120
- package/dist/server/index.mjs +133 -120
- package/dist/server/preparePostPurchaseAdmissionView.d.ts +32 -0
- package/dist/server/preparePostPurchaseCollectionGroup.d.ts +32 -0
- package/dist/server/preparePostPurchaseCollectionView.d.ts +32 -0
- package/dist/server/preparePostPurchaseGroupAdmissionView.d.ts +32 -0
- package/dist/server/preparePostPurchaseGroupDefault.d.ts +32 -0
- package/dist/server/preparePostPurchaseGroupView.d.ts +32 -0
- package/dist/server/preparePostPurchaseMemberView.d.ts +96 -0
- package/dist/server/preparePostPurchaseQuantityAdmissionView.d.ts +32 -0
- package/dist/server/preparePostPurchaseQuantityView.d.ts +32 -0
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -2427,6 +2427,8 @@ var PostPurchaseProductChangeset = z23.object({
|
|
|
2427
2427
|
});
|
|
2428
2428
|
|
|
2429
2429
|
// src/schema/postPurchaseAdmission.ts
|
|
2430
|
+
var PurchaseAdmissionModeSchema = z24.enum(["purchase", "upgrade"]);
|
|
2431
|
+
var selection = PreparedPostPurchaseProduct.shape.selection;
|
|
2430
2432
|
var PurchaseExpectedSchema = z24.object({
|
|
2431
2433
|
buyerConsentToSubscriptions: z24.boolean().optional(),
|
|
2432
2434
|
changeset: PostPurchaseProductChangeset.extend({
|
|
@@ -2434,16 +2436,20 @@ var PurchaseExpectedSchema = z24.object({
|
|
|
2434
2436
|
}),
|
|
2435
2437
|
entry: DecisionEntrySchema,
|
|
2436
2438
|
member: PostPurchaseMemberIdentity.optional(),
|
|
2439
|
+
mode: PurchaseAdmissionModeSchema.optional(),
|
|
2437
2440
|
progressRevision: z24.number().int().nonnegative().optional(),
|
|
2438
|
-
selection
|
|
2441
|
+
selection
|
|
2439
2442
|
}).refine(
|
|
2440
2443
|
({ member, progressRevision }) => !member || progressRevision !== void 0,
|
|
2441
2444
|
"Captured member requires progress"
|
|
2442
|
-
).refine(
|
|
2445
|
+
).refine(
|
|
2446
|
+
({ mode, selection: { sellingPlanId } }) => mode !== "upgrade" || sellingPlanId !== void 0,
|
|
2447
|
+
"An upgrade selects a subscription"
|
|
2448
|
+
).refine(({ buyerConsentToSubscriptions: consent, changeset, selection: selection3 }) => {
|
|
2443
2449
|
const [change, shipping] = changeset.changes;
|
|
2444
|
-
if (
|
|
2445
|
-
return consent !== true && change?.type === "add_variant" && change.variantId ===
|
|
2446
|
-
return consent === true && changeset.changes.length === 1 && change.type === "add_subscription" && change.sellingPlanId ===
|
|
2450
|
+
if (selection3.sellingPlanId === void 0)
|
|
2451
|
+
return consent !== true && change?.type === "add_variant" && change.variantId === selection3.variantId && change.quantity === selection3.quantity && (shipping === void 0 || shipping.type === "add_shipping_line");
|
|
2452
|
+
return consent === true && changeset.changes.length === 1 && change.type === "add_subscription" && change.sellingPlanId === selection3.sellingPlanId && change.variantId === selection3.variantId && change.quantity === selection3.quantity;
|
|
2447
2453
|
}, "Selection, change and buyer consent must agree");
|
|
2448
2454
|
var PurchaseRequestSchema = DecideRequestSchema.extend({
|
|
2449
2455
|
expected: PurchaseExpectedSchema,
|
|
@@ -2452,12 +2458,18 @@ var PurchaseRequestSchema = DecideRequestSchema.extend({
|
|
|
2452
2458
|
var PurchaseReceiptSchema = z24.object({
|
|
2453
2459
|
admittedAt: PostPurchaseTimestampSchema,
|
|
2454
2460
|
changesetToken: z24.string().min(1),
|
|
2461
|
+
mode: PurchaseAdmissionModeSchema.optional(),
|
|
2455
2462
|
operationId: z24.uuid(),
|
|
2463
|
+
/** The server-bound one-time line an upgrade refunds; its quantity is the order's, not the selection's. */
|
|
2464
|
+
originalLine: z24.strictObject({ quantity: selection.shape.quantity, variantId: selection.shape.variantId }).optional(),
|
|
2456
2465
|
requiresSubscriptionConsent: z24.boolean(),
|
|
2457
|
-
selection
|
|
2466
|
+
selection
|
|
2458
2467
|
}).refine(
|
|
2459
|
-
({ requiresSubscriptionConsent, selection:
|
|
2468
|
+
({ requiresSubscriptionConsent, selection: selection3 }) => requiresSubscriptionConsent === (selection3.sellingPlanId !== void 0),
|
|
2460
2469
|
"Receipt consent must match its selected plan"
|
|
2470
|
+
).refine(
|
|
2471
|
+
({ mode, originalLine, selection: { sellingPlanId, variantId } }) => mode === "upgrade" ? sellingPlanId !== void 0 && originalLine?.variantId === variantId : originalLine === void 0,
|
|
2472
|
+
"An upgrade Receipt binds the original line of its subscribed variant, and only an upgrade does"
|
|
2461
2473
|
);
|
|
2462
2474
|
var PurchaseResponseSchema = z24.object({ data: PurchaseReceiptSchema, successful: z24.literal(true) });
|
|
2463
2475
|
|
|
@@ -2652,10 +2664,10 @@ var ExitPolicySchema = z36.discriminatedUnion("status", [
|
|
|
2652
2664
|
]);
|
|
2653
2665
|
|
|
2654
2666
|
// src/schema/postPurchaseFinish.ts
|
|
2655
|
-
import { z as
|
|
2667
|
+
import { z as z43 } from "zod";
|
|
2656
2668
|
|
|
2657
2669
|
// src/schema/postPurchaseFollowups.ts
|
|
2658
|
-
import { z as
|
|
2670
|
+
import { z as z41 } from "zod";
|
|
2659
2671
|
|
|
2660
2672
|
// src/schema/postPurchaseHealthProgress.ts
|
|
2661
2673
|
import { z as z38 } from "zod";
|
|
@@ -2747,63 +2759,106 @@ var PurchaseObservationResponseSchema = z39.object({
|
|
|
2747
2759
|
successful: z39.literal(true)
|
|
2748
2760
|
});
|
|
2749
2761
|
|
|
2762
|
+
// src/schema/postPurchaseUpgrade.ts
|
|
2763
|
+
import { z as z40 } from "zod";
|
|
2764
|
+
var AttemptSchema2 = z40.strictObject({ attemptedAt: PostPurchaseTimestampSchema, status: z40.literal("attempted") });
|
|
2765
|
+
var FinishedSchema = AttemptSchema2.extend({ finishedAt: PostPurchaseTimestampSchema });
|
|
2766
|
+
var UpgradeRefundProgressSchema = z40.union([
|
|
2767
|
+
AttemptSchema2,
|
|
2768
|
+
FinishedSchema.extend({ refundId: z40.string().min(1), status: z40.literal("refunded") }),
|
|
2769
|
+
FinishedSchema.extend({ status: z40.enum(["failed", "unknown"]) })
|
|
2770
|
+
]);
|
|
2771
|
+
var UpgradeCompensationProgressSchema = z40.union([
|
|
2772
|
+
AttemptSchema2,
|
|
2773
|
+
FinishedSchema.extend({ status: z40.enum(["removed", "failed", "unknown"]) })
|
|
2774
|
+
]);
|
|
2775
|
+
var UpgradeReviewReasonSchema = z40.enum(["refund-unknown", "compensation-failed", "compensation-unknown"]);
|
|
2776
|
+
var UpgradeReviewProgressSchema = z40.strictObject({
|
|
2777
|
+
markedAt: PostPurchaseTimestampSchema,
|
|
2778
|
+
marker: AcceptedMetafieldResultSchema.shape.status,
|
|
2779
|
+
reason: UpgradeReviewReasonSchema
|
|
2780
|
+
});
|
|
2781
|
+
var reviewReason = (refund, compensation) => {
|
|
2782
|
+
if (refund?.status === "unknown") return "refund-unknown";
|
|
2783
|
+
if (compensation?.status === "failed" || compensation?.status === "unknown")
|
|
2784
|
+
return `compensation-${compensation.status}`;
|
|
2785
|
+
return null;
|
|
2786
|
+
};
|
|
2787
|
+
var UpgradeProgressSchema = z40.strictObject({
|
|
2788
|
+
compensation: UpgradeCompensationProgressSchema.nullable(),
|
|
2789
|
+
operationId: PurchaseReceiptSchema.shape.operationId,
|
|
2790
|
+
refund: UpgradeRefundProgressSchema.nullable(),
|
|
2791
|
+
review: UpgradeReviewProgressSchema.nullable()
|
|
2792
|
+
}).refine(
|
|
2793
|
+
({ compensation, refund }) => compensation === null || refund?.status === "failed",
|
|
2794
|
+
"Compensation follows a known refund failure only"
|
|
2795
|
+
).refine(
|
|
2796
|
+
({ compensation, refund, review }) => (review?.reason ?? null) === reviewReason(refund, compensation),
|
|
2797
|
+
"Review must match the unresolved outcome"
|
|
2798
|
+
);
|
|
2799
|
+
|
|
2750
2800
|
// src/schema/postPurchaseFollowups.ts
|
|
2751
|
-
var RequiredHealthSchema =
|
|
2801
|
+
var RequiredHealthSchema = z41.union([
|
|
2752
2802
|
HealthSchedulingResponseSchema.shape.data,
|
|
2753
|
-
|
|
2803
|
+
z41.strictObject({ status: z41.literal("unavailable") })
|
|
2754
2804
|
]);
|
|
2755
|
-
var AcceptedFollowupsResponseSchema =
|
|
2756
|
-
data:
|
|
2757
|
-
acceptedEvent:
|
|
2805
|
+
var AcceptedFollowupsResponseSchema = z41.object({
|
|
2806
|
+
data: z41.object({
|
|
2807
|
+
acceptedEvent: z41.union([
|
|
2758
2808
|
AcceptedEventResponseSchema.shape.data,
|
|
2759
|
-
|
|
2809
|
+
z41.strictObject({ status: z41.literal("unavailable") })
|
|
2760
2810
|
]),
|
|
2761
2811
|
acceptedMetafield: AcceptedMetafieldResultSchema,
|
|
2762
2812
|
health: RequiredHealthSchema,
|
|
2763
|
-
purchase: PurchaseObservationResponseSchema.shape.data
|
|
2813
|
+
purchase: PurchaseObservationResponseSchema.shape.data,
|
|
2814
|
+
/** Present only for an upgrade admission, and always for the same operation as `purchase`. */
|
|
2815
|
+
upgrade: UpgradeProgressSchema.optional()
|
|
2816
|
+
}).refine(({ purchase, upgrade }) => !upgrade || upgrade.operationId === purchase.operationId, {
|
|
2817
|
+
message: "Upgrade progress belongs to its operation",
|
|
2818
|
+
path: ["upgrade", "operationId"]
|
|
2764
2819
|
}),
|
|
2765
|
-
successful:
|
|
2820
|
+
successful: z41.literal(true)
|
|
2766
2821
|
});
|
|
2767
2822
|
|
|
2768
2823
|
// src/schema/postPurchaseSessionClose.ts
|
|
2769
|
-
import { z as
|
|
2770
|
-
var SessionClosureSchema =
|
|
2824
|
+
import { z as z42 } from "zod";
|
|
2825
|
+
var SessionClosureSchema = z42.object({ closedAt: PostPurchaseTimestampSchema, status: z42.literal("closed") });
|
|
2771
2826
|
var SessionCloseRequestSchema = DecideRequestSchema.strict();
|
|
2772
|
-
var SessionCloseResponseSchema =
|
|
2827
|
+
var SessionCloseResponseSchema = z42.object({ data: SessionClosureSchema, successful: z42.literal(true) });
|
|
2773
2828
|
|
|
2774
2829
|
// src/schema/postPurchaseFinish.ts
|
|
2775
|
-
var FinishedPurchaseSchema =
|
|
2776
|
-
|
|
2777
|
-
|
|
2830
|
+
var FinishedPurchaseSchema = z43.union([
|
|
2831
|
+
z43.strictObject({ status: z43.literal("none") }),
|
|
2832
|
+
z43.strictObject({
|
|
2778
2833
|
operationId: PurchaseReceiptSchema.shape.operationId,
|
|
2779
|
-
status:
|
|
2780
|
-
|
|
2834
|
+
status: z43.union([
|
|
2835
|
+
z43.literal("pending"),
|
|
2781
2836
|
...PurchaseObservationSchema.options.map((option) => option.shape.status)
|
|
2782
2837
|
])
|
|
2783
2838
|
})
|
|
2784
2839
|
]);
|
|
2785
2840
|
var SessionFinishRequestSchema = DecideRequestSchema.strict();
|
|
2786
|
-
var SessionFinishResponseSchema =
|
|
2841
|
+
var SessionFinishResponseSchema = z43.object({
|
|
2787
2842
|
data: SessionClosureSchema.extend({
|
|
2788
2843
|
classification: ClassificationProgressSchema,
|
|
2789
2844
|
exitPolicy: ExitPolicySchema,
|
|
2790
2845
|
health: RequiredHealthSchema.nullable(),
|
|
2791
2846
|
purchase: FinishedPurchaseSchema
|
|
2792
2847
|
}),
|
|
2793
|
-
successful:
|
|
2848
|
+
successful: z43.literal(true)
|
|
2794
2849
|
});
|
|
2795
2850
|
|
|
2796
2851
|
// src/schema/postPurchaseQuantity.ts
|
|
2797
|
-
import { z as
|
|
2852
|
+
import { z as z66 } from "zod";
|
|
2798
2853
|
|
|
2799
2854
|
// src/schema/postPurchaseProductCollectionView.ts
|
|
2800
|
-
import { z as
|
|
2855
|
+
import { z as z65 } from "zod";
|
|
2801
2856
|
|
|
2802
2857
|
// src/schema/postPurchaseProductView.ts
|
|
2803
|
-
import { z as
|
|
2858
|
+
import { z as z64 } from "zod";
|
|
2804
2859
|
|
|
2805
2860
|
// src/schema/postPurchaseGroupCatalog.ts
|
|
2806
|
-
import { z as
|
|
2861
|
+
import { z as z44 } from "zod";
|
|
2807
2862
|
var productId = PreparedPostPurchaseProduct.shape.selection.shape.productId;
|
|
2808
2863
|
var source = PostPurchaseProductSource.shape.data.element;
|
|
2809
2864
|
var PostPurchaseGroupDescription = source.pick({ description: true, id: true, image: true, images: true, title: true }).extend({
|
|
@@ -2811,17 +2866,17 @@ var PostPurchaseGroupDescription = source.pick({ description: true, id: true, im
|
|
|
2811
2866
|
image: source.shape.image.default(null),
|
|
2812
2867
|
options: PostPurchaseVariantCatalog.shape.options.default([])
|
|
2813
2868
|
});
|
|
2814
|
-
var PostPurchaseGroupCatalog =
|
|
2869
|
+
var PostPurchaseGroupCatalog = z44.object({
|
|
2815
2870
|
memberProductId: productId,
|
|
2816
|
-
options:
|
|
2871
|
+
options: z44.array(z44.object({ productId, title: z44.string(), variantCatalog: PostPurchaseVariantCatalog }))
|
|
2817
2872
|
});
|
|
2818
|
-
var PostPurchaseGroupSelection =
|
|
2873
|
+
var PostPurchaseGroupSelection = z44.object({
|
|
2819
2874
|
memberProductId: productId,
|
|
2820
2875
|
productId
|
|
2821
2876
|
});
|
|
2822
2877
|
|
|
2823
2878
|
// src/schema/widgets/checkout-and-beyond/root.ts
|
|
2824
|
-
import { z as
|
|
2879
|
+
import { z as z63 } from "zod";
|
|
2825
2880
|
|
|
2826
2881
|
// src/schema/widgets/checkout-and-beyond/constants.ts
|
|
2827
2882
|
import { uniqBy } from "es-toolkit";
|
|
@@ -2876,18 +2931,18 @@ var targetAreas = {
|
|
|
2876
2931
|
|
|
2877
2932
|
// src/schema/widgets/checkout-and-beyond/layout.ts
|
|
2878
2933
|
import { v7 as uuidv713 } from "uuid";
|
|
2879
|
-
import { z as
|
|
2934
|
+
import { z as z62 } from "zod";
|
|
2880
2935
|
|
|
2881
2936
|
// src/schema/widgets/checkout-and-beyond/shared.ts
|
|
2882
|
-
import { z as
|
|
2937
|
+
import { z as z61 } from "zod";
|
|
2883
2938
|
|
|
2884
2939
|
// src/schema/widgets/checkout-and-beyond/banner.ts
|
|
2885
|
-
import { z as
|
|
2886
|
-
var CABBannerSection =
|
|
2940
|
+
import { z as z45 } from "zod";
|
|
2941
|
+
var CABBannerSection = z45.lazy(
|
|
2887
2942
|
() => CABLayoutSection.omit({ sectionType: true }).extend({
|
|
2888
|
-
buttonField:
|
|
2889
|
-
color:
|
|
2890
|
-
dismissible:
|
|
2943
|
+
buttonField: z45.enum(buttonFields).optional(),
|
|
2944
|
+
color: z45.enum(bannerColors).default("info"),
|
|
2945
|
+
dismissible: z45.boolean().default(true),
|
|
2891
2946
|
/**
|
|
2892
2947
|
* The `s-banner` heading — localized content (a buyer can see a merchant-composed banner). Absent OR
|
|
2893
2948
|
* blank ⇒ no heading; the renderer emits no heading slot for `''` rather than an empty one.
|
|
@@ -2903,18 +2958,18 @@ var CABBannerSection = z44.lazy(
|
|
|
2903
2958
|
* not a 500. Nothing emits `heading` yet; the first converter that maps merchant banner copy into it
|
|
2904
2959
|
* either strips first or teaches `normalizeTextContent` to strip this field.
|
|
2905
2960
|
*/
|
|
2906
|
-
heading:
|
|
2907
|
-
sectionType:
|
|
2961
|
+
heading: z45.record(z45.string(), z45.string().refine(checkForHTML, NO_HTML)).optional(),
|
|
2962
|
+
sectionType: z45.literal(SectionType.banner).default(SectionType.banner)
|
|
2908
2963
|
})
|
|
2909
2964
|
);
|
|
2910
2965
|
|
|
2911
2966
|
// src/schema/widgets/checkout-and-beyond/button.ts
|
|
2912
2967
|
import { v7 as uuidv73 } from "uuid";
|
|
2913
|
-
import { z as
|
|
2968
|
+
import { z as z47 } from "zod";
|
|
2914
2969
|
|
|
2915
2970
|
// src/schema/widgets/checkout-and-beyond/image.ts
|
|
2916
2971
|
import { v7 as uuidv72 } from "uuid";
|
|
2917
|
-
import { z as
|
|
2972
|
+
import { z as z46 } from "zod";
|
|
2918
2973
|
|
|
2919
2974
|
// src/schema/widgets/checkout-and-beyond/icons.ts
|
|
2920
2975
|
var iconNames = [
|
|
@@ -3001,17 +3056,17 @@ var iconTones = ["auto", "critical", "custom", "info", "neutral", "success", "wa
|
|
|
3001
3056
|
var IconTone = freezeEnum(iconTones);
|
|
3002
3057
|
|
|
3003
3058
|
// src/schema/widgets/checkout-and-beyond/image.ts
|
|
3004
|
-
var CABImageSectionFields =
|
|
3059
|
+
var CABImageSectionFields = z46.object({
|
|
3005
3060
|
...CABVariableFields,
|
|
3006
|
-
altText:
|
|
3061
|
+
altText: z46.string().refine(checkForHTML, NO_HTML).default(""),
|
|
3007
3062
|
/**
|
|
3008
3063
|
* Image width÷height (e.g. `46` for the progress-bar fill); `null` renders at natural size. Any POSITIVE
|
|
3009
3064
|
* ratio — never limited to 1, but never `0`/negative either: a renderer dividing by it would get `Infinity`,
|
|
3010
3065
|
* and CSS `aspect-ratio` drops a negative value and silently reverts to natural size.
|
|
3011
3066
|
*/
|
|
3012
|
-
aspectRatio:
|
|
3013
|
-
border:
|
|
3014
|
-
buttonField:
|
|
3067
|
+
aspectRatio: z46.number().positive().nullable().default(null),
|
|
3068
|
+
border: z46.lazy(() => CABBorder),
|
|
3069
|
+
buttonField: z46.enum(buttonFields).optional(),
|
|
3015
3070
|
/**
|
|
3016
3071
|
* `icon` renders `source` as a single `s-icon` by name (the uber-image path covers icons too), reading
|
|
3017
3072
|
* `iconSize`/`iconTone`. The other values are a harmless informational holdover from the previous
|
|
@@ -3030,29 +3085,29 @@ var CABImageSectionFields = z45.object({
|
|
|
3030
3085
|
* behavior degraded gracefully and told us about it. The client-assembled half of the invariant was never
|
|
3031
3086
|
* the risky half.
|
|
3032
3087
|
*/
|
|
3033
|
-
category:
|
|
3088
|
+
category: z46.enum(["gallery", "icon", "icons", "payment-methods", "secure-checkout"]).nullable().default(null),
|
|
3034
3089
|
/** `icon`-mode only: the `s-icon` `size`; `null` ⇒ the component default (`base`). Ignored by image treatments. */
|
|
3035
|
-
iconSize:
|
|
3090
|
+
iconSize: z46.enum(iconSizes).nullable().default(null),
|
|
3036
3091
|
/** `icon`-mode only: the `s-icon` `tone`; `null` ⇒ the component default (`auto`). Ignored by image treatments. */
|
|
3037
|
-
iconTone:
|
|
3038
|
-
name:
|
|
3039
|
-
naturalHeight:
|
|
3040
|
-
naturalWidth:
|
|
3092
|
+
iconTone: z46.enum(iconTones).nullable().default(null),
|
|
3093
|
+
name: z46.string().optional(),
|
|
3094
|
+
naturalHeight: z46.number().default(0),
|
|
3095
|
+
naturalWidth: z46.number().default(0),
|
|
3041
3096
|
/**
|
|
3042
3097
|
* `contain` (the component default): dimensionless images render in s-image's 1/1 default frame, and
|
|
3043
3098
|
* `cover` would crop non-square art (payment badges lost their edges — 15993); `contain` letterboxes.
|
|
3044
3099
|
*/
|
|
3045
|
-
objectFit:
|
|
3046
|
-
sectionId:
|
|
3047
|
-
sectionType:
|
|
3100
|
+
objectFit: z46.enum(objectFits).default(ObjectFit.contain),
|
|
3101
|
+
sectionId: z46.uuid().default(() => uuidv72()),
|
|
3102
|
+
sectionType: z46.literal(SectionType.image).default(SectionType.image),
|
|
3048
3103
|
/**
|
|
3049
3104
|
* An image URL or dynamic token, an empty default, or — when `category: 'icon'` — an icon NAME. Icon mode
|
|
3050
3105
|
* takes a name or `''` only, NOT a token: no renderer resolves a token to an icon today, so accepting one
|
|
3051
3106
|
* would promise a capability that doesn't exist. Widen the refine's carve-out to `DYNAMIC_TOKEN_REGEX` when a
|
|
3052
3107
|
* server-chosen tier icon actually needs it.
|
|
3053
3108
|
*/
|
|
3054
|
-
source:
|
|
3055
|
-
width:
|
|
3109
|
+
source: z46.union([z46.url(), z46.literal(""), z46.string().regex(DYNAMIC_TOKEN_REGEX), z46.enum(iconNames)]).default(""),
|
|
3110
|
+
width: z46.number().default(100)
|
|
3056
3111
|
});
|
|
3057
3112
|
var iconNameSet = new Set(iconNames);
|
|
3058
3113
|
var isIconName = (source2) => iconNameSet.has(source2);
|
|
@@ -3072,35 +3127,35 @@ var CABImageSection = CABImageSectionFields.superRefine(({ category, source: sou
|
|
|
3072
3127
|
});
|
|
3073
3128
|
|
|
3074
3129
|
// src/schema/widgets/checkout-and-beyond/button.ts
|
|
3075
|
-
var CABButtonContent =
|
|
3076
|
-
() =>
|
|
3130
|
+
var CABButtonContent = z47.lazy(
|
|
3131
|
+
() => z47.discriminatedUnion("sectionType", [CABImageSection, CABLayoutSection, CABTextSection])
|
|
3077
3132
|
);
|
|
3078
|
-
var CABButtonSection =
|
|
3133
|
+
var CABButtonSection = z47.object({
|
|
3079
3134
|
...CABVariableFields,
|
|
3080
|
-
action:
|
|
3081
|
-
buttonStyle:
|
|
3082
|
-
custom:
|
|
3083
|
-
color:
|
|
3084
|
-
height:
|
|
3085
|
-
width:
|
|
3135
|
+
action: z47.union([z47.literal(""), z47.enum(buttonActions)]).default(""),
|
|
3136
|
+
buttonStyle: z47.enum(buttonStyles).default(ButtonStyle.primary),
|
|
3137
|
+
custom: z47.object({
|
|
3138
|
+
color: z47.string().regex(HEX_COLOR_REGEX).default("#005bd3"),
|
|
3139
|
+
height: z47.number().default(52),
|
|
3140
|
+
width: z47.number().default(300)
|
|
3086
3141
|
}).default({
|
|
3087
3142
|
color: "#005bd3",
|
|
3088
3143
|
height: 52,
|
|
3089
3144
|
width: 300
|
|
3090
3145
|
}),
|
|
3091
|
-
disableDowngrade:
|
|
3092
|
-
name:
|
|
3093
|
-
optionId:
|
|
3094
|
-
popover:
|
|
3095
|
-
alignment:
|
|
3096
|
-
position:
|
|
3146
|
+
disableDowngrade: z47.boolean().default(false),
|
|
3147
|
+
name: z47.string().optional(),
|
|
3148
|
+
optionId: z47.number().optional(),
|
|
3149
|
+
popover: z47.object({
|
|
3150
|
+
alignment: z47.enum(textAlignments).default(TextAlignment.center),
|
|
3151
|
+
position: z47.enum(popoverPositions).default(PopoverPosition.blockStart)
|
|
3097
3152
|
}).optional().default(() => ({
|
|
3098
3153
|
alignment: TextAlignment.center,
|
|
3099
3154
|
position: PopoverPosition.blockStart
|
|
3100
3155
|
})),
|
|
3101
|
-
sectionId:
|
|
3102
|
-
sections:
|
|
3103
|
-
sectionType:
|
|
3156
|
+
sectionId: z47.uuid().default(() => uuidv73()),
|
|
3157
|
+
sections: z47.union([z47.array(CABButtonContent), z47.strictObject({}).transform(() => [])]).default(() => []),
|
|
3158
|
+
sectionType: z47.literal(SectionType.button).default(SectionType.button),
|
|
3104
3159
|
/**
|
|
3105
3160
|
* The smart-cart tier this button acts on (`addGift`/`removeGift`): scopes the click to one tier's gift. The
|
|
3106
3161
|
* client resolves the tier's gift (productId) from the progress-bar context by this `tierId` — the button node
|
|
@@ -3115,96 +3170,96 @@ var CABButtonSection = z46.object({
|
|
|
3115
3170
|
* lookup finds no tier and the click resolves to nothing. Safe to bound — the field is new, so there are no
|
|
3116
3171
|
* stored payloads to grandfather, and the producer is client code, not a merchant form.
|
|
3117
3172
|
*/
|
|
3118
|
-
tier:
|
|
3173
|
+
tier: z47.object({ tierId: z47.string().min(1) }).optional(),
|
|
3119
3174
|
/** Fire-and-forget pixel POSTed when the button is clicked (e.g. a Monetize decline). */
|
|
3120
|
-
trackingUrl:
|
|
3175
|
+
trackingUrl: z47.string().optional(),
|
|
3121
3176
|
/**
|
|
3122
3177
|
* Secondary effects applied to in-scope variables on click, alongside (never instead of) the primary
|
|
3123
3178
|
* `action` — an `addToOrder` button can also flip a variable. Applied in array order.
|
|
3124
3179
|
*/
|
|
3125
|
-
variableEffects:
|
|
3180
|
+
variableEffects: z47.array(CABVariableEffect).optional()
|
|
3126
3181
|
});
|
|
3127
3182
|
|
|
3128
3183
|
// src/schema/widgets/checkout-and-beyond/carousel.ts
|
|
3129
|
-
import { z as
|
|
3184
|
+
import { z as z52 } from "zod";
|
|
3130
3185
|
|
|
3131
3186
|
// src/schema/widgets/checkout-and-beyond/offers.ts
|
|
3132
|
-
import { z as
|
|
3187
|
+
import { z as z51 } from "zod";
|
|
3133
3188
|
|
|
3134
3189
|
// src/schema/widgets/checkout-and-beyond/dataSource.ts
|
|
3135
3190
|
import { v7 as uuidv74 } from "uuid";
|
|
3136
|
-
import { z as
|
|
3137
|
-
var CABDiscount =
|
|
3138
|
-
amount:
|
|
3139
|
-
discountedBy:
|
|
3140
|
-
discountedFrom:
|
|
3141
|
-
type:
|
|
3142
|
-
});
|
|
3143
|
-
var CABIntegrations =
|
|
3144
|
-
judgeme:
|
|
3145
|
-
junip:
|
|
3146
|
-
klaviyo:
|
|
3147
|
-
loox:
|
|
3148
|
-
okendo:
|
|
3149
|
-
opinew:
|
|
3150
|
-
reviewsio:
|
|
3151
|
-
stamped:
|
|
3152
|
-
yotpo:
|
|
3153
|
-
});
|
|
3154
|
-
var CABVariantLabels =
|
|
3155
|
-
variantOption:
|
|
3156
|
-
variantOptions:
|
|
3157
|
-
});
|
|
3158
|
-
var CABDataSourceSection =
|
|
3159
|
-
dataSourceId:
|
|
3160
|
-
dataSourcePath:
|
|
3191
|
+
import { z as z48 } from "zod";
|
|
3192
|
+
var CABDiscount = z48.object({
|
|
3193
|
+
amount: z48.union([z48.number(), z48.string()]).catch(0),
|
|
3194
|
+
discountedBy: z48.string().optional(),
|
|
3195
|
+
discountedFrom: z48.enum(discountSources).optional().catch(void 0),
|
|
3196
|
+
type: z48.enum(discountTypes).catch("none")
|
|
3197
|
+
});
|
|
3198
|
+
var CABIntegrations = z48.object({
|
|
3199
|
+
judgeme: z48.boolean().default(false),
|
|
3200
|
+
junip: z48.boolean().default(false),
|
|
3201
|
+
klaviyo: z48.boolean().default(false),
|
|
3202
|
+
loox: z48.boolean().default(false),
|
|
3203
|
+
okendo: z48.boolean().default(false),
|
|
3204
|
+
opinew: z48.boolean().default(false),
|
|
3205
|
+
reviewsio: z48.boolean().default(false),
|
|
3206
|
+
stamped: z48.boolean().default(false),
|
|
3207
|
+
yotpo: z48.boolean().default(false)
|
|
3208
|
+
});
|
|
3209
|
+
var CABVariantLabels = z48.object({
|
|
3210
|
+
variantOption: z48.string().optional().catch(void 0),
|
|
3211
|
+
variantOptions: z48.string().optional().catch(void 0)
|
|
3212
|
+
});
|
|
3213
|
+
var CABDataSourceSection = z48.object({
|
|
3214
|
+
dataSourceId: z48.number().nullable().default(null),
|
|
3215
|
+
dataSourcePath: z48.string().default(DEFAULT_ENDPOINTS[0].value),
|
|
3161
3216
|
discount: CABDiscount.optional(),
|
|
3162
3217
|
integrations: CABIntegrations.optional(),
|
|
3163
|
-
limit:
|
|
3164
|
-
matchVariant:
|
|
3165
|
-
matchVariantOutOfStock:
|
|
3166
|
-
name:
|
|
3167
|
-
productType:
|
|
3168
|
-
sectionId:
|
|
3169
|
-
sectionType:
|
|
3218
|
+
limit: z48.number().default(1),
|
|
3219
|
+
matchVariant: z48.boolean().default(false),
|
|
3220
|
+
matchVariantOutOfStock: z48.boolean().default(false),
|
|
3221
|
+
name: z48.string().default(DEFAULT_ENDPOINTS[0].label),
|
|
3222
|
+
productType: z48.enum(productTypes).optional(),
|
|
3223
|
+
sectionId: z48.uuid().default(() => uuidv74()),
|
|
3224
|
+
sectionType: z48.literal(SectionType.dataSource).default(SectionType.dataSource),
|
|
3170
3225
|
/** Default subscribe-vs-one-time for `productType: both` (legacy `subscription_is_default`). */
|
|
3171
|
-
subscriptionIsDefault:
|
|
3172
|
-
treatAsGwp:
|
|
3226
|
+
subscriptionIsDefault: z48.boolean().default(false),
|
|
3227
|
+
treatAsGwp: z48.boolean().default(false),
|
|
3173
3228
|
variantLabels: CABVariantLabels.optional().catch(void 0)
|
|
3174
3229
|
});
|
|
3175
3230
|
|
|
3176
3231
|
// src/schema/widgets/checkout-and-beyond/products.ts
|
|
3177
3232
|
import { v7 as uuidv76 } from "uuid";
|
|
3178
|
-
import { z as
|
|
3233
|
+
import { z as z50 } from "zod";
|
|
3179
3234
|
|
|
3180
3235
|
// src/schema/widgets/checkout-and-beyond/product.ts
|
|
3181
3236
|
import { v7 as uuidv75 } from "uuid";
|
|
3182
|
-
import { z as
|
|
3183
|
-
var CABVariantContent =
|
|
3184
|
-
() =>
|
|
3237
|
+
import { z as z49 } from "zod";
|
|
3238
|
+
var CABVariantContent = z49.lazy(
|
|
3239
|
+
() => z49.discriminatedUnion("sectionType", [CABButtonSection, CABTextSection])
|
|
3185
3240
|
);
|
|
3186
|
-
var CABProductSection =
|
|
3241
|
+
var CABProductSection = z49.object({
|
|
3187
3242
|
...CABVariableFields,
|
|
3188
|
-
name:
|
|
3189
|
-
productId:
|
|
3190
|
-
sectionId:
|
|
3191
|
-
sections:
|
|
3192
|
-
sectionType:
|
|
3193
|
-
selectors:
|
|
3194
|
-
variantMode:
|
|
3243
|
+
name: z49.string().optional(),
|
|
3244
|
+
productId: z49.number().nullable().default(null),
|
|
3245
|
+
sectionId: z49.uuid().default(() => uuidv75()),
|
|
3246
|
+
sections: z49.union([z49.array(CABVariantContent), z49.strictObject({}).transform(() => [])]).default(() => []),
|
|
3247
|
+
sectionType: z49.literal(SectionType.product).default(SectionType.product),
|
|
3248
|
+
selectors: z49.record(z49.string(), z49.enum(variantSelectors).default(VariantSelector.menu)).default(() => ({})),
|
|
3249
|
+
variantMode: z49.enum(variantModes).default(VariantMode.multiple)
|
|
3195
3250
|
});
|
|
3196
3251
|
|
|
3197
3252
|
// src/schema/widgets/checkout-and-beyond/products.ts
|
|
3198
|
-
var CABProductsSection =
|
|
3253
|
+
var CABProductsSection = z50.object({
|
|
3199
3254
|
...CABVariableFields,
|
|
3200
|
-
name:
|
|
3201
|
-
sectionId:
|
|
3202
|
-
sections:
|
|
3203
|
-
sectionType:
|
|
3255
|
+
name: z50.string().optional(),
|
|
3256
|
+
sectionId: z50.uuid().default(() => uuidv76()),
|
|
3257
|
+
sections: z50.union([z50.array(z50.lazy(() => CABProductSection)), z50.strictObject({}).transform(() => [])]).default(() => []),
|
|
3258
|
+
sectionType: z50.literal(SectionType.products).default(SectionType.products)
|
|
3204
3259
|
});
|
|
3205
3260
|
|
|
3206
3261
|
// src/schema/widgets/checkout-and-beyond/offers.ts
|
|
3207
|
-
var CABOffersSection =
|
|
3262
|
+
var CABOffersSection = z51.lazy(
|
|
3208
3263
|
() => CABLayoutSection.omit({ sections: true, sectionType: true }).extend({
|
|
3209
3264
|
/**
|
|
3210
3265
|
* A rule between consecutive cards in the vertical list — legacy checkout-offers' `<Divider />`,
|
|
@@ -3212,8 +3267,8 @@ var CABOffersSection = z50.lazy(
|
|
|
3212
3267
|
* run of products). Optional, not defaulted: only the v1 converter sets it (REB-24265); a
|
|
3213
3268
|
* hand-built tree keeps React CAB's dividerless rendering.
|
|
3214
3269
|
*/
|
|
3215
|
-
divider:
|
|
3216
|
-
sections:
|
|
3270
|
+
divider: z51.boolean().optional(),
|
|
3271
|
+
sections: z51.union([z51.array(z51.lazy(() => CABSection)), z51.strictObject({}).transform(() => [])]).default(() => [
|
|
3217
3272
|
CABBannerSection.parse({
|
|
3218
3273
|
buttonField: "undoAddToOrder",
|
|
3219
3274
|
color: "success",
|
|
@@ -3227,77 +3282,77 @@ var CABOffersSection = z50.lazy(
|
|
|
3227
3282
|
CABDataSourceSection.parse({}),
|
|
3228
3283
|
CABProductsSection.parse({})
|
|
3229
3284
|
]),
|
|
3230
|
-
sectionType:
|
|
3285
|
+
sectionType: z51.literal(SectionType.offers).default(SectionType.offers)
|
|
3231
3286
|
})
|
|
3232
3287
|
);
|
|
3233
3288
|
|
|
3234
3289
|
// src/schema/widgets/checkout-and-beyond/carousel.ts
|
|
3235
|
-
var CABCarouselSection =
|
|
3290
|
+
var CABCarouselSection = z52.lazy(
|
|
3236
3291
|
() => CABLayoutSection.omit({ sections: true, sectionType: true }).extend({
|
|
3237
|
-
autoAdvanceInterval:
|
|
3238
|
-
itemsAtOnce:
|
|
3292
|
+
autoAdvanceInterval: z52.number().default(0),
|
|
3293
|
+
itemsAtOnce: z52.number().min(1).default(1),
|
|
3239
3294
|
/** Card arrangement for the offers child (`horizontal` = side-by-side) — NOT the carousel's own `direction`. */
|
|
3240
|
-
offersDirection:
|
|
3241
|
-
sections:
|
|
3242
|
-
sectionType:
|
|
3295
|
+
offersDirection: z52.enum(offersDirections).default("vertical"),
|
|
3296
|
+
sections: z52.union([z52.array(z52.lazy(() => CABSection)), z52.strictObject({}).transform(() => [])]).default(() => [CABOffersSection.parse({})]),
|
|
3297
|
+
sectionType: z52.literal(SectionType.carousel).default(SectionType.carousel)
|
|
3243
3298
|
})
|
|
3244
3299
|
);
|
|
3245
3300
|
|
|
3246
3301
|
// src/schema/widgets/checkout-and-beyond/cartLine.ts
|
|
3247
|
-
import { z as
|
|
3248
|
-
var CABCartLineSection =
|
|
3302
|
+
import { z as z53 } from "zod";
|
|
3303
|
+
var CABCartLineSection = z53.lazy(
|
|
3249
3304
|
() => CABLayoutSection.omit({ sections: true, sectionType: true }).extend({
|
|
3250
|
-
sections:
|
|
3251
|
-
sectionType:
|
|
3305
|
+
sections: z53.union([z53.array(z53.lazy(() => CABSection)), z53.strictObject({}).transform(() => [])]).default(() => [CABButtonSection.parse({ action: ButtonAction.switchToSubscription })]),
|
|
3306
|
+
sectionType: z53.literal(SectionType.cartLine).default(SectionType.cartLine)
|
|
3252
3307
|
})
|
|
3253
3308
|
);
|
|
3254
3309
|
|
|
3255
3310
|
// src/schema/widgets/checkout-and-beyond/discount.ts
|
|
3256
3311
|
import { v7 as uuidv77 } from "uuid";
|
|
3257
|
-
import { z as
|
|
3258
|
-
var CABDiscountSection =
|
|
3312
|
+
import { z as z54 } from "zod";
|
|
3313
|
+
var CABDiscountSection = z54.object({
|
|
3259
3314
|
...CABVariableFields,
|
|
3260
|
-
amount:
|
|
3261
|
-
discountedBy:
|
|
3262
|
-
discountedFrom:
|
|
3263
|
-
message:
|
|
3264
|
-
name:
|
|
3265
|
-
quantity:
|
|
3266
|
-
sectionId:
|
|
3267
|
-
sectionType:
|
|
3268
|
-
type:
|
|
3315
|
+
amount: z54.union([z54.number(), z54.string()]).catch(0),
|
|
3316
|
+
discountedBy: z54.string().optional(),
|
|
3317
|
+
discountedFrom: z54.enum(discountSources).optional().catch(void 0),
|
|
3318
|
+
message: z54.string().optional(),
|
|
3319
|
+
name: z54.string().optional(),
|
|
3320
|
+
quantity: z54.number().default(1),
|
|
3321
|
+
sectionId: z54.uuid().default(() => uuidv77()),
|
|
3322
|
+
sectionType: z54.literal(SectionType.discount).default(SectionType.discount),
|
|
3323
|
+
type: z54.enum(discountTypes).catch("none")
|
|
3269
3324
|
});
|
|
3270
3325
|
|
|
3271
3326
|
// src/schema/widgets/checkout-and-beyond/monetize.ts
|
|
3272
3327
|
import { v7 as uuidv78 } from "uuid";
|
|
3273
|
-
import { z as
|
|
3274
|
-
var CABMonetizeAds =
|
|
3275
|
-
requestId:
|
|
3328
|
+
import { z as z55 } from "zod";
|
|
3329
|
+
var CABMonetizeAds = z55.object({
|
|
3330
|
+
requestId: z55.string().optional(),
|
|
3276
3331
|
/** Defaulted here, never in the beacon: absence of information is `ads` itself being absent. */
|
|
3277
|
-
testing:
|
|
3332
|
+
testing: z55.boolean().default(false)
|
|
3278
3333
|
});
|
|
3279
|
-
var CABMonetizeSection =
|
|
3334
|
+
var CABMonetizeSection = z55.object({
|
|
3280
3335
|
...CABVariableFields,
|
|
3281
3336
|
ads: CABMonetizeAds.optional(),
|
|
3282
|
-
name:
|
|
3337
|
+
name: z55.string().optional(),
|
|
3283
3338
|
/**
|
|
3284
3339
|
* Server-hydrated offer cards (inline hydration): when `/cab/sections` was asked with a `monetize`
|
|
3285
3340
|
* context block, the composed cards ride the marker itself — `[]` means "hydrated, no fill" (render
|
|
3286
3341
|
* nothing, skip the fetch); ABSENT means "not hydrated" (the client fetches via `/cab/monetize`).
|
|
3287
3342
|
*/
|
|
3288
|
-
offers:
|
|
3343
|
+
offers: z55.array(z55.lazy(() => CABSection)).optional(),
|
|
3289
3344
|
/** 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. */
|
|
3290
|
-
privacyPolicyUrl:
|
|
3291
|
-
sectionId:
|
|
3292
|
-
sectionType:
|
|
3345
|
+
privacyPolicyUrl: z55.string().optional(),
|
|
3346
|
+
sectionId: z55.uuid().default(() => uuidv78()),
|
|
3347
|
+
sectionType: z55.literal(SectionType.monetize).default(SectionType.monetize),
|
|
3293
3348
|
/** Ads-taxonomy sub-vertical id (the widget's `sub_vertical` setting); paired with `vertical`. */
|
|
3294
|
-
subVertical:
|
|
3349
|
+
subVertical: z55.string().optional(),
|
|
3295
3350
|
/** Ads-taxonomy vertical id (the widget's `vertical` setting) — with `subVertical`, the admin Monetize editor's two configurables. */
|
|
3296
|
-
vertical:
|
|
3351
|
+
vertical: z55.string().optional()
|
|
3297
3352
|
});
|
|
3298
3353
|
|
|
3299
3354
|
// src/schema/widgets/checkout-and-beyond/progressBar.ts
|
|
3300
|
-
import { z as
|
|
3355
|
+
import { z as z56 } from "zod";
|
|
3301
3356
|
|
|
3302
3357
|
// src/schema/widgets/checkout-and-beyond/giftLabels.ts
|
|
3303
3358
|
var GIFT_LABELS = {
|
|
@@ -3416,34 +3471,34 @@ var GIFT_LABELS = {
|
|
|
3416
3471
|
};
|
|
3417
3472
|
|
|
3418
3473
|
// src/schema/widgets/checkout-and-beyond/progressBar.ts
|
|
3419
|
-
var CABProgressTierExclusion =
|
|
3420
|
-
collectionIds:
|
|
3421
|
-
productIds:
|
|
3422
|
-
tags:
|
|
3423
|
-
type:
|
|
3474
|
+
var CABProgressTierExclusion = z56.object({
|
|
3475
|
+
collectionIds: z56.array(z56.number().int().positive()).default(() => []),
|
|
3476
|
+
productIds: z56.array(z56.number().int().positive()).default(() => []),
|
|
3477
|
+
tags: z56.array(z56.string().min(1)).default(() => []),
|
|
3478
|
+
type: z56.enum(progressTierExclusionTypes)
|
|
3424
3479
|
});
|
|
3425
|
-
var CABProgressTier =
|
|
3480
|
+
var CABProgressTier = z56.object({
|
|
3426
3481
|
/**
|
|
3427
3482
|
* Order-discount tiers only (onsite `discount`): the reward the order-discount Function applies at
|
|
3428
3483
|
* cart time, carried so the client can resolve the `{{discountAmount}}` token in this tier's copy.
|
|
3429
3484
|
* `fixedAmount`: shop-currency CENTS (FX-scaled by the client, like {@link CABProgressTier.threshold});
|
|
3430
3485
|
* `percentage`: the whole-percent number rendered raw (`{n}%`). Absent on non-discount tiers.
|
|
3431
3486
|
*/
|
|
3432
|
-
discount:
|
|
3487
|
+
discount: z56.object({ amount: z56.number().nonnegative(), type: z56.enum(["fixedAmount", "percentage"]) }).optional(),
|
|
3433
3488
|
/**
|
|
3434
3489
|
* Per-tier exclusion rules (onsite `exclusions` when `exclusions_enabled`): lines they match don't count
|
|
3435
3490
|
* toward this tier. Empty (the default, and the converter's output for a disabled or ruleless tier) means
|
|
3436
3491
|
* the tier measures the plain bar-level adjusted progress. Consumers read ONLY the list named by the rule's
|
|
3437
3492
|
* `type` — the converter leaves the other two at `[]`, so a populated off-type list never reaches the tree.
|
|
3438
3493
|
*/
|
|
3439
|
-
exclusions:
|
|
3494
|
+
exclusions: z56.array(CABProgressTierExclusion).default(() => []),
|
|
3440
3495
|
/**
|
|
3441
3496
|
* Smart-cart product (gift) tiers only (onsite `filter_oos_variants`): when set, the client drops this
|
|
3442
3497
|
* tier entirely once its gift has NO in-stock eligible variant — the milestone, fill slot and gift
|
|
3443
3498
|
* controls all disappear, mirroring onsite removing the tier from `bar.tiers` before it renders. Absent
|
|
3444
3499
|
* on shipping/discount/decorative tiers and left off by default (the tier renders regardless of stock).
|
|
3445
3500
|
*/
|
|
3446
|
-
filterOosVariants:
|
|
3501
|
+
filterOosVariants: z56.boolean().default(false),
|
|
3447
3502
|
/**
|
|
3448
3503
|
* Smart-cart product (gift) tiers only: the reward unlocked at this tier. The client enriches
|
|
3449
3504
|
* `productId`/`variantIds` to live variants (availability, price) and adds the chosen one to the cart
|
|
@@ -3451,10 +3506,10 @@ var CABProgressTier = z55.object({
|
|
|
3451
3506
|
* tiers and on tiers with no configured product. Cart add/remove is a later stage; carried here so the
|
|
3452
3507
|
* tree is complete.
|
|
3453
3508
|
*/
|
|
3454
|
-
gift:
|
|
3455
|
-
productId:
|
|
3456
|
-
title:
|
|
3457
|
-
variantIds:
|
|
3509
|
+
gift: z56.object({
|
|
3510
|
+
productId: z56.number().int().positive(),
|
|
3511
|
+
title: z56.string().optional(),
|
|
3512
|
+
variantIds: z56.array(z56.number().int().positive()).default(() => [])
|
|
3458
3513
|
}).optional(),
|
|
3459
3514
|
/**
|
|
3460
3515
|
* The step-row icon's square size in PIXELS (onsite `product_tier_element_size`, an admin px string the
|
|
@@ -3474,7 +3529,7 @@ var CABProgressTier = z55.object({
|
|
|
3474
3529
|
* renderer never spells a fallback), which also makes a tree authored before this field render at
|
|
3475
3530
|
* React's size rather than the old hardcoded 20.
|
|
3476
3531
|
*/
|
|
3477
|
-
iconSizePx:
|
|
3532
|
+
iconSizePx: z56.number().int().min(1).max(64).default(18),
|
|
3478
3533
|
/**
|
|
3479
3534
|
* The step-row label at this tier's slot (onsite `getTierLabel`): the merchant custom label, else the
|
|
3480
3535
|
* type default — 'Free Shipping' or '{n}% Discount'. A PRODUCT tier gets NO converter label: its name is
|
|
@@ -3484,35 +3539,35 @@ var CABProgressTier = z55.object({
|
|
|
3484
3539
|
* turns a blank label into an absent key, and a client-authored blank means the same thing — the renderer
|
|
3485
3540
|
* emits no caption slot rather than an empty one). Plain text — a compact icon+label.
|
|
3486
3541
|
*/
|
|
3487
|
-
label:
|
|
3542
|
+
label: z56.record(z56.string(), z56.string()).optional(),
|
|
3488
3543
|
/**
|
|
3489
3544
|
* Smart-cart product (gift) tiers only (onsite `product_tier_image`): show the gift's product image in
|
|
3490
3545
|
* the step-row slot instead of the generic bag icon. The converter can't supply the image URL (config
|
|
3491
3546
|
* carries only product IDs), so the client resolves it (authoritative Shopify featured image, React
|
|
3492
3547
|
* parity) and falls back to the bag icon when the flag is off or no image resolves. Default false.
|
|
3493
3548
|
*/
|
|
3494
|
-
productTierImage:
|
|
3549
|
+
productTierImage: z56.boolean().default(false),
|
|
3495
3550
|
/**
|
|
3496
3551
|
* The tier's goal, measured per `unit`. `currency` (default): SHOP-currency cents — the canonical
|
|
3497
3552
|
* fallback: when the buyer's presentment currency has no entry in `thresholds`, the client
|
|
3498
3553
|
* multiplies this by the live FX rate (converter maps the v1 `unlock_price`, e.g. `75` → `7500`).
|
|
3499
3554
|
* `item`: a raw item count — no cents, no FX, no `thresholds` overrides.
|
|
3500
3555
|
*/
|
|
3501
|
-
threshold:
|
|
3556
|
+
threshold: z56.number().int().nonnegative(),
|
|
3502
3557
|
/**
|
|
3503
3558
|
* Per-presentment-currency goal overrides — lowercased ISO currency code → cents (e.g. `{ cad: 9900 }`).
|
|
3504
3559
|
* When the buyer's currency has an entry, the client uses it verbatim INSTEAD of FX-converting
|
|
3505
3560
|
* `threshold`, so merchants show intentional, clean per-market amounts (Shopify Markets) rather than a
|
|
3506
3561
|
* converted base. Defaults to `{}` — no overrides means always fall back to `threshold`.
|
|
3507
3562
|
*/
|
|
3508
|
-
thresholds:
|
|
3563
|
+
thresholds: z56.record(z56.string(), z56.number().int().nonnegative()).default(() => ({})),
|
|
3509
3564
|
/**
|
|
3510
3565
|
* Smart-cart tier identifier, mirrored onto the gift cart line's `_tier` attribute so the client can
|
|
3511
3566
|
* match an in-cart gift back to its tier (add on reach, remove on downgrade/decline). Absent on the
|
|
3512
3567
|
* shipping bar (single unlabeled tier, no gift).
|
|
3513
3568
|
*/
|
|
3514
|
-
tierId:
|
|
3515
|
-
tierType:
|
|
3569
|
+
tierId: z56.string().optional(),
|
|
3570
|
+
tierType: z56.enum(progressTierTypes).default(ProgressTierType.shipping),
|
|
3516
3571
|
/**
|
|
3517
3572
|
* What this tier's progress is measured in — PER TIER (onsite's `unlock_condition_type` model, NOT
|
|
3518
3573
|
* the React port's bar-level `tiers[0]` shortcut). `currency` compares money cents against the
|
|
@@ -3523,9 +3578,9 @@ var CABProgressTier = z55.object({
|
|
|
3523
3578
|
* count carries no injected noun (no English `item`/`items` inflection on localized copy); merchant
|
|
3524
3579
|
* template text supplies grammatically-neutral wording around the token.
|
|
3525
3580
|
*/
|
|
3526
|
-
unit:
|
|
3581
|
+
unit: z56.enum(progressTierUnits).default(ProgressTierUnit.currency)
|
|
3527
3582
|
});
|
|
3528
|
-
var CABProgressBarSection =
|
|
3583
|
+
var CABProgressBarSection = z56.lazy(
|
|
3529
3584
|
() => CABLayoutSection.omit({ sectionType: true }).extend({
|
|
3530
3585
|
/**
|
|
3531
3586
|
* The onsite bar id (smart-cart TPB bars only). The client mirrors it to the cart's `_barId` attribute
|
|
@@ -3534,35 +3589,35 @@ var CABProgressBarSection = z55.lazy(
|
|
|
3534
3589
|
* checkout reaches the extension without it, so the client writes it or the tier gift's 100% discount
|
|
3535
3590
|
* (and any tier order discount) never applies. Absent on the v1 shipping bar (no gift tiers, no id).
|
|
3536
3591
|
*/
|
|
3537
|
-
barId:
|
|
3592
|
+
barId: z56.string().optional(),
|
|
3538
3593
|
/** Empty = shown everywhere; otherwise uppercase ISO country codes. */
|
|
3539
|
-
countryCodes:
|
|
3594
|
+
countryCodes: z56.array(z56.string().transform((code) => code.trim().toUpperCase())).default(() => []),
|
|
3540
3595
|
/**
|
|
3541
3596
|
* Uppercase ISO codes where a higher-precedence geo bar applies, so this (default, non-geo) bar is
|
|
3542
3597
|
* hidden there — replicates React `getbar`'s geo-match-over-default precedence. Empty = never excluded.
|
|
3543
3598
|
*/
|
|
3544
|
-
excludeCountryCodes:
|
|
3599
|
+
excludeCountryCodes: z56.array(z56.string().transform((code) => code.trim().toUpperCase())).default(() => []),
|
|
3545
3600
|
/**
|
|
3546
3601
|
* Measure progress against the PRE-discount subtotal (onsite `exclude_discount_in_subtotal`, and
|
|
3547
3602
|
* forced on for bars with a discount tier so its own reward can't un-reach the tier). The client
|
|
3548
3603
|
* adds the cart's discount allocations back to the live subtotal.
|
|
3549
3604
|
*/
|
|
3550
|
-
excludeDiscountInSubtotal:
|
|
3605
|
+
excludeDiscountInSubtotal: z56.boolean().default(false),
|
|
3551
3606
|
/** Variant ids the client subtracts from the adjusted subtotal (React `bar.excluded_products`). */
|
|
3552
|
-
excludedVariantIds:
|
|
3607
|
+
excludedVariantIds: z56.array(z56.number().int().positive()).default(() => []),
|
|
3553
3608
|
/**
|
|
3554
3609
|
* When the cart holds a subscription item, treat the bar as reached regardless of subtotal (React
|
|
3555
3610
|
* `free_shipping_on_subscription(s)`). `freeShippingOnAll` is already a zero-threshold tier instead.
|
|
3556
3611
|
*/
|
|
3557
|
-
freeShippingOnSubscription:
|
|
3612
|
+
freeShippingOnSubscription: z56.boolean().default(false),
|
|
3558
3613
|
/** Localized heading over the gift controls (onsite `gift_area_title`, default 'FREE GIFTS'). */
|
|
3559
|
-
giftAreaTitle:
|
|
3614
|
+
giftAreaTitle: z56.record(z56.string(), z56.string()).default(() => ({ en: "FREE GIFTS" })),
|
|
3560
3615
|
/** Localized gift-control labels (add/remove/heading); a tier's gift `title` beats `yourGift`. */
|
|
3561
|
-
giftLabels:
|
|
3562
|
-
addGift:
|
|
3563
|
-
remove:
|
|
3564
|
-
selectOptions:
|
|
3565
|
-
yourGift:
|
|
3616
|
+
giftLabels: z56.object({
|
|
3617
|
+
addGift: z56.record(z56.string(), z56.string()).default(() => ({ ...GIFT_LABELS.addGift })),
|
|
3618
|
+
remove: z56.record(z56.string(), z56.string()).default(() => ({ ...GIFT_LABELS.remove })),
|
|
3619
|
+
selectOptions: z56.record(z56.string(), z56.string()).default(() => ({ ...GIFT_LABELS.selectOptions })),
|
|
3620
|
+
yourGift: z56.record(z56.string(), z56.string()).default(() => ({ ...GIFT_LABELS.yourGift }))
|
|
3566
3621
|
}).default(() => ({
|
|
3567
3622
|
addGift: { ...GIFT_LABELS.addGift },
|
|
3568
3623
|
remove: { ...GIFT_LABELS.remove },
|
|
@@ -3570,38 +3625,38 @@ var CABProgressBarSection = z55.lazy(
|
|
|
3570
3625
|
yourGift: { ...GIFT_LABELS.yourGift }
|
|
3571
3626
|
})),
|
|
3572
3627
|
/** The bar's a11y label; the merchant names it in the editor, else this default (React parity). */
|
|
3573
|
-
name:
|
|
3628
|
+
name: z56.string().default("Order progress"),
|
|
3574
3629
|
/**
|
|
3575
3630
|
* Bar fill color. An explicit (widget-authored) value is used verbatim; when absent the server
|
|
3576
3631
|
* fills it with the live shop theme's `buttonBackground` (React `useRebuyTheme` parity). Still
|
|
3577
3632
|
* absent after that ⇒ the theme fetch failed and the client renders its platform-default bar —
|
|
3578
3633
|
* optional, not defaulted, so "merchant chose no color" stays distinguishable from any real value.
|
|
3579
3634
|
*/
|
|
3580
|
-
progressColor:
|
|
3581
|
-
sectionType:
|
|
3635
|
+
progressColor: z56.string().optional(),
|
|
3636
|
+
sectionType: z56.literal(SectionType.progressBar).default(SectionType.progressBar),
|
|
3582
3637
|
/**
|
|
3583
3638
|
* The bar's milestones in the merchant's CONFIGURED order — the renderer does NOT sort them (022
|
|
3584
3639
|
* O-B2: sorting by resolved threshold reversed configured milestones on out-of-order or mixed-unit
|
|
3585
3640
|
* count-vs-cents bars). Drives the fill (even slot per tier) and, for smart-cart product tiers, the
|
|
3586
3641
|
* gift add/remove. The visual tier display lives in `sections` (composable), NOT here.
|
|
3587
3642
|
*/
|
|
3588
|
-
tiers:
|
|
3643
|
+
tiers: z56.union([z56.array(CABProgressTier), z56.strictObject({}).transform(() => [])]).default(() => [])
|
|
3589
3644
|
})
|
|
3590
3645
|
);
|
|
3591
3646
|
|
|
3592
3647
|
// src/schema/widgets/checkout-and-beyond/quantity.ts
|
|
3593
3648
|
import { v7 as uuidv79 } from "uuid";
|
|
3594
|
-
import { z as
|
|
3595
|
-
var CABQuantitySection =
|
|
3649
|
+
import { z as z57 } from "zod";
|
|
3650
|
+
var CABQuantitySection = z57.object({
|
|
3596
3651
|
...CABVariableFields,
|
|
3597
|
-
errorMessages:
|
|
3598
|
-
|
|
3599
|
-
|
|
3652
|
+
errorMessages: z57.record(
|
|
3653
|
+
z57.string(),
|
|
3654
|
+
z57.object({
|
|
3600
3655
|
/** `{{step}}` is interpolated at render — the off-increment message React never gave a merchant key. */
|
|
3601
|
-
increment:
|
|
3602
|
-
max:
|
|
3603
|
-
min:
|
|
3604
|
-
neg:
|
|
3656
|
+
increment: z57.string().optional(),
|
|
3657
|
+
max: z57.string().optional(),
|
|
3658
|
+
min: z57.string().optional(),
|
|
3659
|
+
neg: z57.string().optional()
|
|
3605
3660
|
})
|
|
3606
3661
|
).default({
|
|
3607
3662
|
en: {
|
|
@@ -3611,18 +3666,18 @@ var CABQuantitySection = z56.object({
|
|
|
3611
3666
|
neg: "Quantity cannot be negative"
|
|
3612
3667
|
}
|
|
3613
3668
|
}),
|
|
3614
|
-
inputType:
|
|
3615
|
-
max:
|
|
3616
|
-
min:
|
|
3669
|
+
inputType: z57.enum(quantityInputs).default(QuantityInput.select),
|
|
3670
|
+
max: z57.number().min(1).max(100).default(10),
|
|
3671
|
+
min: z57.number().min(1).default(1),
|
|
3617
3672
|
/** The a11y label for the quantity control; the merchant names it in the editor, else this default. */
|
|
3618
|
-
name:
|
|
3619
|
-
sectionId:
|
|
3620
|
-
sectionType:
|
|
3673
|
+
name: z57.string().default("Quantity"),
|
|
3674
|
+
sectionId: z57.uuid().default(() => uuidv79()),
|
|
3675
|
+
sectionType: z57.literal(SectionType.quantity).default(SectionType.quantity)
|
|
3621
3676
|
});
|
|
3622
3677
|
|
|
3623
3678
|
// src/schema/widgets/checkout-and-beyond/reviews.ts
|
|
3624
3679
|
import { v7 as uuidv710 } from "uuid";
|
|
3625
|
-
import { z as
|
|
3680
|
+
import { z as z58 } from "zod";
|
|
3626
3681
|
|
|
3627
3682
|
// src/schema/widgets/checkout-and-beyond/reviewLabels.ts
|
|
3628
3683
|
var REVIEW_LABELS = {
|
|
@@ -3685,68 +3740,68 @@ var REVIEW_LABELS = {
|
|
|
3685
3740
|
};
|
|
3686
3741
|
|
|
3687
3742
|
// src/schema/widgets/checkout-and-beyond/reviews.ts
|
|
3688
|
-
var CABReviewsSection =
|
|
3743
|
+
var CABReviewsSection = z58.object({
|
|
3689
3744
|
...CABVariableFields,
|
|
3690
|
-
color:
|
|
3745
|
+
color: z58.string().default("#fadb14"),
|
|
3691
3746
|
/**
|
|
3692
3747
|
* Localized review-count templates (`{{reviewCount}}`), one/other plural forms; the client picks the
|
|
3693
3748
|
* form via `Intl.PluralRules`. Defaults here (schema-first) so every tree localizes without converter
|
|
3694
3749
|
* or merchant work.
|
|
3695
3750
|
*/
|
|
3696
|
-
countLabels:
|
|
3697
|
-
one:
|
|
3698
|
-
other:
|
|
3751
|
+
countLabels: z58.object({
|
|
3752
|
+
one: z58.record(z58.string(), z58.string()).default(() => ({ ...REVIEW_LABELS.one })),
|
|
3753
|
+
other: z58.record(z58.string(), z58.string()).default(() => ({ ...REVIEW_LABELS.other }))
|
|
3699
3754
|
}).default(() => ({ one: { ...REVIEW_LABELS.one }, other: { ...REVIEW_LABELS.other } })),
|
|
3700
|
-
name:
|
|
3701
|
-
sectionId:
|
|
3702
|
-
sectionType:
|
|
3703
|
-
size:
|
|
3755
|
+
name: z58.string().optional(),
|
|
3756
|
+
sectionId: z58.uuid().default(() => uuidv710()),
|
|
3757
|
+
sectionType: z58.literal(SectionType.reviews).default(SectionType.reviews),
|
|
3758
|
+
size: z58.enum(reviewsSizes).default(ReviewsSize.default),
|
|
3704
3759
|
/**
|
|
3705
3760
|
* Star outline color, interpolated into a style by the renderer, so it is hex-constrained like
|
|
3706
3761
|
* `CABButtonSection.color`. The legacy source (`PostPurchaseSettings.styles.starStrokeColor`) is a free
|
|
3707
3762
|
* string: its converter must validate and fall back to this default rather than let one odd value drop
|
|
3708
3763
|
* the whole reviews section.
|
|
3709
3764
|
*/
|
|
3710
|
-
strokeColor:
|
|
3765
|
+
strokeColor: z58.string().regex(HEX_COLOR_REGEX).default("#fadb14"),
|
|
3711
3766
|
/** Star outline width in px; `0` draws no outline. The legacy `styles.strokeWidth` is a STRING ('1') — its converter coerces. */
|
|
3712
|
-
strokeWidth:
|
|
3767
|
+
strokeWidth: z58.number().nonnegative().default(0)
|
|
3713
3768
|
});
|
|
3714
3769
|
|
|
3715
3770
|
// src/schema/widgets/checkout-and-beyond/separator.ts
|
|
3716
3771
|
import { v7 as uuidv711 } from "uuid";
|
|
3717
|
-
import { z as
|
|
3718
|
-
var CABSeparatorSection =
|
|
3772
|
+
import { z as z59 } from "zod";
|
|
3773
|
+
var CABSeparatorSection = z59.object({
|
|
3719
3774
|
...CABVariableFields,
|
|
3720
|
-
sectionId:
|
|
3721
|
-
sectionType:
|
|
3775
|
+
sectionId: z59.uuid().default(() => uuidv711()),
|
|
3776
|
+
sectionType: z59.literal(SectionType.separator).default(SectionType.separator)
|
|
3722
3777
|
});
|
|
3723
3778
|
|
|
3724
3779
|
// src/schema/widgets/checkout-and-beyond/variants.ts
|
|
3725
3780
|
import { slice } from "es-toolkit/compat";
|
|
3726
3781
|
import { v7 as uuidv712 } from "uuid";
|
|
3727
|
-
import { z as
|
|
3728
|
-
var CABVariantsSection =
|
|
3782
|
+
import { z as z60 } from "zod";
|
|
3783
|
+
var CABVariantsSection = z60.object({
|
|
3729
3784
|
...CABVariableFields,
|
|
3730
|
-
hideOutOfStockVariants:
|
|
3731
|
-
name:
|
|
3732
|
-
sectionId:
|
|
3733
|
-
sectionType:
|
|
3734
|
-
selector:
|
|
3735
|
-
variantMode:
|
|
3785
|
+
hideOutOfStockVariants: z60.boolean().default(false),
|
|
3786
|
+
name: z60.string().optional(),
|
|
3787
|
+
sectionId: z60.uuid().default(() => uuidv712()),
|
|
3788
|
+
sectionType: z60.literal(SectionType.variants).default(SectionType.variants),
|
|
3789
|
+
selector: z60.enum(slice(variantSelectors, 0, 3)).default(VariantSelector.menu),
|
|
3790
|
+
variantMode: z60.enum(variantModes).default(VariantMode.multiple)
|
|
3736
3791
|
});
|
|
3737
3792
|
|
|
3738
3793
|
// src/schema/widgets/checkout-and-beyond/shared.ts
|
|
3739
|
-
var CABBorder =
|
|
3740
|
-
radius:
|
|
3741
|
-
style:
|
|
3742
|
-
width:
|
|
3794
|
+
var CABBorder = z61.object({
|
|
3795
|
+
radius: z61.enum(borderRadii).default(BorderRadius.base),
|
|
3796
|
+
style: z61.enum(borderStyles).default(BorderStyle.none),
|
|
3797
|
+
width: z61.enum(borderWidths).default(BorderWidth.base)
|
|
3743
3798
|
}).default({
|
|
3744
3799
|
radius: BorderRadius.base,
|
|
3745
3800
|
style: BorderStyle.none,
|
|
3746
3801
|
width: BorderWidth.base
|
|
3747
3802
|
});
|
|
3748
|
-
var CABSection =
|
|
3749
|
-
() =>
|
|
3803
|
+
var CABSection = z61.lazy(
|
|
3804
|
+
() => z61.discriminatedUnion("sectionType", [
|
|
3750
3805
|
CABBannerSection,
|
|
3751
3806
|
CABButtonSection,
|
|
3752
3807
|
CABCarouselSection,
|
|
@@ -3769,41 +3824,41 @@ var CABSection = z60.lazy(
|
|
|
3769
3824
|
);
|
|
3770
3825
|
|
|
3771
3826
|
// src/schema/widgets/checkout-and-beyond/layout.ts
|
|
3772
|
-
var GridItem =
|
|
3773
|
-
var CABLayoutWrapping =
|
|
3774
|
-
breakAt:
|
|
3775
|
-
maxPerLine:
|
|
3827
|
+
var GridItem = z62.union([z62.literal("auto"), z62.literal("fill"), z62.string().regex(/^\d+%$/), z62.number()]);
|
|
3828
|
+
var CABLayoutWrapping = z62.object({
|
|
3829
|
+
breakAt: z62.number().positive(),
|
|
3830
|
+
maxPerLine: z62.number().int().positive()
|
|
3776
3831
|
});
|
|
3777
|
-
var CABLayoutSection =
|
|
3832
|
+
var CABLayoutSection = z62.object({
|
|
3778
3833
|
...CABVariableFields,
|
|
3779
|
-
alignment:
|
|
3780
|
-
horizontal:
|
|
3781
|
-
vertical:
|
|
3834
|
+
alignment: z62.object({
|
|
3835
|
+
horizontal: z62.enum(horizontalAlignments).default(HorizontalAlignment.start),
|
|
3836
|
+
vertical: z62.enum(verticalAlignments).default(VerticalAlignment.top)
|
|
3782
3837
|
}).default({
|
|
3783
3838
|
horizontal: HorizontalAlignment.start,
|
|
3784
3839
|
vertical: VerticalAlignment.top
|
|
3785
3840
|
}),
|
|
3786
|
-
border:
|
|
3787
|
-
buttonField:
|
|
3788
|
-
direction:
|
|
3841
|
+
border: z62.lazy(() => CABBorder),
|
|
3842
|
+
buttonField: z62.enum(buttonFields).optional(),
|
|
3843
|
+
direction: z62.enum(directions).default(Direction.rows),
|
|
3789
3844
|
/**
|
|
3790
3845
|
* Platform chrome around the section, not a layout behavior: `callout` is a subdued box with block borders
|
|
3791
3846
|
* (the legacy post-purchase callout banner), `offer-content` the post-purchase offer's own content card.
|
|
3792
3847
|
*/
|
|
3793
|
-
frame:
|
|
3794
|
-
grid:
|
|
3795
|
-
columns:
|
|
3796
|
-
rows:
|
|
3848
|
+
frame: z62.enum(layoutFrames).optional(),
|
|
3849
|
+
grid: z62.object({
|
|
3850
|
+
columns: z62.union([z62.array(GridItem), z62.undefined()]).default(() => ["auto"]),
|
|
3851
|
+
rows: z62.union([z62.array(GridItem), z62.undefined()]).default(() => ["auto"])
|
|
3797
3852
|
}).default({ columns: ["auto"], rows: ["auto"] }).optional(),
|
|
3798
|
-
name:
|
|
3799
|
-
padding:
|
|
3800
|
-
sectionId:
|
|
3801
|
-
sections:
|
|
3802
|
-
sectionType:
|
|
3803
|
-
spacing:
|
|
3853
|
+
name: z62.string().optional(),
|
|
3854
|
+
padding: z62.enum(spacings).default(Spacing.none),
|
|
3855
|
+
sectionId: z62.uuid().default(() => uuidv713()),
|
|
3856
|
+
sections: z62.union([z62.array(z62.lazy(() => CABSection)), z62.strictObject({}).transform(() => [])]).default(() => []),
|
|
3857
|
+
sectionType: z62.literal(SectionType.layout).default(SectionType.layout),
|
|
3858
|
+
spacing: z62.enum(spacings).default(Spacing.base),
|
|
3804
3859
|
/** Fire-and-forget impression pixel POSTed once when the section is shown (e.g. a Monetize offer view). */
|
|
3805
|
-
viewUrl:
|
|
3806
|
-
width:
|
|
3860
|
+
viewUrl: z62.string().optional(),
|
|
3861
|
+
width: z62.number().default(100),
|
|
3807
3862
|
wrapping: CABLayoutWrapping.optional()
|
|
3808
3863
|
});
|
|
3809
3864
|
|
|
@@ -3825,8 +3880,8 @@ var UI_LABELS = {
|
|
|
3825
3880
|
};
|
|
3826
3881
|
|
|
3827
3882
|
// src/schema/widgets/checkout-and-beyond/root.ts
|
|
3828
|
-
var localized = (fallback) =>
|
|
3829
|
-
var CABUILabels =
|
|
3883
|
+
var localized = (fallback) => z63.record(z63.string(), z63.string()).default(() => ({ ...fallback })).transform((labels) => Object.keys(labels).length > 0 ? labels : { ...fallback });
|
|
3884
|
+
var CABUILabels = z63.object({
|
|
3830
3885
|
currentPage: localized(UI_LABELS.currentPage),
|
|
3831
3886
|
guest: localized(UI_LABELS.guest),
|
|
3832
3887
|
loadingOptions: localized(UI_LABELS.loadingOptions),
|
|
@@ -3851,47 +3906,48 @@ var CABUILabels = z62.object({
|
|
|
3851
3906
|
subscriptionOptions: { ...UI_LABELS.subscriptionOptions },
|
|
3852
3907
|
updating: { ...UI_LABELS.updating }
|
|
3853
3908
|
}));
|
|
3854
|
-
var TargetArea =
|
|
3855
|
-
fill:
|
|
3856
|
-
flip:
|
|
3857
|
-
icon:
|
|
3858
|
-
label:
|
|
3859
|
-
width:
|
|
3909
|
+
var TargetArea = z63.object({
|
|
3910
|
+
fill: z63.boolean().optional(),
|
|
3911
|
+
flip: z63.enum(["both", "horizontal", "vertical"]).optional(),
|
|
3912
|
+
icon: z63.string(),
|
|
3913
|
+
label: z63.string(),
|
|
3914
|
+
width: z63.string()
|
|
3860
3915
|
}).default(targetAreas[EditorMode.checkoutExtension][1]);
|
|
3861
|
-
var CABTracking =
|
|
3862
|
-
enableAttribution:
|
|
3863
|
-
enableSource:
|
|
3864
|
-
enableWidget:
|
|
3916
|
+
var CABTracking = z63.object({
|
|
3917
|
+
enableAttribution: z63.boolean().nullish().transform((value) => value ?? true),
|
|
3918
|
+
enableSource: z63.boolean().nullish().transform((value) => value ?? true),
|
|
3919
|
+
enableWidget: z63.boolean().nullish().transform((value) => value ?? true)
|
|
3865
3920
|
}).nullish().transform((value) => value ?? { enableAttribution: true, enableSource: true, enableWidget: true });
|
|
3866
|
-
var CABExperiment =
|
|
3867
|
-
elementId:
|
|
3868
|
-
experimentId:
|
|
3869
|
-
experimentType:
|
|
3870
|
-
selectedId:
|
|
3921
|
+
var CABExperiment = z63.object({
|
|
3922
|
+
elementId: z63.number(),
|
|
3923
|
+
experimentId: z63.number(),
|
|
3924
|
+
experimentType: z63.string(),
|
|
3925
|
+
selectedId: z63.number()
|
|
3871
3926
|
});
|
|
3872
3927
|
var CABRootSection = CABLayoutSection.extend({
|
|
3873
|
-
editorMode:
|
|
3928
|
+
editorMode: z63.enum(editorModes).default(EditorMode.checkoutExtension),
|
|
3874
3929
|
experiment: CABExperiment.optional(),
|
|
3875
3930
|
// Same rule as CABTracking above: the v1 converters pass raw legacy `previewMode` through, so a
|
|
3876
3931
|
// `null` must fall back rather than throw the widget; malformed values still throw.
|
|
3877
|
-
previewMode:
|
|
3878
|
-
storeId:
|
|
3932
|
+
previewMode: z63.boolean().nullish().transform((value) => value ?? false),
|
|
3933
|
+
storeId: z63.number().nullable().default(null),
|
|
3879
3934
|
targetArea: TargetArea.nullable(),
|
|
3880
3935
|
tracking: CABTracking,
|
|
3881
|
-
type:
|
|
3936
|
+
type: z63.enum(widgetTypes).default(WidgetType.ui_extension_content_block),
|
|
3882
3937
|
uiLabels: CABUILabels,
|
|
3883
|
-
version:
|
|
3884
|
-
widgetId:
|
|
3938
|
+
version: z63.literal(2).default(2),
|
|
3939
|
+
widgetId: z63.number().nullable().default(null)
|
|
3885
3940
|
});
|
|
3886
3941
|
|
|
3887
3942
|
// src/schema/postPurchaseProductView.ts
|
|
3888
|
-
var PostPurchaseProductView =
|
|
3889
|
-
|
|
3943
|
+
var PostPurchaseProductView = z64.union([
|
|
3944
|
+
z64.object({
|
|
3945
|
+
changeset: PostPurchaseProductChangeset.optional(),
|
|
3890
3946
|
groupCatalog: PostPurchaseGroupCatalog.optional(),
|
|
3891
3947
|
initialVariant: PostPurchaseVariantSelector.optional(),
|
|
3892
3948
|
planCatalog: PostPurchasePlanCatalog.nullable().optional(),
|
|
3893
3949
|
preparation: PreparedPostPurchaseProduct.extend({
|
|
3894
|
-
display: PreparedPostPurchaseProduct.shape.display.extend({ description:
|
|
3950
|
+
display: PreparedPostPurchaseProduct.shape.display.extend({ description: z64.string().nullable() }).refine(
|
|
3895
3951
|
({ description, descriptionDocument }) => description === null === (descriptionDocument !== void 0),
|
|
3896
3952
|
"Exactly one of the plain and rich descriptions is shown"
|
|
3897
3953
|
)
|
|
@@ -3900,33 +3956,33 @@ var PostPurchaseProductView = z63.union([
|
|
|
3900
3956
|
sections: CABRootSection,
|
|
3901
3957
|
variantCatalog: PostPurchaseVariantCatalog.optional()
|
|
3902
3958
|
}),
|
|
3903
|
-
|
|
3959
|
+
z64.object({
|
|
3904
3960
|
groupCatalog: PostPurchaseGroupCatalog.optional(),
|
|
3905
3961
|
initialVariant: PostPurchaseVariantSelector.optional(),
|
|
3906
3962
|
planCatalog: PostPurchasePlanCatalog.nullable().optional(),
|
|
3907
3963
|
preparation: PostPurchasePreparation.options[1],
|
|
3908
3964
|
purchaseOptions: PostPurchaseOptions.optional(),
|
|
3909
|
-
sections:
|
|
3965
|
+
sections: z64.null(),
|
|
3910
3966
|
variantCatalog: PostPurchaseVariantCatalog.optional()
|
|
3911
3967
|
})
|
|
3912
3968
|
]);
|
|
3913
3969
|
|
|
3914
3970
|
// src/schema/postPurchaseProductCollectionView.ts
|
|
3915
|
-
var PostPurchaseProductCollectionView =
|
|
3916
|
-
members:
|
|
3917
|
-
|
|
3971
|
+
var PostPurchaseProductCollectionView = z65.object({
|
|
3972
|
+
members: z65.array(
|
|
3973
|
+
z65.object({
|
|
3918
3974
|
productId: PostPurchaseProductId,
|
|
3919
|
-
productIndex:
|
|
3975
|
+
productIndex: z65.number().int().nonnegative(),
|
|
3920
3976
|
view: PostPurchaseProductView
|
|
3921
3977
|
})
|
|
3922
3978
|
)
|
|
3923
3979
|
});
|
|
3924
|
-
var PostPurchaseCollectionChoice =
|
|
3980
|
+
var PostPurchaseCollectionChoice = z65.object({
|
|
3925
3981
|
choice: PostPurchaseChoice.optional(),
|
|
3926
3982
|
productId: PostPurchaseProductId,
|
|
3927
3983
|
variantId: PostPurchaseVariantSelector.shape.variantId.optional()
|
|
3928
3984
|
}).strict();
|
|
3929
|
-
var PostPurchaseExcludedProductIds =
|
|
3985
|
+
var PostPurchaseExcludedProductIds = z65.array(PostPurchaseProductId).default([]);
|
|
3930
3986
|
var PostPurchaseMemberSelector = PostPurchaseProgressSchema.shape.members.element.pick({ productId: true }).extend({ progressRevision: PostPurchaseProgressSchema.shape.revision });
|
|
3931
3987
|
var PostPurchaseMemberPointer = PostPurchaseProgressSchema.shape.members.element.omit({ status: true }).extend({
|
|
3932
3988
|
entryRevision: PostPurchaseProgressSchema.shape.entryRevision,
|
|
@@ -3939,7 +3995,7 @@ var PostPurchaseQuantityChoice = PostPurchaseCollectionChoice.extend({ quantity:
|
|
|
3939
3995
|
var PostPurchaseQuantityPolicy = PostPurchaseSettings.shape.quantityInputs.omit({ defaultQuantity: true }).extend({
|
|
3940
3996
|
initialQuantity: quantity,
|
|
3941
3997
|
maxValue: quantity,
|
|
3942
|
-
minValue:
|
|
3998
|
+
minValue: z66.literal(0).transform(() => 1).or(quantity)
|
|
3943
3999
|
}).refine(({ maxValue, minValue }) => minValue <= maxValue, "Quantity bounds are reversed");
|
|
3944
4000
|
|
|
3945
4001
|
// src/schema/postPurchaseGroup.ts
|
|
@@ -3948,33 +4004,33 @@ var PostPurchaseGroupChoice = PostPurchaseQuantityChoice.extend({
|
|
|
3948
4004
|
});
|
|
3949
4005
|
|
|
3950
4006
|
// src/schema/postPurchaseHealth.ts
|
|
3951
|
-
import { z as
|
|
4007
|
+
import { z as z69 } from "zod";
|
|
3952
4008
|
|
|
3953
4009
|
// src/schema/postPurchaseHealthSchedule.ts
|
|
3954
|
-
import { z as
|
|
4010
|
+
import { z as z68 } from "zod";
|
|
3955
4011
|
|
|
3956
4012
|
// src/schema/postPurchaseReleaseSchedule.ts
|
|
3957
|
-
import { z as
|
|
3958
|
-
var postPurchaseTaskNameSchema = (queue, id) =>
|
|
3959
|
-
var SessionReleaseScheduleRequestSchema =
|
|
4013
|
+
import { z as z67 } from "zod";
|
|
4014
|
+
var postPurchaseTaskNameSchema = (queue, id) => z67.string().regex(new RegExp(`^projects/[a-zA-Z0-9.:-]+/locations/us-central1/queues/${queue}/tasks/${id}$`));
|
|
4015
|
+
var SessionReleaseScheduleRequestSchema = z67.strictObject({
|
|
3960
4016
|
deadline: PostPurchaseTimestampSchema,
|
|
3961
4017
|
orderId: PostPurchaseOrderIdSchema,
|
|
3962
4018
|
releaseOwner: ReleaseOwnerSchema,
|
|
3963
4019
|
sessionId: PostPurchaseSessionIdSchema
|
|
3964
4020
|
});
|
|
3965
|
-
var SessionReleaseScheduleResponseSchema =
|
|
3966
|
-
data:
|
|
4021
|
+
var SessionReleaseScheduleResponseSchema = z67.object({
|
|
4022
|
+
data: z67.discriminatedUnion("status", [
|
|
3967
4023
|
SessionReleaseScheduleRequestSchema.extend({
|
|
3968
|
-
releaseOwner:
|
|
3969
|
-
status:
|
|
4024
|
+
releaseOwner: z67.literal("rebuy"),
|
|
4025
|
+
status: z67.literal("queued"),
|
|
3970
4026
|
taskName: postPurchaseTaskNameSchema("post-purchase-order-hold-release", "[a-f0-9]{64}-release")
|
|
3971
4027
|
}),
|
|
3972
4028
|
SessionReleaseScheduleRequestSchema.extend({
|
|
3973
|
-
releaseOwner:
|
|
3974
|
-
status:
|
|
4029
|
+
releaseOwner: z67.literal("shopify"),
|
|
4030
|
+
status: z67.literal("native")
|
|
3975
4031
|
})
|
|
3976
4032
|
]),
|
|
3977
|
-
successful:
|
|
4033
|
+
successful: z67.literal(true)
|
|
3978
4034
|
});
|
|
3979
4035
|
|
|
3980
4036
|
// src/schema/postPurchaseHealthSchedule.ts
|
|
@@ -3983,15 +4039,15 @@ var PostPurchaseHealthTaskNameSchema = postPurchaseTaskNameSchema(
|
|
|
3983
4039
|
"post-purchase-health-check",
|
|
3984
4040
|
"[a-z0-9][a-z0-9-]*--[1-9][0-9]*"
|
|
3985
4041
|
);
|
|
3986
|
-
var HealthScheduleAcknowledgementSchema =
|
|
4042
|
+
var HealthScheduleAcknowledgementSchema = z68.strictObject({
|
|
3987
4043
|
data: HealthScheduleSchema.extend({
|
|
3988
|
-
status:
|
|
4044
|
+
status: z68.literal("queued"),
|
|
3989
4045
|
taskName: PostPurchaseHealthTaskNameSchema
|
|
3990
4046
|
}).refine(
|
|
3991
4047
|
(data) => data.taskName.endsWith(`/tasks/${postPurchaseHealthTaskId(data)}`),
|
|
3992
4048
|
"taskName must be this order's health task"
|
|
3993
4049
|
),
|
|
3994
|
-
successful:
|
|
4050
|
+
successful: z68.literal(true)
|
|
3995
4051
|
});
|
|
3996
4052
|
|
|
3997
4053
|
// src/schema/postPurchaseHealth.ts
|
|
@@ -4000,90 +4056,90 @@ var HealthFactSchema = HealthScheduleSchema.pick({
|
|
|
4000
4056
|
operationId: true,
|
|
4001
4057
|
removePartialOrder: true
|
|
4002
4058
|
});
|
|
4003
|
-
var HealthScheduleReceiptSchema =
|
|
4059
|
+
var HealthScheduleReceiptSchema = z69.strictObject({
|
|
4004
4060
|
recordedAt: PostPurchaseTimestampSchema,
|
|
4005
4061
|
taskName: PostPurchaseHealthTaskNameSchema
|
|
4006
4062
|
});
|
|
4007
4063
|
var StoredHealthFactSchema = HealthFactSchema.extend({ scheduleReceipt: HealthScheduleReceiptSchema.optional() });
|
|
4008
4064
|
var HealthAttemptSchema = StoredHealthFactSchema.extend({
|
|
4009
4065
|
attemptedAt: PostPurchaseTimestampSchema,
|
|
4010
|
-
attemptId:
|
|
4011
|
-
status:
|
|
4066
|
+
attemptId: z69.uuid(),
|
|
4067
|
+
status: z69.literal("attempted")
|
|
4012
4068
|
});
|
|
4013
4069
|
var HealthResultSchema = HealthAttemptSchema.extend({
|
|
4014
4070
|
finishedAt: PostPurchaseTimestampSchema,
|
|
4015
|
-
status:
|
|
4071
|
+
status: z69.enum(["returned", "unknown"])
|
|
4016
4072
|
});
|
|
4017
|
-
var HealthStateSchema =
|
|
4018
|
-
StoredHealthFactSchema.extend({ status:
|
|
4073
|
+
var HealthStateSchema = z69.union([
|
|
4074
|
+
StoredHealthFactSchema.extend({ status: z69.literal("pending") }),
|
|
4019
4075
|
HealthAttemptSchema,
|
|
4020
4076
|
HealthResultSchema
|
|
4021
4077
|
]);
|
|
4022
4078
|
var HealthPrepareRequestSchema = DecideRequestSchema.extend({
|
|
4023
4079
|
operationId: HealthScheduleSchema.shape.operationId
|
|
4024
4080
|
}).strict();
|
|
4025
|
-
var HealthPrepareResponseSchema =
|
|
4026
|
-
var HealthClaimRequestSchema =
|
|
4081
|
+
var HealthPrepareResponseSchema = z69.object({ data: HealthScheduleSchema, successful: z69.literal(true) });
|
|
4082
|
+
var HealthClaimRequestSchema = z69.strictObject({
|
|
4027
4083
|
orderId: PostPurchaseOrderIdSchema,
|
|
4028
|
-
removePartialOrder:
|
|
4084
|
+
removePartialOrder: z69.boolean(),
|
|
4029
4085
|
shop: ShopifyDomainSchema
|
|
4030
4086
|
});
|
|
4031
4087
|
var HealthClaimFactSchema = HealthClaimRequestSchema.extend({
|
|
4032
4088
|
healthScheduledAt: HealthFactSchema.shape.healthScheduledAt
|
|
4033
4089
|
});
|
|
4034
|
-
var HealthClaimResponseSchema =
|
|
4035
|
-
data:
|
|
4036
|
-
|
|
4037
|
-
HealthClaimFactSchema.extend({ status:
|
|
4038
|
-
HealthClaimFactSchema.extend({ attemptId: HealthAttemptSchema.shape.attemptId, status:
|
|
4090
|
+
var HealthClaimResponseSchema = z69.object({
|
|
4091
|
+
data: z69.union([
|
|
4092
|
+
z69.strictObject({ status: z69.literal("missing") }),
|
|
4093
|
+
HealthClaimFactSchema.extend({ status: z69.enum(["pending", "attempted", "returned", "unknown"]) }),
|
|
4094
|
+
HealthClaimFactSchema.extend({ attemptId: HealthAttemptSchema.shape.attemptId, status: z69.literal("claimed") })
|
|
4039
4095
|
]),
|
|
4040
|
-
successful:
|
|
4096
|
+
successful: z69.literal(true)
|
|
4041
4097
|
});
|
|
4042
4098
|
var HealthResultRequestSchema = HealthClaimRequestSchema.extend({
|
|
4043
4099
|
attemptId: HealthAttemptSchema.shape.attemptId,
|
|
4044
4100
|
outcome: HealthResultSchema.shape.status
|
|
4045
4101
|
});
|
|
4046
|
-
var HealthResultResponseSchema =
|
|
4102
|
+
var HealthResultResponseSchema = z69.object({
|
|
4047
4103
|
data: HealthClaimFactSchema.extend({
|
|
4048
4104
|
finishedAt: HealthResultSchema.shape.finishedAt,
|
|
4049
4105
|
status: HealthResultSchema.shape.status
|
|
4050
4106
|
}),
|
|
4051
|
-
successful:
|
|
4107
|
+
successful: z69.literal(true)
|
|
4052
4108
|
});
|
|
4053
4109
|
|
|
4054
4110
|
// src/schema/postPurchaseLifecycle.ts
|
|
4055
|
-
import { z as
|
|
4056
|
-
var Presentation =
|
|
4111
|
+
import { z as z70 } from "zod";
|
|
4112
|
+
var Presentation = z70.strictObject({
|
|
4057
4113
|
member: PostPurchaseMemberIdentity,
|
|
4058
4114
|
selectedProductId: PostPurchaseMemberIdentity.shape.productId.optional(),
|
|
4059
4115
|
variant: PostPurchaseVariantSelector
|
|
4060
4116
|
});
|
|
4061
4117
|
var LifecycleObservationRequestSchema = DecideRequestSchema.extend({
|
|
4062
4118
|
entryRevision: PostPurchaseProgressSchema.shape.entryRevision,
|
|
4063
|
-
eventType:
|
|
4119
|
+
eventType: z70.enum(["OFFER_VIEWED", "OFFER_TIMER_EXPIRED"]),
|
|
4064
4120
|
presentation: Presentation.nullable(),
|
|
4065
4121
|
progressRevision: PostPurchaseProgressSchema.shape.revision,
|
|
4066
|
-
requestId:
|
|
4122
|
+
requestId: z70.uuid()
|
|
4067
4123
|
}).strict().refine(
|
|
4068
4124
|
({ eventType, presentation }) => eventType !== "OFFER_VIEWED" || presentation !== null,
|
|
4069
4125
|
"Viewed observations require a presented product"
|
|
4070
4126
|
);
|
|
4071
|
-
var LifecycleObservationResponseSchema =
|
|
4072
|
-
data:
|
|
4127
|
+
var LifecycleObservationResponseSchema = z70.object({
|
|
4128
|
+
data: z70.strictObject({
|
|
4073
4129
|
requestId: LifecycleObservationRequestSchema.shape.requestId,
|
|
4074
|
-
status:
|
|
4130
|
+
status: z70.union([AcceptedEventOutcomeSchema, z70.literal("unavailable")])
|
|
4075
4131
|
}),
|
|
4076
|
-
successful:
|
|
4132
|
+
successful: z70.literal(true)
|
|
4077
4133
|
});
|
|
4078
4134
|
|
|
4079
4135
|
// src/schema/postPurchaseOffer.ts
|
|
4080
|
-
import { z as
|
|
4136
|
+
import { z as z72 } from "zod";
|
|
4081
4137
|
|
|
4082
4138
|
// src/schema/postPurchaseSkipTrace.ts
|
|
4083
|
-
import { z as
|
|
4139
|
+
import { z as z71 } from "zod";
|
|
4084
4140
|
var POST_PURCHASE_SKIP_LIMIT = 32;
|
|
4085
|
-
var PostPurchaseSkipTraceSchema =
|
|
4086
|
-
|
|
4141
|
+
var PostPurchaseSkipTraceSchema = z71.array(
|
|
4142
|
+
z71.object({
|
|
4087
4143
|
entry: DecisionEntrySchema,
|
|
4088
4144
|
reason: PostPurchaseSkipReasonSchema
|
|
4089
4145
|
})
|
|
@@ -4091,66 +4147,66 @@ var PostPurchaseSkipTraceSchema = z70.array(
|
|
|
4091
4147
|
|
|
4092
4148
|
// src/schema/postPurchaseOffer.ts
|
|
4093
4149
|
var OfferPreparationRequestSchema = DecideRequestSchema.strict();
|
|
4094
|
-
var OfferPreparationResponseSchema =
|
|
4095
|
-
data:
|
|
4096
|
-
successful:
|
|
4150
|
+
var OfferPreparationResponseSchema = z72.object({
|
|
4151
|
+
data: z72.object({ attemptedSkips: PostPurchaseSkipTraceSchema.optional(), progress: PostPurchaseProgressSchema }),
|
|
4152
|
+
successful: z72.literal(true)
|
|
4097
4153
|
});
|
|
4098
4154
|
|
|
4099
4155
|
// src/schema/postPurchaseOfferEligibility.ts
|
|
4100
|
-
import { z as
|
|
4101
|
-
var
|
|
4102
|
-
var PostPurchaseOfferSkipReason =
|
|
4103
|
-
var PostPurchaseOfferEligibilityContext =
|
|
4156
|
+
import { z as z73 } from "zod";
|
|
4157
|
+
var selection2 = PreparedPostPurchaseProduct.shape.selection;
|
|
4158
|
+
var PostPurchaseOfferSkipReason = z73.enum(["empty", "no-eligible-subscription"]);
|
|
4159
|
+
var PostPurchaseOfferEligibilityContext = z73.object({
|
|
4104
4160
|
excludedProductIds: PostPurchaseExcludedProductIds,
|
|
4105
|
-
originalLineItems:
|
|
4161
|
+
originalLineItems: z73.array(selection2.pick({ productId: true, sellingPlanId: true, variantId: true }))
|
|
4106
4162
|
});
|
|
4107
|
-
var PostPurchaseOfferEligibility =
|
|
4108
|
-
|
|
4109
|
-
members:
|
|
4110
|
-
|
|
4163
|
+
var PostPurchaseOfferEligibility = z73.discriminatedUnion("status", [
|
|
4164
|
+
z73.object({
|
|
4165
|
+
members: z73.array(
|
|
4166
|
+
z73.object({ productId: selection2.shape.productId, productIndex: z73.number().int().nonnegative() })
|
|
4111
4167
|
),
|
|
4112
|
-
status:
|
|
4168
|
+
status: z73.literal("retain")
|
|
4113
4169
|
}),
|
|
4114
|
-
|
|
4115
|
-
|
|
4170
|
+
z73.object({ reason: PostPurchaseOfferSkipReason, status: z73.literal("skip") }),
|
|
4171
|
+
z73.object({ reason: z73.literal("eligible-upgrade").optional(), status: z73.literal("unavailable") })
|
|
4116
4172
|
]);
|
|
4117
4173
|
|
|
4118
4174
|
// src/schema/postPurchaseOfferPresentation.ts
|
|
4119
|
-
import { z as
|
|
4175
|
+
import { z as z74 } from "zod";
|
|
4120
4176
|
var language2 = PostPurchaseSettings.shape.language.shape.global.unwrap().unwrap();
|
|
4121
|
-
var PostPurchaseOfferPresentation =
|
|
4177
|
+
var PostPurchaseOfferPresentation = z74.strictObject({
|
|
4122
4178
|
labels: language2.pick({ declineAll: true, declineThisOffer: true }),
|
|
4123
4179
|
layout: PostPurchaseSettings.shape.offersLayout,
|
|
4124
4180
|
sections: CABRootSection.nullable(),
|
|
4125
4181
|
showDeclineAll: PostPurchaseSettings.shape.productOptions.shape.showDeclineAll
|
|
4126
4182
|
});
|
|
4127
4183
|
var OfferPresentationRequestSchema = DecideRequestSchema.strict();
|
|
4128
|
-
var OfferPresentationResponseSchema =
|
|
4129
|
-
data:
|
|
4184
|
+
var OfferPresentationResponseSchema = z74.object({
|
|
4185
|
+
data: z74.strictObject({
|
|
4130
4186
|
presentation: PostPurchaseOfferPresentation.nullable(),
|
|
4131
4187
|
progress: PostPurchaseProgressSchema.nullable(),
|
|
4132
4188
|
serverNow: PostPurchaseTimestampSchema
|
|
4133
4189
|
}),
|
|
4134
|
-
successful:
|
|
4190
|
+
successful: z74.literal(true)
|
|
4135
4191
|
});
|
|
4136
4192
|
|
|
4137
4193
|
// src/schema/postPurchaseOrderDecision.ts
|
|
4138
|
-
import { z as
|
|
4139
|
-
var OrderDecisionSchema =
|
|
4140
|
-
|
|
4141
|
-
|
|
4194
|
+
import { z as z75 } from "zod";
|
|
4195
|
+
var OrderDecisionSchema = z75.discriminatedUnion("owner", [
|
|
4196
|
+
z75.object({ owner: z75.literal("session"), sessionId: PostPurchaseSessionIdSchema }),
|
|
4197
|
+
z75.object({ owner: z75.literal("release"), sessionId: z75.null() })
|
|
4142
4198
|
]);
|
|
4143
4199
|
|
|
4144
4200
|
// src/schema/postPurchasePolicy.ts
|
|
4145
|
-
import { z as
|
|
4146
|
-
var HoldSettingSchema =
|
|
4147
|
-
|
|
4148
|
-
|
|
4201
|
+
import { z as z76 } from "zod";
|
|
4202
|
+
var HoldSettingSchema = z76.discriminatedUnion("enabled", [
|
|
4203
|
+
z76.object({ durationMinutes: z76.number().int().min(1).max(60), enabled: z76.literal(true) }),
|
|
4204
|
+
z76.object({ durationMinutes: z76.null(), enabled: z76.literal(false) })
|
|
4149
4205
|
]);
|
|
4150
|
-
var TimingSettingsSchema =
|
|
4206
|
+
var TimingSettingsSchema = z76.object({ flowHold: HoldSettingSchema, shopHold: HoldSettingSchema });
|
|
4151
4207
|
var SessionPolicySchema = TimingSettingsSchema.extend({
|
|
4152
|
-
durationMinutes:
|
|
4153
|
-
source:
|
|
4208
|
+
durationMinutes: z76.number().int().min(1).max(60).nullable(),
|
|
4209
|
+
source: z76.enum(["shop", "flow", "native"])
|
|
4154
4210
|
}).refine(
|
|
4155
4211
|
(policy) => {
|
|
4156
4212
|
const expectedSource = policy.shopHold.enabled ? "shop" : policy.flowHold.enabled ? "flow" : "native";
|
|
@@ -4164,8 +4220,8 @@ var SessionPolicySchema = TimingSettingsSchema.extend({
|
|
|
4164
4220
|
);
|
|
4165
4221
|
|
|
4166
4222
|
// src/schema/postPurchasePreparationOptions.ts
|
|
4167
|
-
import { z as
|
|
4168
|
-
var PostPurchasePreparationOptions =
|
|
4223
|
+
import { z as z77 } from "zod";
|
|
4224
|
+
var PostPurchasePreparationOptions = z77.object({
|
|
4169
4225
|
choice: PostPurchaseChoice.optional(),
|
|
4170
4226
|
member: PostPurchaseMemberSelector.strict().optional(),
|
|
4171
4227
|
quantity: PreparedPostPurchaseProduct.shape.selection.shape.quantity.optional(),
|
|
@@ -4177,8 +4233,8 @@ var PostPurchasePreparationOptions = z76.object({
|
|
|
4177
4233
|
);
|
|
4178
4234
|
|
|
4179
4235
|
// src/schema/postPurchaseProductSettings.ts
|
|
4180
|
-
import { z as
|
|
4181
|
-
var amount =
|
|
4236
|
+
import { z as z78 } from "zod";
|
|
4237
|
+
var amount = z78.union([z78.number().nonnegative(), PostPurchaseAmount.transform(Number)]);
|
|
4182
4238
|
var PostPurchaseProductSettings = PostPurchaseSettings.pick({
|
|
4183
4239
|
discountedFrom: true,
|
|
4184
4240
|
language: true,
|
|
@@ -4190,62 +4246,66 @@ var PostPurchaseProductSettings = PostPurchaseSettings.pick({
|
|
|
4190
4246
|
subscriptionIsDefault: true,
|
|
4191
4247
|
upgradeToSubscription: true
|
|
4192
4248
|
}).extend({
|
|
4193
|
-
advance:
|
|
4194
|
-
blocks:
|
|
4249
|
+
advance: z78.unknown().default({}),
|
|
4250
|
+
blocks: z78.array(z78.unknown()).optional(),
|
|
4195
4251
|
discount: PostPurchaseSettings.shape.discount.extend({ amount: amount.default(30) }),
|
|
4196
|
-
integrations:
|
|
4252
|
+
integrations: z78.unknown().default({}),
|
|
4197
4253
|
shipping: PostPurchaseSettings.shape.shipping.extend({ amount: amount.default(10) }),
|
|
4198
|
-
styles:
|
|
4254
|
+
styles: z78.unknown().default({}),
|
|
4199
4255
|
subImages: PostPurchaseSettings.shape.subImages.catch(null),
|
|
4200
|
-
subscription:
|
|
4256
|
+
subscription: z78.unknown().default(PostPurchaseSettings.shape.subscription.parse(void 0))
|
|
4201
4257
|
});
|
|
4202
4258
|
|
|
4203
4259
|
// src/schema/postPurchaseRecovery.ts
|
|
4204
|
-
import { z as
|
|
4260
|
+
import { z as z79 } from "zod";
|
|
4205
4261
|
var PurchaseRecoveryRequestSchema = DecideRequestSchema.strict();
|
|
4206
|
-
var PurchaseRecoveryResponseSchema =
|
|
4207
|
-
data:
|
|
4208
|
-
operation:
|
|
4262
|
+
var PurchaseRecoveryResponseSchema = z79.object({
|
|
4263
|
+
data: z79.object({
|
|
4264
|
+
operation: z79.object({
|
|
4209
4265
|
observation: RecordedPurchaseObservationSchema.nullable(),
|
|
4210
|
-
operationId: PurchaseReceiptSchema.shape.operationId
|
|
4211
|
-
|
|
4266
|
+
operationId: PurchaseReceiptSchema.shape.operationId,
|
|
4267
|
+
upgrade: UpgradeProgressSchema.optional()
|
|
4268
|
+
}).strict().refine(({ operationId, upgrade }) => !upgrade || upgrade.operationId === operationId, {
|
|
4269
|
+
message: "Upgrade progress belongs to its operation",
|
|
4270
|
+
path: ["upgrade", "operationId"]
|
|
4271
|
+
}).nullable(),
|
|
4212
4272
|
progress: PostPurchaseProgressSchema.nullable().optional()
|
|
4213
4273
|
}),
|
|
4214
|
-
successful:
|
|
4274
|
+
successful: z79.literal(true)
|
|
4215
4275
|
});
|
|
4216
4276
|
|
|
4217
4277
|
// src/schema/postPurchaseReleaseClaim.ts
|
|
4218
|
-
import { z as
|
|
4278
|
+
import { z as z80 } from "zod";
|
|
4219
4279
|
var ReleaseClaimRequestSchema = ReleaseAuthorityRequestSchema;
|
|
4220
|
-
var ReleaseClaimResponseSchema =
|
|
4221
|
-
data:
|
|
4222
|
-
|
|
4280
|
+
var ReleaseClaimResponseSchema = z80.object({
|
|
4281
|
+
data: z80.discriminatedUnion("status", [
|
|
4282
|
+
z80.object({ status: z80.literal("release-permitted") }),
|
|
4223
4283
|
PendingReleaseAuthoritySchema,
|
|
4224
4284
|
ReadyReleaseAuthoritySchema
|
|
4225
4285
|
]),
|
|
4226
|
-
successful:
|
|
4286
|
+
successful: z80.literal(true)
|
|
4227
4287
|
});
|
|
4228
4288
|
|
|
4229
4289
|
// src/schema/postPurchaseSelection.ts
|
|
4230
|
-
import { z as
|
|
4290
|
+
import { z as z81 } from "zod";
|
|
4231
4291
|
var SelectionClaimsSchema = DecideRequestSchema.extend({
|
|
4232
4292
|
appId: PostPurchaseAppIdSchema,
|
|
4233
4293
|
entry: DecisionEntrySchema,
|
|
4234
|
-
iss:
|
|
4235
|
-
purpose:
|
|
4294
|
+
iss: z81.literal("rebuy-api"),
|
|
4295
|
+
purpose: z81.literal("post-purchase-selection")
|
|
4236
4296
|
});
|
|
4237
4297
|
var SessionStartRequestSchema = DecideRequestSchema.extend({
|
|
4238
|
-
selectionToken:
|
|
4298
|
+
selectionToken: z81.string().min(1).max(8192).optional()
|
|
4239
4299
|
}).strict();
|
|
4240
4300
|
|
|
4241
4301
|
// src/schema/postPurchaseSession.ts
|
|
4242
|
-
import { z as
|
|
4302
|
+
import { z as z82 } from "zod";
|
|
4243
4303
|
var SessionIdentitySchema = DecideRequestSchema.extend({ appId: PostPurchaseAppIdSchema });
|
|
4244
|
-
var SessionOrderTimingSchema =
|
|
4304
|
+
var SessionOrderTimingSchema = z82.object({
|
|
4245
4305
|
nativeDeadline: PostPurchaseTimestampSchema,
|
|
4246
4306
|
orderCreatedAt: PostPurchaseTimestampSchema,
|
|
4247
4307
|
orderId: PostPurchaseOrderIdSchema,
|
|
4248
|
-
timingSource:
|
|
4308
|
+
timingSource: z82.literal("shopify-order-created-at")
|
|
4249
4309
|
});
|
|
4250
4310
|
var ReadySessionTimingSchema = SessionOrderTimingSchema.extend({
|
|
4251
4311
|
deadline: PostPurchaseTimestampSchema,
|
|
@@ -4262,33 +4322,33 @@ var ReadySessionTimingSchema = SessionOrderTimingSchema.extend({
|
|
|
4262
4322
|
message: "deadline must not exceed nativeDeadline",
|
|
4263
4323
|
path: ["deadline"]
|
|
4264
4324
|
});
|
|
4265
|
-
var SessionStartResponseSchema =
|
|
4266
|
-
data:
|
|
4267
|
-
phase:
|
|
4325
|
+
var SessionStartResponseSchema = z82.object({
|
|
4326
|
+
data: z82.object({
|
|
4327
|
+
phase: z82.literal("render"),
|
|
4268
4328
|
serverNow: PostPurchaseTimestampSchema,
|
|
4269
4329
|
session: ReadySessionTimingSchema,
|
|
4270
|
-
workflowPhase:
|
|
4330
|
+
workflowPhase: z82.literal("start")
|
|
4271
4331
|
}),
|
|
4272
|
-
successful:
|
|
4332
|
+
successful: z82.literal(true)
|
|
4273
4333
|
});
|
|
4274
4334
|
|
|
4275
4335
|
// src/schema/postPurchaseShadow.ts
|
|
4276
|
-
import { z as
|
|
4277
|
-
var PostPurchaseShadowSelectionSchema =
|
|
4278
|
-
|
|
4279
|
-
|
|
4336
|
+
import { z as z83 } from "zod";
|
|
4337
|
+
var PostPurchaseShadowSelectionSchema = z83.discriminatedUnion("verdict", [
|
|
4338
|
+
z83.object({ entry: DecisionEntrySchema, verdict: z83.literal("render") }),
|
|
4339
|
+
z83.object({ verdict: z83.literal("skip") })
|
|
4280
4340
|
]);
|
|
4281
|
-
var PostPurchaseShadowReportFields =
|
|
4282
|
-
differences:
|
|
4341
|
+
var PostPurchaseShadowReportFields = z83.object({
|
|
4342
|
+
differences: z83.array(z83.enum(["verdict", "entry", "targeting", "incomplete-capture", "unsupported-configuration"])).refine((differences) => new Set(differences).size === differences.length, {
|
|
4283
4343
|
message: "differences must not contain duplicate entries"
|
|
4284
4344
|
}),
|
|
4285
4345
|
legacySelection: PostPurchaseShadowSelectionSchema,
|
|
4286
|
-
phase:
|
|
4287
|
-
sampleId:
|
|
4346
|
+
phase: z83.literal("shouldRender"),
|
|
4347
|
+
sampleId: z83.string(),
|
|
4288
4348
|
serverSelection: PostPurchaseShadowSelectionSchema.optional(),
|
|
4289
|
-
status:
|
|
4290
|
-
targetingFlowIds:
|
|
4291
|
-
workflowPhase:
|
|
4349
|
+
status: z83.enum(["match", "diverged", "incomplete"]),
|
|
4350
|
+
targetingFlowIds: z83.array(z83.number().int().positive()),
|
|
4351
|
+
workflowPhase: z83.literal("decide")
|
|
4292
4352
|
});
|
|
4293
4353
|
var PostPurchaseShadowReportSchema = PostPurchaseShadowReportFields.refine(
|
|
4294
4354
|
(report) => report.status !== "match" || report.differences.length === 0,
|
|
@@ -4302,20 +4362,20 @@ var PostPurchaseShadowReportSchema = PostPurchaseShadowReportFields.refine(
|
|
|
4302
4362
|
});
|
|
4303
4363
|
|
|
4304
4364
|
// src/schema/postPurchaseSubscriptionDisplay.ts
|
|
4305
|
-
import { z as
|
|
4306
|
-
var Minor2 =
|
|
4307
|
-
var PostPurchaseSubscriptionDisplay =
|
|
4365
|
+
import { z as z84 } from "zod";
|
|
4366
|
+
var Minor2 = z84.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER);
|
|
4367
|
+
var PostPurchaseSubscriptionDisplay = z84.object({
|
|
4308
4368
|
comparisonMinor: Minor2,
|
|
4309
|
-
currencyCode:
|
|
4369
|
+
currencyCode: z84.string().regex(/^[A-Z]{3}$/),
|
|
4310
4370
|
priceMinor: Minor2,
|
|
4311
4371
|
savingMinor: Minor2,
|
|
4312
|
-
savingPercent:
|
|
4372
|
+
savingPercent: z84.number().int().min(0).max(100)
|
|
4313
4373
|
});
|
|
4314
4374
|
|
|
4315
4375
|
// src/schema/postPurchaseSubscriptionProduct.ts
|
|
4316
|
-
import { z as
|
|
4376
|
+
import { z as z85 } from "zod";
|
|
4317
4377
|
var PreparedPostPurchaseSubscription = PreparedPostPurchaseProduct.extend({
|
|
4318
|
-
selection: PreparedPostPurchaseProduct.shape.selection.extend({ sellingPlanId:
|
|
4378
|
+
selection: PreparedPostPurchaseProduct.shape.selection.extend({ sellingPlanId: z85.number().int().positive() }),
|
|
4319
4379
|
terms: PreparedPostPurchaseProduct.shape.terms.extend({
|
|
4320
4380
|
subscription: PostPurchaseSubscriptionTerms
|
|
4321
4381
|
}).refine(
|
|
@@ -4328,108 +4388,108 @@ var readPostPurchaseSubscription = (prepared) => {
|
|
|
4328
4388
|
};
|
|
4329
4389
|
|
|
4330
4390
|
// src/schema/postPurchaseTransition.ts
|
|
4331
|
-
import { z as
|
|
4391
|
+
import { z as z86 } from "zod";
|
|
4332
4392
|
var OfferTransitionRequestSchema = DecideRequestSchema.extend({
|
|
4333
4393
|
entryRevision: PostPurchaseProgressSchema.shape.entryRevision,
|
|
4334
4394
|
progressRevision: PostPurchaseProgressSchema.shape.revision
|
|
4335
4395
|
}).strict();
|
|
4336
|
-
var OfferTransitionResponseSchema =
|
|
4337
|
-
data:
|
|
4396
|
+
var OfferTransitionResponseSchema = z86.object({
|
|
4397
|
+
data: z86.object({
|
|
4338
4398
|
attemptedSkips: PostPurchaseSkipTraceSchema.optional(),
|
|
4339
4399
|
progress: PostPurchaseProgressSchema,
|
|
4340
|
-
status:
|
|
4400
|
+
status: z86.enum(["advanced", "no-child", "unavailable"])
|
|
4341
4401
|
}),
|
|
4342
|
-
successful:
|
|
4402
|
+
successful: z86.literal(true)
|
|
4343
4403
|
});
|
|
4344
4404
|
|
|
4345
4405
|
// src/schema/postPurchaseVariantDefault.ts
|
|
4346
|
-
import { z as
|
|
4406
|
+
import { z as z87 } from "zod";
|
|
4347
4407
|
var values = PostPurchaseVariantValues.partial().extend({
|
|
4348
4408
|
option1: PostPurchaseVariantValues.shape.option1.nullish()
|
|
4349
4409
|
});
|
|
4350
4410
|
var variant = values.extend({
|
|
4351
4411
|
id: PostPurchaseVariantId,
|
|
4352
|
-
inventoryManagement:
|
|
4353
|
-
inventoryPolicy:
|
|
4354
|
-
inventoryQuantity:
|
|
4412
|
+
inventoryManagement: z87.string().nullable(),
|
|
4413
|
+
inventoryPolicy: z87.string(),
|
|
4414
|
+
inventoryQuantity: z87.number()
|
|
4355
4415
|
});
|
|
4356
|
-
var options =
|
|
4357
|
-
var PostPurchaseVariantDefaultProduct =
|
|
4416
|
+
var options = z87.array(PostPurchaseVariantOption.pick({ name: true, values: true }));
|
|
4417
|
+
var PostPurchaseVariantDefaultProduct = z87.object({
|
|
4358
4418
|
id: PostPurchaseProductId,
|
|
4359
4419
|
options,
|
|
4360
4420
|
selectedVariant: variant.optional(),
|
|
4361
|
-
variants:
|
|
4421
|
+
variants: z87.array(variant)
|
|
4362
4422
|
});
|
|
4363
4423
|
var PostPurchaseVariantDefaultSettings = PostPurchaseSettings.shape.productOptions.pick({
|
|
4364
4424
|
hideOutOfStockVariants: true,
|
|
4365
4425
|
matchVariant: true
|
|
4366
4426
|
});
|
|
4367
|
-
var PostPurchaseOrderAttributes =
|
|
4368
|
-
var PostPurchaseOriginalVariants =
|
|
4369
|
-
|
|
4427
|
+
var PostPurchaseOrderAttributes = z87.record(z87.string(), z87.array(z87.string())).default({});
|
|
4428
|
+
var PostPurchaseOriginalVariants = z87.array(
|
|
4429
|
+
z87.object({ productId: PostPurchaseProductId, variantId: PostPurchaseVariantId })
|
|
4370
4430
|
);
|
|
4371
|
-
var PostPurchaseAttributeProducts =
|
|
4372
|
-
|
|
4431
|
+
var PostPurchaseAttributeProducts = z87.array(
|
|
4432
|
+
z87.object({ id: PostPurchaseProductId, options, variants: z87.array(values.extend({ id: PostPurchaseVariantId })) })
|
|
4373
4433
|
);
|
|
4374
4434
|
|
|
4375
4435
|
// src/schema/postPurchaseVariantDefaultContext.ts
|
|
4376
|
-
import { z as
|
|
4377
|
-
var PostPurchaseVariantDefaultContext =
|
|
4378
|
-
enrichedLineItems:
|
|
4436
|
+
import { z as z88 } from "zod";
|
|
4437
|
+
var PostPurchaseVariantDefaultContext = z88.object({
|
|
4438
|
+
enrichedLineItems: z88.unknown().optional(),
|
|
4379
4439
|
originalVariants: PostPurchaseOriginalVariants
|
|
4380
4440
|
});
|
|
4381
4441
|
|
|
4382
4442
|
// src/schema/shopConfig.ts
|
|
4383
|
-
import { z as
|
|
4384
|
-
var ShopConfig =
|
|
4385
|
-
activeExperiments:
|
|
4386
|
-
|
|
4387
|
-
data:
|
|
4388
|
-
|
|
4389
|
-
aliasName:
|
|
4390
|
-
cssInput:
|
|
4391
|
-
elementId:
|
|
4392
|
-
id:
|
|
4393
|
-
javascriptInput:
|
|
4394
|
-
traffic:
|
|
4443
|
+
import { z as z89 } from "zod";
|
|
4444
|
+
var ShopConfig = z89.object({
|
|
4445
|
+
activeExperiments: z89.array(
|
|
4446
|
+
z89.object({
|
|
4447
|
+
data: z89.array(
|
|
4448
|
+
z89.object({
|
|
4449
|
+
aliasName: z89.string(),
|
|
4450
|
+
cssInput: z89.string().nullish(),
|
|
4451
|
+
elementId: z89.coerce.number(),
|
|
4452
|
+
id: z89.coerce.number(),
|
|
4453
|
+
javascriptInput: z89.string().nullish(),
|
|
4454
|
+
traffic: z89.coerce.number()
|
|
4395
4455
|
})
|
|
4396
4456
|
),
|
|
4397
|
-
id:
|
|
4398
|
-
name:
|
|
4399
|
-
pageTarget:
|
|
4400
|
-
pageTargetUrl:
|
|
4401
|
-
placeholderId:
|
|
4402
|
-
type:
|
|
4457
|
+
id: z89.coerce.number(),
|
|
4458
|
+
name: z89.string(),
|
|
4459
|
+
pageTarget: z89.string().nullable(),
|
|
4460
|
+
pageTargetUrl: z89.string().nullable(),
|
|
4461
|
+
placeholderId: z89.coerce.number().nullable(),
|
|
4462
|
+
type: z89.string()
|
|
4403
4463
|
})
|
|
4404
4464
|
),
|
|
4405
|
-
activePackages:
|
|
4406
|
-
|
|
4407
|
-
cancelledAt:
|
|
4408
|
-
id:
|
|
4409
|
-
installedAt:
|
|
4410
|
-
isActive:
|
|
4411
|
-
isBillable:
|
|
4412
|
-
packageId:
|
|
4413
|
-
packageName:
|
|
4414
|
-
shortName:
|
|
4415
|
-
trialDays:
|
|
4416
|
-
uninstalledAt:
|
|
4465
|
+
activePackages: z89.array(
|
|
4466
|
+
z89.object({
|
|
4467
|
+
cancelledAt: z89.string().nullable(),
|
|
4468
|
+
id: z89.number(),
|
|
4469
|
+
installedAt: z89.string().nullable(),
|
|
4470
|
+
isActive: z89.boolean(),
|
|
4471
|
+
isBillable: z89.boolean(),
|
|
4472
|
+
packageId: z89.number(),
|
|
4473
|
+
packageName: z89.string(),
|
|
4474
|
+
shortName: z89.string(),
|
|
4475
|
+
trialDays: z89.number(),
|
|
4476
|
+
uninstalledAt: z89.string().nullable()
|
|
4417
4477
|
})
|
|
4418
4478
|
),
|
|
4419
|
-
apiKey:
|
|
4420
|
-
billingVersion:
|
|
4421
|
-
cacheKey:
|
|
4422
|
-
carousel:
|
|
4423
|
-
currency:
|
|
4424
|
-
currencySymbol:
|
|
4425
|
-
domain:
|
|
4426
|
-
enabledJquery:
|
|
4427
|
-
enabledPresentmentCurrencies:
|
|
4428
|
-
hasSmartCollectionsEnabled:
|
|
4429
|
-
hasSmartSearchEnabled:
|
|
4430
|
-
id:
|
|
4431
|
-
integrations:
|
|
4432
|
-
|
|
4479
|
+
apiKey: z89.string(),
|
|
4480
|
+
billingVersion: z89.string().nullable(),
|
|
4481
|
+
cacheKey: z89.coerce.number(),
|
|
4482
|
+
carousel: z89.enum(["flickity", "splide"]),
|
|
4483
|
+
currency: z89.string(),
|
|
4484
|
+
currencySymbol: z89.string(),
|
|
4485
|
+
domain: z89.string(),
|
|
4486
|
+
enabledJquery: z89.boolean(),
|
|
4487
|
+
enabledPresentmentCurrencies: z89.array(z89.string()),
|
|
4488
|
+
hasSmartCollectionsEnabled: z89.boolean(),
|
|
4489
|
+
hasSmartSearchEnabled: z89.boolean(),
|
|
4490
|
+
id: z89.coerce.number(),
|
|
4491
|
+
integrations: z89.record(
|
|
4492
|
+
z89.enum([
|
|
4433
4493
|
"attentive",
|
|
4434
4494
|
"judgeme",
|
|
4435
4495
|
"junip",
|
|
@@ -4442,170 +4502,170 @@ var ShopConfig = z88.object({
|
|
|
4442
4502
|
"stamped",
|
|
4443
4503
|
"yotpo"
|
|
4444
4504
|
]),
|
|
4445
|
-
|
|
4505
|
+
z89.union([z89.boolean(), z89.unknown()])
|
|
4446
4506
|
),
|
|
4447
|
-
markets:
|
|
4448
|
-
enabled:
|
|
4507
|
+
markets: z89.object({
|
|
4508
|
+
enabled: z89.boolean()
|
|
4449
4509
|
}),
|
|
4450
|
-
monetize:
|
|
4451
|
-
publisherKey:
|
|
4510
|
+
monetize: z89.object({
|
|
4511
|
+
publisherKey: z89.string().nullable()
|
|
4452
4512
|
}).nullish(),
|
|
4453
|
-
moneyFormat:
|
|
4454
|
-
myshopifyDomain:
|
|
4455
|
-
primaryLocale:
|
|
4456
|
-
productGroupsEnabled:
|
|
4457
|
-
rechargeCustomDomain:
|
|
4458
|
-
sellingPlansEnabled:
|
|
4459
|
-
shopId:
|
|
4460
|
-
shopifySellingPlansEnabled:
|
|
4461
|
-
shopName:
|
|
4462
|
-
storefrontAccessToken:
|
|
4463
|
-
useRebuyIcons:
|
|
4513
|
+
moneyFormat: z89.string(),
|
|
4514
|
+
myshopifyDomain: z89.string(),
|
|
4515
|
+
primaryLocale: z89.string(),
|
|
4516
|
+
productGroupsEnabled: z89.enum(["no", "yes"]).transform((value) => value === "yes"),
|
|
4517
|
+
rechargeCustomDomain: z89.string().nullable(),
|
|
4518
|
+
sellingPlansEnabled: z89.boolean(),
|
|
4519
|
+
shopId: z89.number(),
|
|
4520
|
+
shopifySellingPlansEnabled: z89.boolean(),
|
|
4521
|
+
shopName: z89.string(),
|
|
4522
|
+
storefrontAccessToken: z89.string().nullable(),
|
|
4523
|
+
useRebuyIcons: z89.boolean()
|
|
4464
4524
|
});
|
|
4465
4525
|
|
|
4466
4526
|
// src/schema/userConfig.ts
|
|
4467
|
-
import { z as
|
|
4468
|
-
var UserConfig =
|
|
4527
|
+
import { z as z90 } from "zod";
|
|
4528
|
+
var UserConfig = z90.object({
|
|
4469
4529
|
shop: ShopConfig,
|
|
4470
4530
|
/**
|
|
4471
4531
|
* `.catch(undefined)` is the safety bar: smart-cart shape drift can NEVER fail `fetchUserConfig`,
|
|
4472
4532
|
* which resolves the apiKey for every offers/monetize/analytics/gift request.
|
|
4473
4533
|
*/
|
|
4474
4534
|
smartCart: SmartCartConfig.nullish().catch(void 0),
|
|
4475
|
-
smartFlows:
|
|
4535
|
+
smartFlows: z90.array(z90.unknown())
|
|
4476
4536
|
});
|
|
4477
4537
|
|
|
4478
4538
|
// src/schema/widgetData.ts
|
|
4479
|
-
import { z as
|
|
4539
|
+
import { z as z99 } from "zod";
|
|
4480
4540
|
|
|
4481
4541
|
// src/schema/widgets/abTestingPlaceholder.ts
|
|
4482
|
-
import { z as
|
|
4483
|
-
var ABTestingPlaceholder =
|
|
4484
|
-
type:
|
|
4542
|
+
import { z as z91 } from "zod";
|
|
4543
|
+
var ABTestingPlaceholder = z91.looseObject({
|
|
4544
|
+
type: z91.literal("placeholder")
|
|
4485
4545
|
});
|
|
4486
4546
|
|
|
4487
4547
|
// src/schema/widgets/checkoutExtension.ts
|
|
4488
|
-
import { z as
|
|
4489
|
-
var CheckoutExtension =
|
|
4490
|
-
type:
|
|
4548
|
+
import { z as z92 } from "zod";
|
|
4549
|
+
var CheckoutExtension = z92.looseObject({
|
|
4550
|
+
type: z92.literal(WidgetType.shopify_checkout_extension).default(WidgetType.shopify_checkout_extension)
|
|
4491
4551
|
});
|
|
4492
4552
|
|
|
4493
4553
|
// src/schema/widgets/contentBlock.ts
|
|
4494
|
-
import { z as
|
|
4495
|
-
var ContentBlockV1 =
|
|
4496
|
-
blockSpacing:
|
|
4497
|
-
imageBlocks:
|
|
4498
|
-
|
|
4499
|
-
|
|
4500
|
-
altText:
|
|
4501
|
-
description:
|
|
4502
|
-
id:
|
|
4503
|
-
imagePlacement:
|
|
4504
|
-
imageSize:
|
|
4505
|
-
imageUrl:
|
|
4506
|
-
textAlignment:
|
|
4554
|
+
import { z as z93 } from "zod";
|
|
4555
|
+
var ContentBlockV1 = z93.object({
|
|
4556
|
+
blockSpacing: z93.enum(spacings).optional(),
|
|
4557
|
+
imageBlocks: z93.union([
|
|
4558
|
+
z93.array(
|
|
4559
|
+
z93.object({
|
|
4560
|
+
altText: z93.string().nullable(),
|
|
4561
|
+
description: z93.string().nullable(),
|
|
4562
|
+
id: z93.uuid(),
|
|
4563
|
+
imagePlacement: z93.enum(["top", "right", "bottom", "left"]),
|
|
4564
|
+
imageSize: z93.number(),
|
|
4565
|
+
imageUrl: z93.url(),
|
|
4566
|
+
textAlignment: z93.enum(["left", "center", "right"]),
|
|
4507
4567
|
/** Inline scale only: an image caption can never be a block-level heading. */
|
|
4508
|
-
textSize:
|
|
4568
|
+
textSize: z93.enum(inlineTextSizeNames)
|
|
4509
4569
|
})
|
|
4510
4570
|
),
|
|
4511
|
-
|
|
4571
|
+
z93.strictObject({}).transform(() => [])
|
|
4512
4572
|
]).optional(),
|
|
4513
|
-
imageLayout:
|
|
4514
|
-
language:
|
|
4515
|
-
description:
|
|
4516
|
-
superTitle:
|
|
4517
|
-
title:
|
|
4573
|
+
imageLayout: z93.enum(["row", "column"]).optional(),
|
|
4574
|
+
language: z93.object({
|
|
4575
|
+
description: z93.string(),
|
|
4576
|
+
superTitle: z93.string(),
|
|
4577
|
+
title: z93.string()
|
|
4518
4578
|
}),
|
|
4519
|
-
previewMode:
|
|
4520
|
-
type:
|
|
4521
|
-
version:
|
|
4579
|
+
previewMode: z93.boolean(),
|
|
4580
|
+
type: z93.literal(WidgetType.ui_extension_content_block).default(WidgetType.ui_extension_content_block),
|
|
4581
|
+
version: z93.literal(1)
|
|
4522
4582
|
});
|
|
4523
|
-
var ContentBlock =
|
|
4583
|
+
var ContentBlock = z93.discriminatedUnion("version", [
|
|
4524
4584
|
ContentBlockV1,
|
|
4525
4585
|
CABRootSection.extend({
|
|
4526
|
-
type:
|
|
4586
|
+
type: z93.literal(WidgetType.ui_extension_content_block).default(WidgetType.ui_extension_content_block)
|
|
4527
4587
|
})
|
|
4528
4588
|
]);
|
|
4529
4589
|
|
|
4530
4590
|
// src/schema/widgets/giftWithPurchase.ts
|
|
4531
|
-
import { z as
|
|
4532
|
-
var GiftWithPurchase =
|
|
4533
|
-
type:
|
|
4591
|
+
import { z as z94 } from "zod";
|
|
4592
|
+
var GiftWithPurchase = z94.looseObject({
|
|
4593
|
+
type: z94.literal(WidgetType.gift_with_purchase).default(WidgetType.gift_with_purchase)
|
|
4534
4594
|
});
|
|
4535
4595
|
|
|
4536
4596
|
// src/schema/widgets/lineItemEditor.ts
|
|
4537
|
-
import { z as
|
|
4538
|
-
var LineItemEditorSwitchLanguageV1 =
|
|
4539
|
-
downgradeToOneTimeLabel:
|
|
4597
|
+
import { z as z95 } from "zod";
|
|
4598
|
+
var LineItemEditorSwitchLanguageV1 = z95.object({
|
|
4599
|
+
downgradeToOneTimeLabel: z95.string().optional(),
|
|
4540
4600
|
/** Frequency-option template (`{{frequency}}`/`{{interval}}`) for the plan select. */
|
|
4541
|
-
subscriptionOptionLabel:
|
|
4542
|
-
upgradeToSubscriptionLabel:
|
|
4543
|
-
upgradeToSubscriptionWithoutDiscountLabel:
|
|
4601
|
+
subscriptionOptionLabel: z95.string().optional(),
|
|
4602
|
+
upgradeToSubscriptionLabel: z95.string().optional(),
|
|
4603
|
+
upgradeToSubscriptionWithoutDiscountLabel: z95.string().optional()
|
|
4544
4604
|
});
|
|
4545
|
-
var LineItemEditorV1 =
|
|
4605
|
+
var LineItemEditorV1 = z95.object({
|
|
4546
4606
|
/** Legacy `getStyles` button style; the converter carries a valid kind, defaulting to `plain`. */
|
|
4547
|
-
button:
|
|
4548
|
-
previewMode:
|
|
4549
|
-
switchToSubscription:
|
|
4550
|
-
disableDowngrade:
|
|
4607
|
+
button: z95.object({ kind: z95.enum(["plain", "primary", "secondary"]).optional() }).optional(),
|
|
4608
|
+
previewMode: z95.boolean().optional(),
|
|
4609
|
+
switchToSubscription: z95.object({
|
|
4610
|
+
disableDowngrade: z95.boolean().optional(),
|
|
4551
4611
|
language: LineItemEditorSwitchLanguageV1.optional()
|
|
4552
4612
|
}).optional(),
|
|
4553
|
-
switchToSubscriptionEnabled:
|
|
4554
|
-
tracking:
|
|
4555
|
-
enableAttribution:
|
|
4556
|
-
enableSource:
|
|
4557
|
-
enableWidget:
|
|
4613
|
+
switchToSubscriptionEnabled: z95.boolean().optional(),
|
|
4614
|
+
tracking: z95.object({
|
|
4615
|
+
enableAttribution: z95.boolean().optional(),
|
|
4616
|
+
enableSource: z95.boolean().optional(),
|
|
4617
|
+
enableWidget: z95.boolean().optional()
|
|
4558
4618
|
}).optional(),
|
|
4559
|
-
type:
|
|
4560
|
-
version:
|
|
4619
|
+
type: z95.literal(WidgetType.ui_extension_line_item_editor).default(WidgetType.ui_extension_line_item_editor),
|
|
4620
|
+
version: z95.literal(1)
|
|
4561
4621
|
});
|
|
4562
|
-
var LineItemEditor =
|
|
4622
|
+
var LineItemEditor = z95.discriminatedUnion("version", [
|
|
4563
4623
|
LineItemEditorV1,
|
|
4564
4624
|
CABRootSection.extend({
|
|
4565
|
-
type:
|
|
4625
|
+
type: z95.literal(WidgetType.ui_extension_line_item_editor).default(WidgetType.ui_extension_line_item_editor)
|
|
4566
4626
|
})
|
|
4567
4627
|
]);
|
|
4568
4628
|
|
|
4569
4629
|
// src/schema/widgets/progressBar.ts
|
|
4570
|
-
import { z as
|
|
4571
|
-
var ProgressBar =
|
|
4572
|
-
type:
|
|
4630
|
+
import { z as z96 } from "zod";
|
|
4631
|
+
var ProgressBar = z96.looseObject({
|
|
4632
|
+
type: z96.literal(WidgetType.ui_extension_progress_bar).default(WidgetType.ui_extension_progress_bar)
|
|
4573
4633
|
});
|
|
4574
4634
|
|
|
4575
4635
|
// src/schema/widgets/rebuyButton.ts
|
|
4576
|
-
import { z as
|
|
4577
|
-
var RebuyButtonV1 =
|
|
4578
|
-
type:
|
|
4579
|
-
version:
|
|
4636
|
+
import { z as z97 } from "zod";
|
|
4637
|
+
var RebuyButtonV1 = z97.looseObject({
|
|
4638
|
+
type: z97.literal(WidgetType.ui_extension_button).default(WidgetType.ui_extension_button),
|
|
4639
|
+
version: z97.literal(1)
|
|
4580
4640
|
});
|
|
4581
|
-
var RebuyButton =
|
|
4641
|
+
var RebuyButton = z97.discriminatedUnion("version", [
|
|
4582
4642
|
RebuyButtonV1,
|
|
4583
4643
|
CABRootSection.extend({
|
|
4584
|
-
type:
|
|
4644
|
+
type: z97.literal(WidgetType.ui_extension_button).default(WidgetType.ui_extension_button)
|
|
4585
4645
|
})
|
|
4586
4646
|
]);
|
|
4587
4647
|
|
|
4588
4648
|
// src/schema/widgets/rebuyMonetize.ts
|
|
4589
|
-
import { z as
|
|
4590
|
-
var RebuyMonetize =
|
|
4591
|
-
type:
|
|
4649
|
+
import { z as z98 } from "zod";
|
|
4650
|
+
var RebuyMonetize = z98.looseObject({
|
|
4651
|
+
type: z98.literal(WidgetType.ui_extension_ad).default(WidgetType.ui_extension_ad)
|
|
4592
4652
|
});
|
|
4593
|
-
var RebuyMonetizeV1 =
|
|
4594
|
-
name:
|
|
4595
|
-
previewMode:
|
|
4653
|
+
var RebuyMonetizeV1 = z98.object({
|
|
4654
|
+
name: z98.string().nullable().optional(),
|
|
4655
|
+
previewMode: z98.boolean().optional(),
|
|
4596
4656
|
/** Privacy Policy footer href → the marker section's `privacyPolicyUrl`. */
|
|
4597
|
-
privacyPolicyUrl:
|
|
4657
|
+
privacyPolicyUrl: z98.string().nullable().optional(),
|
|
4598
4658
|
/** Ads-taxonomy sub-vertical id — one of the admin Monetize editor's two configurables. */
|
|
4599
|
-
subVertical:
|
|
4600
|
-
tracking:
|
|
4601
|
-
enableAttribution:
|
|
4602
|
-
enableSource:
|
|
4603
|
-
enableWidget:
|
|
4659
|
+
subVertical: z98.string().nullable().optional(),
|
|
4660
|
+
tracking: z98.object({
|
|
4661
|
+
enableAttribution: z98.boolean().optional(),
|
|
4662
|
+
enableSource: z98.boolean().optional(),
|
|
4663
|
+
enableWidget: z98.boolean().optional()
|
|
4604
4664
|
}).optional(),
|
|
4605
|
-
type:
|
|
4606
|
-
version:
|
|
4665
|
+
type: z98.literal(WidgetType.ui_extension_ad).default(WidgetType.ui_extension_ad),
|
|
4666
|
+
version: z98.literal(1),
|
|
4607
4667
|
/** Ads-taxonomy vertical id — one of the admin Monetize editor's two configurables. */
|
|
4608
|
-
vertical:
|
|
4668
|
+
vertical: z98.string().nullable().optional()
|
|
4609
4669
|
});
|
|
4610
4670
|
|
|
4611
4671
|
// src/schema/widgetData.ts
|
|
@@ -4619,7 +4679,7 @@ var extensionWidgetTypes = [
|
|
|
4619
4679
|
WidgetType.ui_extension_line_item_editor,
|
|
4620
4680
|
WidgetType.ui_extension_progress_bar
|
|
4621
4681
|
];
|
|
4622
|
-
var WidgetData =
|
|
4682
|
+
var WidgetData = z99.discriminatedUnion("type", [
|
|
4623
4683
|
ABTestingPlaceholder,
|
|
4624
4684
|
CheckoutExtension,
|
|
4625
4685
|
ContentBlock,
|
|
@@ -4979,36 +5039,36 @@ var SWITCH_LABELS = {
|
|
|
4979
5039
|
};
|
|
4980
5040
|
|
|
4981
5041
|
// src/schema/widgets/post-purchase-offer/postPurchaseOffer.ts
|
|
4982
|
-
import { z as
|
|
5042
|
+
import { z as z101 } from "zod";
|
|
4983
5043
|
|
|
4984
5044
|
// src/schema/widgets/post-purchase-offer/postPurchaseWidget.ts
|
|
4985
|
-
import { z as
|
|
4986
|
-
var PostPurchaseWidgetLinkedFlow =
|
|
4987
|
-
id:
|
|
4988
|
-
name:
|
|
4989
|
-
});
|
|
4990
|
-
var PostPurchaseWidget =
|
|
4991
|
-
classification:
|
|
4992
|
-
createdAtTime:
|
|
4993
|
-
customEndpointName:
|
|
4994
|
-
id:
|
|
4995
|
-
lastViewed:
|
|
4996
|
-
linkedCustomEndpointId:
|
|
4997
|
-
linkedFlows:
|
|
4998
|
-
name:
|
|
4999
|
-
owner:
|
|
5045
|
+
import { z as z100 } from "zod";
|
|
5046
|
+
var PostPurchaseWidgetLinkedFlow = z100.object({
|
|
5047
|
+
id: z100.number(),
|
|
5048
|
+
name: z100.string()
|
|
5049
|
+
});
|
|
5050
|
+
var PostPurchaseWidget = z100.object({
|
|
5051
|
+
classification: z100.literal("post_purchase_offer_page").default("post_purchase_offer_page"),
|
|
5052
|
+
createdAtTime: z100.iso.datetime({ offset: true }).optional(),
|
|
5053
|
+
customEndpointName: z100.string().nullish(),
|
|
5054
|
+
id: z100.number().default(0),
|
|
5055
|
+
lastViewed: z100.iso.datetime({ offset: true }).nullish(),
|
|
5056
|
+
linkedCustomEndpointId: z100.number().nullish(),
|
|
5057
|
+
linkedFlows: z100.array(PostPurchaseWidgetLinkedFlow).optional(),
|
|
5058
|
+
name: z100.string().default(""),
|
|
5059
|
+
owner: z100.number().nullish(),
|
|
5000
5060
|
settings: PostPurchaseSettings
|
|
5001
5061
|
});
|
|
5002
5062
|
|
|
5003
5063
|
// src/schema/widgets/post-purchase-offer/postPurchaseOffer.ts
|
|
5004
|
-
var PostPurchaseOffer =
|
|
5005
|
-
|
|
5006
|
-
errors:
|
|
5007
|
-
message:
|
|
5008
|
-
successful:
|
|
5064
|
+
var PostPurchaseOffer = z101.discriminatedUnion("successful", [
|
|
5065
|
+
z101.strictObject({
|
|
5066
|
+
errors: z101.array(z101.object({ message: z101.string() })),
|
|
5067
|
+
message: z101.string(),
|
|
5068
|
+
successful: z101.literal(false)
|
|
5009
5069
|
}),
|
|
5010
|
-
|
|
5011
|
-
successful:
|
|
5070
|
+
z101.strictObject({
|
|
5071
|
+
successful: z101.literal(true),
|
|
5012
5072
|
widget: PostPurchaseWidget
|
|
5013
5073
|
})
|
|
5014
5074
|
]);
|
|
@@ -6096,7 +6156,7 @@ var convertOfferToV2 = ({ id, name, settings }) => {
|
|
|
6096
6156
|
|
|
6097
6157
|
// src/pricing/postPurchaseChangeset.ts
|
|
6098
6158
|
var postPurchaseChangeset = (prepared) => {
|
|
6099
|
-
const { selection:
|
|
6159
|
+
const { selection: selection3, terms } = prepared;
|
|
6100
6160
|
const subscription = readPostPurchaseSubscription(prepared);
|
|
6101
6161
|
const { discount, shipping } = terms;
|
|
6102
6162
|
const changesetDiscount = discount.type === "none" ? void 0 : {
|
|
@@ -6111,21 +6171,21 @@ var postPurchaseChangeset = (prepared) => {
|
|
|
6111
6171
|
{
|
|
6112
6172
|
...changesetDiscount ? { discount: changesetDiscount } : {},
|
|
6113
6173
|
initialShippingPrice,
|
|
6114
|
-
quantity:
|
|
6174
|
+
quantity: selection3.quantity,
|
|
6115
6175
|
recurringShippingPrice,
|
|
6116
6176
|
sellingPlanId: subscription.selection.sellingPlanId,
|
|
6117
6177
|
shippingOption,
|
|
6118
6178
|
type: "add_subscription",
|
|
6119
|
-
variantId:
|
|
6179
|
+
variantId: selection3.variantId
|
|
6120
6180
|
}
|
|
6121
6181
|
]
|
|
6122
6182
|
});
|
|
6123
6183
|
}
|
|
6124
6184
|
const changes = [
|
|
6125
6185
|
{
|
|
6126
|
-
quantity:
|
|
6186
|
+
quantity: selection3.quantity,
|
|
6127
6187
|
type: "add_variant",
|
|
6128
|
-
variantId:
|
|
6188
|
+
variantId: selection3.variantId,
|
|
6129
6189
|
...changesetDiscount && changesetDiscount.value > 0 ? { discount: changesetDiscount } : {}
|
|
6130
6190
|
}
|
|
6131
6191
|
];
|
|
@@ -6467,6 +6527,7 @@ export {
|
|
|
6467
6527
|
ProgressTierExclusionType,
|
|
6468
6528
|
ProgressTierType,
|
|
6469
6529
|
ProgressTierUnit,
|
|
6530
|
+
PurchaseAdmissionModeSchema,
|
|
6470
6531
|
PurchaseAnalyticsRequestSchema,
|
|
6471
6532
|
PurchaseAnalyticsResponseSchema,
|
|
6472
6533
|
PurchaseAnalyticsStatusSchema,
|
|
@@ -6543,6 +6604,11 @@ export {
|
|
|
6543
6604
|
TiptapParagraph,
|
|
6544
6605
|
TiptapText,
|
|
6545
6606
|
UI_LABELS,
|
|
6607
|
+
UpgradeCompensationProgressSchema,
|
|
6608
|
+
UpgradeProgressSchema,
|
|
6609
|
+
UpgradeRefundProgressSchema,
|
|
6610
|
+
UpgradeReviewProgressSchema,
|
|
6611
|
+
UpgradeReviewReasonSchema,
|
|
6546
6612
|
UserConfig,
|
|
6547
6613
|
VariableEffect,
|
|
6548
6614
|
VariableType,
|