@rebuy/rebuy 3.41.0 → 3.43.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 +971 -787
- package/dist/index.d.ts +1 -0
- package/dist/index.mjs +971 -787
- package/dist/pricing/index.cjs +58 -1
- package/dist/pricing/index.d.ts +2 -0
- package/dist/pricing/index.mjs +58 -1
- package/dist/pricing/postPurchaseDisplayFacts.d.ts +36 -0
- package/dist/pricing/postPurchaseDisplayPrice.d.ts +8 -0
- package/dist/pricing/postPurchaseReduction.d.ts +17 -0
- package/dist/schema/checkout-and-beyond/constants.cjs +4 -0
- package/dist/schema/checkout-and-beyond/constants.mjs +4 -0
- package/dist/schema/checkout-and-beyond/index.cjs +388 -374
- package/dist/schema/checkout-and-beyond/index.mjs +388 -374
- package/dist/schema/index.d.ts +2 -0
- package/dist/schema/postPurchaseAdmission.d.ts +33 -0
- package/dist/schema/postPurchaseDisplayPrice.d.ts +31 -0
- package/dist/schema/postPurchaseFollowups.d.ts +47 -0
- package/dist/schema/postPurchaseHealth.d.ts +5 -0
- package/dist/schema/postPurchasePlanCatalog.d.ts +2 -0
- package/dist/schema/postPurchaseProduct.d.ts +2 -0
- package/dist/schema/postPurchaseProductCollectionView.d.ts +62 -0
- package/dist/schema/postPurchaseProductView.d.ts +65 -0
- package/dist/schema/postPurchaseRecovery.d.ts +47 -0
- package/dist/schema/postPurchaseSubscriptionProduct.d.ts +2 -0
- package/dist/schema/postPurchaseUpgrade.d.ts +117 -0
- package/dist/schema/widget-data.cjs +452 -441
- package/dist/schema/widget-data.mjs +452 -441
- package/dist/schema/widgets/checkout-and-beyond/common.d.ts +14 -0
- package/dist/schema/widgets/checkout-and-beyond/image.d.ts +8 -0
- package/dist/schema/widgets/checkout-and-beyond/imageThumbnails.d.ts +13 -0
- package/dist/schema/widgets/checkout-and-beyond/index.d.ts +1 -0
- package/dist/schema/widgets/checkout-and-beyond/variants.d.ts +1 -0
- package/dist/server/index.cjs +1721 -1419
- package/dist/server/index.mjs +1707 -1405
- package/dist/server/postPurchasePlanCatalog.d.ts +4 -1
- package/dist/server/preparePostPurchaseAdmissionView.d.ts +53 -0
- package/dist/server/preparePostPurchaseCollectionGroup.d.ts +57 -0
- package/dist/server/preparePostPurchaseCollectionView.d.ts +53 -0
- package/dist/server/preparePostPurchaseGroupAdmissionView.d.ts +53 -0
- package/dist/server/preparePostPurchaseGroupDefault.d.ts +53 -0
- package/dist/server/preparePostPurchaseGroupView.d.ts +53 -0
- package/dist/server/preparePostPurchaseMemberView.d.ts +159 -0
- package/dist/server/preparePostPurchaseQuantityAdmissionView.d.ts +53 -0
- package/dist/server/preparePostPurchaseQuantityView.d.ts +53 -0
- package/dist/server/preparePostPurchaseSubscription.d.ts +1 -0
- package/dist/server/selectPostPurchaseChoice.d.ts +1 -0
- package/dist/transforms/index.cjs +980 -581
- package/dist/transforms/index.mjs +980 -581
- package/dist/transforms/postPurchase/convertProductInformation.d.ts +6 -2
- package/dist/transforms/postPurchase/productCardControls.d.ts +7 -0
- package/dist/transforms/postPurchase/productCardCosts.d.ts +3 -0
- package/dist/transforms/postPurchase/productCardPricing.d.ts +3 -0
- package/dist/transforms/postPurchase/productCardRows.d.ts +63 -0
- package/dist/transforms/postPurchase/productCardSettings.d.ts +103 -0
- package/dist/transforms/postPurchase/types.d.ts +2 -2
- package/dist/transforms/productCard/earnedText.d.ts +25 -0
- package/dist/transforms/productCard/priceText.d.ts +2 -0
- package/dist/transforms/productCard/quantitySection.d.ts +28 -0
- package/dist/transforms/productCard/subscriptionToggle.d.ts +18 -0
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -56,6 +56,7 @@ __export(src_exports, {
|
|
|
56
56
|
CABExperiment: () => CABExperiment,
|
|
57
57
|
CABImageSection: () => CABImageSection,
|
|
58
58
|
CABImageSectionFields: () => CABImageSectionFields,
|
|
59
|
+
CABImageThumbnails: () => CABImageThumbnails,
|
|
59
60
|
CABIntegrations: () => CABIntegrations,
|
|
60
61
|
CABLayoutSection: () => CABLayoutSection,
|
|
61
62
|
CABLayoutWrapping: () => CABLayoutWrapping,
|
|
@@ -183,6 +184,7 @@ __export(src_exports, {
|
|
|
183
184
|
PostPurchaseCollectionChoice: () => PostPurchaseCollectionChoice,
|
|
184
185
|
PostPurchaseCommonReviewRating: () => PostPurchaseCommonReviewRating,
|
|
185
186
|
PostPurchaseDiscount: () => PostPurchaseDiscount,
|
|
187
|
+
PostPurchaseDisplayPrice: () => PostPurchaseDisplayPrice,
|
|
186
188
|
PostPurchaseExcludedProductIds: () => PostPurchaseExcludedProductIds,
|
|
187
189
|
PostPurchaseGroupCatalog: () => PostPurchaseGroupCatalog,
|
|
188
190
|
PostPurchaseGroupChoice: () => PostPurchaseGroupChoice,
|
|
@@ -254,6 +256,7 @@ __export(src_exports, {
|
|
|
254
256
|
ProgressTierExclusionType: () => ProgressTierExclusionType,
|
|
255
257
|
ProgressTierType: () => ProgressTierType,
|
|
256
258
|
ProgressTierUnit: () => ProgressTierUnit,
|
|
259
|
+
PurchaseAdmissionModeSchema: () => PurchaseAdmissionModeSchema,
|
|
257
260
|
PurchaseAnalyticsRequestSchema: () => PurchaseAnalyticsRequestSchema,
|
|
258
261
|
PurchaseAnalyticsResponseSchema: () => PurchaseAnalyticsResponseSchema,
|
|
259
262
|
PurchaseAnalyticsStatusSchema: () => PurchaseAnalyticsStatusSchema,
|
|
@@ -330,11 +333,17 @@ __export(src_exports, {
|
|
|
330
333
|
TiptapParagraph: () => TiptapParagraph,
|
|
331
334
|
TiptapText: () => TiptapText,
|
|
332
335
|
UI_LABELS: () => UI_LABELS,
|
|
336
|
+
UpgradeCompensationProgressSchema: () => UpgradeCompensationProgressSchema,
|
|
337
|
+
UpgradeProgressSchema: () => UpgradeProgressSchema,
|
|
338
|
+
UpgradeRefundProgressSchema: () => UpgradeRefundProgressSchema,
|
|
339
|
+
UpgradeReviewProgressSchema: () => UpgradeReviewProgressSchema,
|
|
340
|
+
UpgradeReviewReasonSchema: () => UpgradeReviewReasonSchema,
|
|
333
341
|
UserConfig: () => UserConfig,
|
|
334
342
|
VariableEffect: () => VariableEffect,
|
|
335
343
|
VariableType: () => VariableType,
|
|
336
344
|
VariantMode: () => VariantMode,
|
|
337
345
|
VariantSelector: () => VariantSelector,
|
|
346
|
+
VariantsMode: () => VariantsMode,
|
|
338
347
|
VerticalAlignment: () => VerticalAlignment,
|
|
339
348
|
WidgetData: () => WidgetData,
|
|
340
349
|
WidgetType: () => WidgetType,
|
|
@@ -413,6 +422,7 @@ __export(src_exports, {
|
|
|
413
422
|
popoverPositions: () => popoverPositions,
|
|
414
423
|
postPurchaseChangeset: () => postPurchaseChangeset,
|
|
415
424
|
postPurchaseCosts: () => postPurchaseCosts,
|
|
425
|
+
postPurchaseDisplayPrice: () => postPurchaseDisplayPrice,
|
|
416
426
|
postPurchaseHealthTaskId: () => postPurchaseHealthTaskId,
|
|
417
427
|
postPurchaseSubscriptionDisplay: () => postPurchaseSubscriptionDisplay,
|
|
418
428
|
postPurchaseTaskNameSchema: () => postPurchaseTaskNameSchema,
|
|
@@ -451,6 +461,7 @@ __export(src_exports, {
|
|
|
451
461
|
variantModes: () => variantModes,
|
|
452
462
|
variantPriceObject: () => variantPriceObject,
|
|
453
463
|
variantSelectors: () => variantSelectors,
|
|
464
|
+
variantsModes: () => variantsModes,
|
|
454
465
|
verticalAlignments: () => verticalAlignments,
|
|
455
466
|
widgetTypes: () => widgetTypes
|
|
456
467
|
});
|
|
@@ -1988,6 +1999,8 @@ var variableTypes = ["boolean", "number", "text"];
|
|
|
1988
1999
|
var VariableType = freezeEnum(variableTypes);
|
|
1989
2000
|
var variantModes = ["multiple", "single"];
|
|
1990
2001
|
var VariantMode = freezeEnum(variantModes);
|
|
2002
|
+
var variantsModes = [...variantModes, "productGroup"];
|
|
2003
|
+
var VariantsMode = freezeEnum(variantsModes);
|
|
1991
2004
|
var variantSelectors = ["menu", "radio", "button"];
|
|
1992
2005
|
var VariantSelector = freezeEnum(variantSelectors);
|
|
1993
2006
|
var verticalAlignments = ["top", "middle", "bottom"];
|
|
@@ -2783,6 +2796,7 @@ var PreparedPostPurchaseProduct = import_zod22.z.object({
|
|
|
2783
2796
|
labels: import_zod22.z.object({
|
|
2784
2797
|
declineAll: global.declineAll,
|
|
2785
2798
|
free: import_zod22.z.string(),
|
|
2799
|
+
notAvailable: global.notAvailable,
|
|
2786
2800
|
payNow: import_zod22.z.string(),
|
|
2787
2801
|
quantity: import_zod22.z.string(),
|
|
2788
2802
|
recurringShipping: global.recurringShipping,
|
|
@@ -2885,6 +2899,8 @@ var PostPurchaseProductChangeset = import_zod23.z.object({
|
|
|
2885
2899
|
});
|
|
2886
2900
|
|
|
2887
2901
|
// src/schema/postPurchaseAdmission.ts
|
|
2902
|
+
var PurchaseAdmissionModeSchema = import_zod24.z.enum(["purchase", "upgrade"]);
|
|
2903
|
+
var selection = PreparedPostPurchaseProduct.shape.selection;
|
|
2888
2904
|
var PurchaseExpectedSchema = import_zod24.z.object({
|
|
2889
2905
|
buyerConsentToSubscriptions: import_zod24.z.boolean().optional(),
|
|
2890
2906
|
changeset: PostPurchaseProductChangeset.extend({
|
|
@@ -2892,16 +2908,20 @@ var PurchaseExpectedSchema = import_zod24.z.object({
|
|
|
2892
2908
|
}),
|
|
2893
2909
|
entry: DecisionEntrySchema,
|
|
2894
2910
|
member: PostPurchaseMemberIdentity.optional(),
|
|
2911
|
+
mode: PurchaseAdmissionModeSchema.optional(),
|
|
2895
2912
|
progressRevision: import_zod24.z.number().int().nonnegative().optional(),
|
|
2896
|
-
selection
|
|
2913
|
+
selection
|
|
2897
2914
|
}).refine(
|
|
2898
2915
|
({ member, progressRevision }) => !member || progressRevision !== void 0,
|
|
2899
2916
|
"Captured member requires progress"
|
|
2900
|
-
).refine(
|
|
2917
|
+
).refine(
|
|
2918
|
+
({ mode, selection: { sellingPlanId } }) => mode !== "upgrade" || sellingPlanId !== void 0,
|
|
2919
|
+
"An upgrade selects a subscription"
|
|
2920
|
+
).refine(({ buyerConsentToSubscriptions: consent, changeset, selection: selection3 }) => {
|
|
2901
2921
|
const [change, shipping] = changeset.changes;
|
|
2902
|
-
if (
|
|
2903
|
-
return consent !== true && change?.type === "add_variant" && change.variantId ===
|
|
2904
|
-
return consent === true && changeset.changes.length === 1 && change.type === "add_subscription" && change.sellingPlanId ===
|
|
2922
|
+
if (selection3.sellingPlanId === void 0)
|
|
2923
|
+
return consent !== true && change?.type === "add_variant" && change.variantId === selection3.variantId && change.quantity === selection3.quantity && (shipping === void 0 || shipping.type === "add_shipping_line");
|
|
2924
|
+
return consent === true && changeset.changes.length === 1 && change.type === "add_subscription" && change.sellingPlanId === selection3.sellingPlanId && change.variantId === selection3.variantId && change.quantity === selection3.quantity;
|
|
2905
2925
|
}, "Selection, change and buyer consent must agree");
|
|
2906
2926
|
var PurchaseRequestSchema = DecideRequestSchema.extend({
|
|
2907
2927
|
expected: PurchaseExpectedSchema,
|
|
@@ -2910,12 +2930,18 @@ var PurchaseRequestSchema = DecideRequestSchema.extend({
|
|
|
2910
2930
|
var PurchaseReceiptSchema = import_zod24.z.object({
|
|
2911
2931
|
admittedAt: PostPurchaseTimestampSchema,
|
|
2912
2932
|
changesetToken: import_zod24.z.string().min(1),
|
|
2933
|
+
mode: PurchaseAdmissionModeSchema.optional(),
|
|
2913
2934
|
operationId: import_zod24.z.uuid(),
|
|
2935
|
+
/** The server-bound one-time line an upgrade refunds; its quantity is the order's, not the selection's. */
|
|
2936
|
+
originalLine: import_zod24.z.strictObject({ quantity: selection.shape.quantity, variantId: selection.shape.variantId }).optional(),
|
|
2914
2937
|
requiresSubscriptionConsent: import_zod24.z.boolean(),
|
|
2915
|
-
selection
|
|
2938
|
+
selection
|
|
2916
2939
|
}).refine(
|
|
2917
|
-
({ requiresSubscriptionConsent, selection:
|
|
2940
|
+
({ requiresSubscriptionConsent, selection: selection3 }) => requiresSubscriptionConsent === (selection3.sellingPlanId !== void 0),
|
|
2918
2941
|
"Receipt consent must match its selected plan"
|
|
2942
|
+
).refine(
|
|
2943
|
+
({ mode, originalLine, selection: { sellingPlanId, variantId } }) => mode === "upgrade" ? sellingPlanId !== void 0 && originalLine?.variantId === variantId : originalLine === void 0,
|
|
2944
|
+
"An upgrade Receipt binds the original line of its subscribed variant, and only an upgrade does"
|
|
2919
2945
|
);
|
|
2920
2946
|
var PurchaseResponseSchema = import_zod24.z.object({ data: PurchaseReceiptSchema, successful: import_zod24.z.literal(true) });
|
|
2921
2947
|
|
|
@@ -2974,6 +3000,8 @@ var import_zod29 = require("zod");
|
|
|
2974
3000
|
var import_zod28 = require("zod");
|
|
2975
3001
|
var PostPurchasePlanOption = import_zod28.z.object({
|
|
2976
3002
|
adjustment: PostPurchasePlanAdjustment.optional(),
|
|
3003
|
+
/** cab-checkout's `discountPercentage`: the plan's own whole-percent saving on the regular price (`{{subscriptionDiscount}}`). */
|
|
3004
|
+
discountPercentage: import_zod28.z.number().int().min(0).max(100).optional(),
|
|
2977
3005
|
id: import_zod28.z.number().int().positive(),
|
|
2978
3006
|
intervalFrequency: import_zod28.z.string().regex(/^[1-9]\d*$/).optional(),
|
|
2979
3007
|
intervalLabel: import_zod28.z.string().min(1),
|
|
@@ -3093,85 +3121,120 @@ var OfferDeclineResponseSchema = import_zod34.z.object({
|
|
|
3093
3121
|
successful: import_zod34.z.literal(true)
|
|
3094
3122
|
});
|
|
3095
3123
|
|
|
3096
|
-
// src/schema/
|
|
3124
|
+
// src/schema/postPurchaseDisplayPrice.ts
|
|
3125
|
+
var import_zod36 = require("zod");
|
|
3126
|
+
|
|
3127
|
+
// src/schema/postPurchaseSubscriptionDisplay.ts
|
|
3097
3128
|
var import_zod35 = require("zod");
|
|
3098
|
-
var
|
|
3129
|
+
var Minor2 = import_zod35.z.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER);
|
|
3130
|
+
var PostPurchaseSubscriptionDisplay = import_zod35.z.object({
|
|
3131
|
+
comparisonMinor: Minor2,
|
|
3132
|
+
currencyCode: import_zod35.z.string().regex(/^[A-Z]{3}$/),
|
|
3133
|
+
priceMinor: Minor2,
|
|
3134
|
+
savingMinor: Minor2,
|
|
3135
|
+
savingPercent: import_zod35.z.number().int().min(0).max(100)
|
|
3136
|
+
});
|
|
3137
|
+
|
|
3138
|
+
// src/schema/postPurchaseDisplayPrice.ts
|
|
3139
|
+
var { currencyCode: CurrencyCode, priceMinor: Minor3, savingPercent: Percent } = PostPurchaseSubscriptionDisplay.shape;
|
|
3140
|
+
var PostPurchaseDisplayPrice = import_zod36.z.object({
|
|
3141
|
+
currencyCode: CurrencyCode,
|
|
3142
|
+
savingFormat: import_zod36.z.enum(["amount", "percent"]),
|
|
3143
|
+
savingMinor: Minor3,
|
|
3144
|
+
savingPercent: Percent,
|
|
3145
|
+
subscriptionUnit: PostPurchaseSubscriptionDisplay.optional(),
|
|
3146
|
+
variantCompareAtPriceMinor: Minor3.nullable(),
|
|
3147
|
+
variantPriceMinor: Minor3
|
|
3148
|
+
}).refine(
|
|
3149
|
+
({ variantCompareAtPriceMinor: struck, variantPriceMinor: price }) => struck === null || struck > price,
|
|
3150
|
+
"A compare-at price is struck only above the price"
|
|
3151
|
+
).refine(
|
|
3152
|
+
({ savingMinor, savingPercent, variantCompareAtPriceMinor: struck, variantPriceMinor: price }) => savingMinor === (struck ?? price) - price && (savingMinor > 0 || savingPercent === 0),
|
|
3153
|
+
"The saving is the struck price minus the price"
|
|
3154
|
+
).refine(
|
|
3155
|
+
({ subscriptionUnit: unit, ...facts }) => !unit || unit.currencyCode === facts.currencyCode && unit.priceMinor === facts.variantPriceMinor && unit.savingMinor === facts.savingMinor && unit.savingPercent === facts.savingPercent && unit.savingMinor === Math.max(0, unit.comparisonMinor - unit.priceMinor),
|
|
3156
|
+
"The subscription unit estimate restates the plan facts in the same currency"
|
|
3157
|
+
);
|
|
3158
|
+
|
|
3159
|
+
// src/schema/postPurchaseEligibility.ts
|
|
3160
|
+
var import_zod37 = require("zod");
|
|
3161
|
+
var PostPurchaseSkipReasonSchema = import_zod37.z.enum(["empty", "no-eligible-subscription"]);
|
|
3099
3162
|
|
|
3100
3163
|
// src/schema/postPurchaseExitPolicy.ts
|
|
3101
|
-
var
|
|
3164
|
+
var import_zod38 = require("zod");
|
|
3102
3165
|
var EXIT_DELAY_MAX_MS = 60 * 60 * 1e3;
|
|
3103
|
-
var ExitPolicySchema =
|
|
3104
|
-
|
|
3105
|
-
|
|
3106
|
-
delayMs:
|
|
3107
|
-
source:
|
|
3108
|
-
status:
|
|
3166
|
+
var ExitPolicySchema = import_zod38.z.discriminatedUnion("status", [
|
|
3167
|
+
import_zod38.z.strictObject({ status: import_zod38.z.literal("unavailable") }),
|
|
3168
|
+
import_zod38.z.strictObject({
|
|
3169
|
+
delayMs: import_zod38.z.number().int().nonnegative().max(EXIT_DELAY_MAX_MS),
|
|
3170
|
+
source: import_zod38.z.enum(["admitted", "selected-flow"]),
|
|
3171
|
+
status: import_zod38.z.literal("available")
|
|
3109
3172
|
})
|
|
3110
3173
|
]);
|
|
3111
3174
|
|
|
3112
3175
|
// src/schema/postPurchaseFinish.ts
|
|
3113
|
-
var
|
|
3176
|
+
var import_zod45 = require("zod");
|
|
3114
3177
|
|
|
3115
3178
|
// src/schema/postPurchaseFollowups.ts
|
|
3116
|
-
var
|
|
3179
|
+
var import_zod43 = require("zod");
|
|
3117
3180
|
|
|
3118
3181
|
// src/schema/postPurchaseHealthProgress.ts
|
|
3119
|
-
var
|
|
3182
|
+
var import_zod40 = require("zod");
|
|
3120
3183
|
|
|
3121
3184
|
// src/schema/postPurchaseReleaseAuthority.ts
|
|
3122
|
-
var
|
|
3123
|
-
var PostPurchaseSessionIdSchema =
|
|
3124
|
-
var ReleaseOwnerSchema =
|
|
3125
|
-
var ReleaseAuthorityRequestSchema =
|
|
3185
|
+
var import_zod39 = require("zod");
|
|
3186
|
+
var PostPurchaseSessionIdSchema = import_zod39.z.string().regex(/^[a-f0-9]{64}$/);
|
|
3187
|
+
var ReleaseOwnerSchema = import_zod39.z.enum(["rebuy", "shopify"]);
|
|
3188
|
+
var ReleaseAuthorityRequestSchema = import_zod39.z.strictObject({
|
|
3126
3189
|
orderId: PostPurchaseOrderIdSchema,
|
|
3127
3190
|
shop: ShopifyDomainSchema
|
|
3128
3191
|
});
|
|
3129
|
-
var ReadyReleaseAuthoritySchema =
|
|
3192
|
+
var ReadyReleaseAuthoritySchema = import_zod39.z.object({
|
|
3130
3193
|
deadline: PostPurchaseTimestampSchema,
|
|
3131
3194
|
releaseOwner: ReleaseOwnerSchema,
|
|
3132
3195
|
sessionId: PostPurchaseSessionIdSchema,
|
|
3133
|
-
status:
|
|
3196
|
+
status: import_zod39.z.literal("ready")
|
|
3134
3197
|
});
|
|
3135
|
-
var PendingReleaseAuthoritySchema =
|
|
3136
|
-
var ReleaseAuthorityResponseSchema =
|
|
3137
|
-
data:
|
|
3138
|
-
|
|
3198
|
+
var PendingReleaseAuthoritySchema = import_zod39.z.object({ status: import_zod39.z.literal("pending") });
|
|
3199
|
+
var ReleaseAuthorityResponseSchema = import_zod39.z.object({
|
|
3200
|
+
data: import_zod39.z.discriminatedUnion("status", [
|
|
3201
|
+
import_zod39.z.object({ status: import_zod39.z.literal("unknown") }),
|
|
3139
3202
|
PendingReleaseAuthoritySchema,
|
|
3140
3203
|
ReadyReleaseAuthoritySchema
|
|
3141
3204
|
]),
|
|
3142
|
-
successful:
|
|
3205
|
+
successful: import_zod39.z.literal(true)
|
|
3143
3206
|
});
|
|
3144
3207
|
|
|
3145
3208
|
// src/schema/postPurchaseHealthProgress.ts
|
|
3146
|
-
var HealthScheduleSchema =
|
|
3209
|
+
var HealthScheduleSchema = import_zod40.z.strictObject({
|
|
3147
3210
|
checkoutToken: DecideRequestSchema.shape.checkoutToken,
|
|
3148
3211
|
healthScheduledAt: PostPurchaseTimestampSchema,
|
|
3149
3212
|
operationId: PurchaseReceiptSchema.shape.operationId.regex(/^[a-f0-9-]{36}$/),
|
|
3150
3213
|
orderId: PostPurchaseOrderIdSchema,
|
|
3151
|
-
removePartialOrder:
|
|
3214
|
+
removePartialOrder: import_zod40.z.boolean(),
|
|
3152
3215
|
sessionId: PostPurchaseSessionIdSchema,
|
|
3153
3216
|
shop: DecideRequestSchema.shape.shop
|
|
3154
3217
|
});
|
|
3155
|
-
var HealthSchedulingResponseSchema =
|
|
3156
|
-
data:
|
|
3157
|
-
callbackStatus:
|
|
3218
|
+
var HealthSchedulingResponseSchema = import_zod40.z.object({
|
|
3219
|
+
data: import_zod40.z.object({
|
|
3220
|
+
callbackStatus: import_zod40.z.enum(["pending", "attempted", "returned", "unknown"]),
|
|
3158
3221
|
facts: HealthScheduleSchema,
|
|
3159
|
-
scheduling:
|
|
3160
|
-
|
|
3161
|
-
|
|
3222
|
+
scheduling: import_zod40.z.union([
|
|
3223
|
+
import_zod40.z.strictObject({ recordedAt: PostPurchaseTimestampSchema, status: import_zod40.z.literal("verified") }),
|
|
3224
|
+
import_zod40.z.strictObject({ status: import_zod40.z.enum(["unavailable", "unverified"]) })
|
|
3162
3225
|
])
|
|
3163
3226
|
}),
|
|
3164
|
-
successful:
|
|
3227
|
+
successful: import_zod40.z.literal(true)
|
|
3165
3228
|
});
|
|
3166
3229
|
|
|
3167
3230
|
// src/schema/postPurchaseObservation.ts
|
|
3168
|
-
var
|
|
3169
|
-
var PurchaseObservationSchema =
|
|
3170
|
-
|
|
3171
|
-
changesetApplicationsRemaining:
|
|
3172
|
-
errors:
|
|
3173
|
-
|
|
3174
|
-
code:
|
|
3231
|
+
var import_zod41 = require("zod");
|
|
3232
|
+
var PurchaseObservationSchema = import_zod41.z.union([
|
|
3233
|
+
import_zod41.z.object({
|
|
3234
|
+
changesetApplicationsRemaining: import_zod41.z.number().int().nonnegative(),
|
|
3235
|
+
errors: import_zod41.z.array(
|
|
3236
|
+
import_zod41.z.object({
|
|
3237
|
+
code: import_zod41.z.enum([
|
|
3175
3238
|
"payment_required",
|
|
3176
3239
|
"insufficient_inventory",
|
|
3177
3240
|
"changeset_already_applied",
|
|
@@ -3185,83 +3248,126 @@ var PurchaseObservationSchema = import_zod39.z.union([
|
|
|
3185
3248
|
"subscription_limit_error",
|
|
3186
3249
|
"order_released_error"
|
|
3187
3250
|
]),
|
|
3188
|
-
message:
|
|
3251
|
+
message: import_zod41.z.string()
|
|
3189
3252
|
}).strict()
|
|
3190
3253
|
),
|
|
3191
|
-
status:
|
|
3254
|
+
status: import_zod41.z.enum(["processed", "partially_processed", "unprocessed"])
|
|
3192
3255
|
}).strict(),
|
|
3193
|
-
|
|
3256
|
+
import_zod41.z.object({ reason: import_zod41.z.literal("application-error"), status: import_zod41.z.literal("unknown") }).strict()
|
|
3194
3257
|
]);
|
|
3195
|
-
var RecordedPurchaseObservationSchema =
|
|
3258
|
+
var RecordedPurchaseObservationSchema = import_zod41.z.object({
|
|
3196
3259
|
observation: PurchaseObservationSchema,
|
|
3197
3260
|
recordedAt: PostPurchaseTimestampSchema
|
|
3198
3261
|
}).strict();
|
|
3199
3262
|
var PurchaseObservationRequestSchema = DecideRequestSchema.extend({
|
|
3200
3263
|
observation: PurchaseObservationSchema,
|
|
3201
|
-
operationId:
|
|
3264
|
+
operationId: import_zod41.z.uuid()
|
|
3202
3265
|
}).strict();
|
|
3203
|
-
var PurchaseObservationResponseSchema =
|
|
3204
|
-
data: RecordedPurchaseObservationSchema.extend({ operationId:
|
|
3205
|
-
successful:
|
|
3266
|
+
var PurchaseObservationResponseSchema = import_zod41.z.object({
|
|
3267
|
+
data: RecordedPurchaseObservationSchema.extend({ operationId: import_zod41.z.uuid() }),
|
|
3268
|
+
successful: import_zod41.z.literal(true)
|
|
3206
3269
|
});
|
|
3207
3270
|
|
|
3271
|
+
// src/schema/postPurchaseUpgrade.ts
|
|
3272
|
+
var import_zod42 = require("zod");
|
|
3273
|
+
var AttemptSchema2 = import_zod42.z.strictObject({ attemptedAt: PostPurchaseTimestampSchema, status: import_zod42.z.literal("attempted") });
|
|
3274
|
+
var FinishedSchema = AttemptSchema2.extend({ finishedAt: PostPurchaseTimestampSchema });
|
|
3275
|
+
var UpgradeRefundProgressSchema = import_zod42.z.union([
|
|
3276
|
+
AttemptSchema2,
|
|
3277
|
+
FinishedSchema.extend({ refundId: import_zod42.z.string().min(1), status: import_zod42.z.literal("refunded") }),
|
|
3278
|
+
FinishedSchema.extend({ status: import_zod42.z.enum(["failed", "unknown"]) })
|
|
3279
|
+
]);
|
|
3280
|
+
var UpgradeCompensationProgressSchema = import_zod42.z.union([
|
|
3281
|
+
AttemptSchema2,
|
|
3282
|
+
FinishedSchema.extend({ status: import_zod42.z.enum(["removed", "failed", "unknown"]) })
|
|
3283
|
+
]);
|
|
3284
|
+
var UpgradeReviewReasonSchema = import_zod42.z.enum(["refund-unknown", "compensation-failed", "compensation-unknown"]);
|
|
3285
|
+
var UpgradeReviewProgressSchema = import_zod42.z.strictObject({
|
|
3286
|
+
markedAt: PostPurchaseTimestampSchema,
|
|
3287
|
+
marker: AcceptedMetafieldResultSchema.shape.status,
|
|
3288
|
+
reason: UpgradeReviewReasonSchema
|
|
3289
|
+
});
|
|
3290
|
+
var reviewReason = (refund, compensation) => {
|
|
3291
|
+
if (refund?.status === "unknown") return "refund-unknown";
|
|
3292
|
+
if (compensation?.status === "failed" || compensation?.status === "unknown")
|
|
3293
|
+
return `compensation-${compensation.status}`;
|
|
3294
|
+
return null;
|
|
3295
|
+
};
|
|
3296
|
+
var UpgradeProgressSchema = import_zod42.z.strictObject({
|
|
3297
|
+
compensation: UpgradeCompensationProgressSchema.nullable(),
|
|
3298
|
+
operationId: PurchaseReceiptSchema.shape.operationId,
|
|
3299
|
+
refund: UpgradeRefundProgressSchema.nullable(),
|
|
3300
|
+
review: UpgradeReviewProgressSchema.nullable()
|
|
3301
|
+
}).refine(
|
|
3302
|
+
({ compensation, refund }) => compensation === null || refund?.status === "failed",
|
|
3303
|
+
"Compensation follows a known refund failure only"
|
|
3304
|
+
).refine(
|
|
3305
|
+
({ compensation, refund, review }) => (review?.reason ?? null) === reviewReason(refund, compensation),
|
|
3306
|
+
"Review must match the unresolved outcome"
|
|
3307
|
+
);
|
|
3308
|
+
|
|
3208
3309
|
// src/schema/postPurchaseFollowups.ts
|
|
3209
|
-
var RequiredHealthSchema =
|
|
3310
|
+
var RequiredHealthSchema = import_zod43.z.union([
|
|
3210
3311
|
HealthSchedulingResponseSchema.shape.data,
|
|
3211
|
-
|
|
3312
|
+
import_zod43.z.strictObject({ status: import_zod43.z.literal("unavailable") })
|
|
3212
3313
|
]);
|
|
3213
|
-
var AcceptedFollowupsResponseSchema =
|
|
3214
|
-
data:
|
|
3215
|
-
acceptedEvent:
|
|
3314
|
+
var AcceptedFollowupsResponseSchema = import_zod43.z.object({
|
|
3315
|
+
data: import_zod43.z.object({
|
|
3316
|
+
acceptedEvent: import_zod43.z.union([
|
|
3216
3317
|
AcceptedEventResponseSchema.shape.data,
|
|
3217
|
-
|
|
3318
|
+
import_zod43.z.strictObject({ status: import_zod43.z.literal("unavailable") })
|
|
3218
3319
|
]),
|
|
3219
3320
|
acceptedMetafield: AcceptedMetafieldResultSchema,
|
|
3220
3321
|
health: RequiredHealthSchema,
|
|
3221
|
-
purchase: PurchaseObservationResponseSchema.shape.data
|
|
3322
|
+
purchase: PurchaseObservationResponseSchema.shape.data,
|
|
3323
|
+
/** Present only for an upgrade admission, and always for the same operation as `purchase`. */
|
|
3324
|
+
upgrade: UpgradeProgressSchema.optional()
|
|
3325
|
+
}).refine(({ purchase, upgrade }) => !upgrade || upgrade.operationId === purchase.operationId, {
|
|
3326
|
+
message: "Upgrade progress belongs to its operation",
|
|
3327
|
+
path: ["upgrade", "operationId"]
|
|
3222
3328
|
}),
|
|
3223
|
-
successful:
|
|
3329
|
+
successful: import_zod43.z.literal(true)
|
|
3224
3330
|
});
|
|
3225
3331
|
|
|
3226
3332
|
// src/schema/postPurchaseSessionClose.ts
|
|
3227
|
-
var
|
|
3228
|
-
var SessionClosureSchema =
|
|
3333
|
+
var import_zod44 = require("zod");
|
|
3334
|
+
var SessionClosureSchema = import_zod44.z.object({ closedAt: PostPurchaseTimestampSchema, status: import_zod44.z.literal("closed") });
|
|
3229
3335
|
var SessionCloseRequestSchema = DecideRequestSchema.strict();
|
|
3230
|
-
var SessionCloseResponseSchema =
|
|
3336
|
+
var SessionCloseResponseSchema = import_zod44.z.object({ data: SessionClosureSchema, successful: import_zod44.z.literal(true) });
|
|
3231
3337
|
|
|
3232
3338
|
// src/schema/postPurchaseFinish.ts
|
|
3233
|
-
var FinishedPurchaseSchema =
|
|
3234
|
-
|
|
3235
|
-
|
|
3339
|
+
var FinishedPurchaseSchema = import_zod45.z.union([
|
|
3340
|
+
import_zod45.z.strictObject({ status: import_zod45.z.literal("none") }),
|
|
3341
|
+
import_zod45.z.strictObject({
|
|
3236
3342
|
operationId: PurchaseReceiptSchema.shape.operationId,
|
|
3237
|
-
status:
|
|
3238
|
-
|
|
3343
|
+
status: import_zod45.z.union([
|
|
3344
|
+
import_zod45.z.literal("pending"),
|
|
3239
3345
|
...PurchaseObservationSchema.options.map((option) => option.shape.status)
|
|
3240
3346
|
])
|
|
3241
3347
|
})
|
|
3242
3348
|
]);
|
|
3243
3349
|
var SessionFinishRequestSchema = DecideRequestSchema.strict();
|
|
3244
|
-
var SessionFinishResponseSchema =
|
|
3350
|
+
var SessionFinishResponseSchema = import_zod45.z.object({
|
|
3245
3351
|
data: SessionClosureSchema.extend({
|
|
3246
3352
|
classification: ClassificationProgressSchema,
|
|
3247
3353
|
exitPolicy: ExitPolicySchema,
|
|
3248
3354
|
health: RequiredHealthSchema.nullable(),
|
|
3249
3355
|
purchase: FinishedPurchaseSchema
|
|
3250
3356
|
}),
|
|
3251
|
-
successful:
|
|
3357
|
+
successful: import_zod45.z.literal(true)
|
|
3252
3358
|
});
|
|
3253
3359
|
|
|
3254
3360
|
// src/schema/postPurchaseQuantity.ts
|
|
3255
|
-
var
|
|
3361
|
+
var import_zod69 = require("zod");
|
|
3256
3362
|
|
|
3257
3363
|
// src/schema/postPurchaseProductCollectionView.ts
|
|
3258
|
-
var
|
|
3364
|
+
var import_zod68 = require("zod");
|
|
3259
3365
|
|
|
3260
3366
|
// src/schema/postPurchaseProductView.ts
|
|
3261
|
-
var
|
|
3367
|
+
var import_zod67 = require("zod");
|
|
3262
3368
|
|
|
3263
3369
|
// src/schema/postPurchaseGroupCatalog.ts
|
|
3264
|
-
var
|
|
3370
|
+
var import_zod46 = require("zod");
|
|
3265
3371
|
var productId = PreparedPostPurchaseProduct.shape.selection.shape.productId;
|
|
3266
3372
|
var source = PostPurchaseProductSource.shape.data.element;
|
|
3267
3373
|
var PostPurchaseGroupDescription = source.pick({ description: true, id: true, image: true, images: true, title: true }).extend({
|
|
@@ -3269,17 +3375,17 @@ var PostPurchaseGroupDescription = source.pick({ description: true, id: true, im
|
|
|
3269
3375
|
image: source.shape.image.default(null),
|
|
3270
3376
|
options: PostPurchaseVariantCatalog.shape.options.default([])
|
|
3271
3377
|
});
|
|
3272
|
-
var PostPurchaseGroupCatalog =
|
|
3378
|
+
var PostPurchaseGroupCatalog = import_zod46.z.object({
|
|
3273
3379
|
memberProductId: productId,
|
|
3274
|
-
options:
|
|
3380
|
+
options: import_zod46.z.array(import_zod46.z.object({ productId, title: import_zod46.z.string(), variantCatalog: PostPurchaseVariantCatalog }))
|
|
3275
3381
|
});
|
|
3276
|
-
var PostPurchaseGroupSelection =
|
|
3382
|
+
var PostPurchaseGroupSelection = import_zod46.z.object({
|
|
3277
3383
|
memberProductId: productId,
|
|
3278
3384
|
productId
|
|
3279
3385
|
});
|
|
3280
3386
|
|
|
3281
3387
|
// src/schema/widgets/checkout-and-beyond/root.ts
|
|
3282
|
-
var
|
|
3388
|
+
var import_zod66 = require("zod");
|
|
3283
3389
|
|
|
3284
3390
|
// src/schema/widgets/checkout-and-beyond/constants.ts
|
|
3285
3391
|
var import_es_toolkit3 = require("es-toolkit");
|
|
@@ -3334,18 +3440,18 @@ var targetAreas = {
|
|
|
3334
3440
|
|
|
3335
3441
|
// src/schema/widgets/checkout-and-beyond/layout.ts
|
|
3336
3442
|
var import_uuid15 = require("uuid");
|
|
3337
|
-
var
|
|
3443
|
+
var import_zod65 = require("zod");
|
|
3338
3444
|
|
|
3339
3445
|
// src/schema/widgets/checkout-and-beyond/shared.ts
|
|
3340
|
-
var
|
|
3446
|
+
var import_zod64 = require("zod");
|
|
3341
3447
|
|
|
3342
3448
|
// src/schema/widgets/checkout-and-beyond/banner.ts
|
|
3343
|
-
var
|
|
3344
|
-
var CABBannerSection =
|
|
3449
|
+
var import_zod47 = require("zod");
|
|
3450
|
+
var CABBannerSection = import_zod47.z.lazy(
|
|
3345
3451
|
() => CABLayoutSection.omit({ sectionType: true }).extend({
|
|
3346
|
-
buttonField:
|
|
3347
|
-
color:
|
|
3348
|
-
dismissible:
|
|
3452
|
+
buttonField: import_zod47.z.enum(buttonFields).optional(),
|
|
3453
|
+
color: import_zod47.z.enum(bannerColors).default("info"),
|
|
3454
|
+
dismissible: import_zod47.z.boolean().default(true),
|
|
3349
3455
|
/**
|
|
3350
3456
|
* The `s-banner` heading — localized content (a buyer can see a merchant-composed banner). Absent OR
|
|
3351
3457
|
* blank ⇒ no heading; the renderer emits no heading slot for `''` rather than an empty one.
|
|
@@ -3361,18 +3467,18 @@ var CABBannerSection = import_zod44.z.lazy(
|
|
|
3361
3467
|
* not a 500. Nothing emits `heading` yet; the first converter that maps merchant banner copy into it
|
|
3362
3468
|
* either strips first or teaches `normalizeTextContent` to strip this field.
|
|
3363
3469
|
*/
|
|
3364
|
-
heading:
|
|
3365
|
-
sectionType:
|
|
3470
|
+
heading: import_zod47.z.record(import_zod47.z.string(), import_zod47.z.string().refine(checkForHTML, NO_HTML)).optional(),
|
|
3471
|
+
sectionType: import_zod47.z.literal(SectionType.banner).default(SectionType.banner)
|
|
3366
3472
|
})
|
|
3367
3473
|
);
|
|
3368
3474
|
|
|
3369
3475
|
// src/schema/widgets/checkout-and-beyond/button.ts
|
|
3370
3476
|
var import_uuid5 = require("uuid");
|
|
3371
|
-
var
|
|
3477
|
+
var import_zod50 = require("zod");
|
|
3372
3478
|
|
|
3373
3479
|
// src/schema/widgets/checkout-and-beyond/image.ts
|
|
3374
3480
|
var import_uuid4 = require("uuid");
|
|
3375
|
-
var
|
|
3481
|
+
var import_zod49 = require("zod");
|
|
3376
3482
|
|
|
3377
3483
|
// src/schema/widgets/checkout-and-beyond/icons.ts
|
|
3378
3484
|
var iconNames = [
|
|
@@ -3458,18 +3564,25 @@ var IconSize = freezeEnum(iconSizes);
|
|
|
3458
3564
|
var iconTones = ["auto", "critical", "custom", "info", "neutral", "success", "warning"];
|
|
3459
3565
|
var IconTone = freezeEnum(iconTones);
|
|
3460
3566
|
|
|
3567
|
+
// src/schema/widgets/checkout-and-beyond/imageThumbnails.ts
|
|
3568
|
+
var import_zod48 = require("zod");
|
|
3569
|
+
var CABImageThumbnails = import_zod48.z.object({
|
|
3570
|
+
limit: import_zod48.z.number().int().min(1).default(8),
|
|
3571
|
+
perLine: import_zod48.z.number().int().min(1).max(8).default(4)
|
|
3572
|
+
});
|
|
3573
|
+
|
|
3461
3574
|
// src/schema/widgets/checkout-and-beyond/image.ts
|
|
3462
|
-
var CABImageSectionFields =
|
|
3575
|
+
var CABImageSectionFields = import_zod49.z.object({
|
|
3463
3576
|
...CABVariableFields,
|
|
3464
|
-
altText:
|
|
3577
|
+
altText: import_zod49.z.string().refine(checkForHTML, NO_HTML).default(""),
|
|
3465
3578
|
/**
|
|
3466
3579
|
* Image width÷height (e.g. `46` for the progress-bar fill); `null` renders at natural size. Any POSITIVE
|
|
3467
3580
|
* ratio — never limited to 1, but never `0`/negative either: a renderer dividing by it would get `Infinity`,
|
|
3468
3581
|
* and CSS `aspect-ratio` drops a negative value and silently reverts to natural size.
|
|
3469
3582
|
*/
|
|
3470
|
-
aspectRatio:
|
|
3471
|
-
border:
|
|
3472
|
-
buttonField:
|
|
3583
|
+
aspectRatio: import_zod49.z.number().positive().nullable().default(null),
|
|
3584
|
+
border: import_zod49.z.lazy(() => CABBorder),
|
|
3585
|
+
buttonField: import_zod49.z.enum(buttonFields).optional(),
|
|
3473
3586
|
/**
|
|
3474
3587
|
* `icon` renders `source` as a single `s-icon` by name (the uber-image path covers icons too), reading
|
|
3475
3588
|
* `iconSize`/`iconTone`. The other values are a harmless informational holdover from the previous
|
|
@@ -3488,29 +3601,30 @@ var CABImageSectionFields = import_zod45.z.object({
|
|
|
3488
3601
|
* behavior degraded gracefully and told us about it. The client-assembled half of the invariant was never
|
|
3489
3602
|
* the risky half.
|
|
3490
3603
|
*/
|
|
3491
|
-
category:
|
|
3604
|
+
category: import_zod49.z.enum(["gallery", "icon", "icons", "payment-methods", "secure-checkout"]).nullable().default(null),
|
|
3492
3605
|
/** `icon`-mode only: the `s-icon` `size`; `null` ⇒ the component default (`base`). Ignored by image treatments. */
|
|
3493
|
-
iconSize:
|
|
3606
|
+
iconSize: import_zod49.z.enum(iconSizes).nullable().default(null),
|
|
3494
3607
|
/** `icon`-mode only: the `s-icon` `tone`; `null` ⇒ the component default (`auto`). Ignored by image treatments. */
|
|
3495
|
-
iconTone:
|
|
3496
|
-
name:
|
|
3497
|
-
naturalHeight:
|
|
3498
|
-
naturalWidth:
|
|
3608
|
+
iconTone: import_zod49.z.enum(iconTones).nullable().default(null),
|
|
3609
|
+
name: import_zod49.z.string().optional(),
|
|
3610
|
+
naturalHeight: import_zod49.z.number().default(0),
|
|
3611
|
+
naturalWidth: import_zod49.z.number().default(0),
|
|
3499
3612
|
/**
|
|
3500
3613
|
* `contain` (the component default): dimensionless images render in s-image's 1/1 default frame, and
|
|
3501
3614
|
* `cover` would crop non-square art (payment badges lost their edges — 15993); `contain` letterboxes.
|
|
3502
3615
|
*/
|
|
3503
|
-
objectFit:
|
|
3504
|
-
sectionId:
|
|
3505
|
-
sectionType:
|
|
3616
|
+
objectFit: import_zod49.z.enum(objectFits).default(ObjectFit.contain),
|
|
3617
|
+
sectionId: import_zod49.z.uuid().default(() => (0, import_uuid4.v7)()),
|
|
3618
|
+
sectionType: import_zod49.z.literal(SectionType.image).default(SectionType.image),
|
|
3506
3619
|
/**
|
|
3507
3620
|
* An image URL or dynamic token, an empty default, or — when `category: 'icon'` — an icon NAME. Icon mode
|
|
3508
3621
|
* takes a name or `''` only, NOT a token: no renderer resolves a token to an icon today, so accepting one
|
|
3509
3622
|
* would promise a capability that doesn't exist. Widen the refine's carve-out to `DYNAMIC_TOKEN_REGEX` when a
|
|
3510
3623
|
* server-chosen tier icon actually needs it.
|
|
3511
3624
|
*/
|
|
3512
|
-
source:
|
|
3513
|
-
|
|
3625
|
+
source: import_zod49.z.union([import_zod49.z.url(), import_zod49.z.literal(""), import_zod49.z.string().regex(DYNAMIC_TOKEN_REGEX), import_zod49.z.enum(iconNames)]).default(""),
|
|
3626
|
+
thumbnails: CABImageThumbnails.optional(),
|
|
3627
|
+
width: import_zod49.z.number().default(100)
|
|
3514
3628
|
});
|
|
3515
3629
|
var iconNameSet = new Set(iconNames);
|
|
3516
3630
|
var isIconName = (source2) => iconNameSet.has(source2);
|
|
@@ -3530,35 +3644,35 @@ var CABImageSection = CABImageSectionFields.superRefine(({ category, source: sou
|
|
|
3530
3644
|
});
|
|
3531
3645
|
|
|
3532
3646
|
// src/schema/widgets/checkout-and-beyond/button.ts
|
|
3533
|
-
var CABButtonContent =
|
|
3534
|
-
() =>
|
|
3647
|
+
var CABButtonContent = import_zod50.z.lazy(
|
|
3648
|
+
() => import_zod50.z.discriminatedUnion("sectionType", [CABImageSection, CABLayoutSection, CABTextSection])
|
|
3535
3649
|
);
|
|
3536
|
-
var CABButtonSection =
|
|
3650
|
+
var CABButtonSection = import_zod50.z.object({
|
|
3537
3651
|
...CABVariableFields,
|
|
3538
|
-
action:
|
|
3539
|
-
buttonStyle:
|
|
3540
|
-
custom:
|
|
3541
|
-
color:
|
|
3542
|
-
height:
|
|
3543
|
-
width:
|
|
3652
|
+
action: import_zod50.z.union([import_zod50.z.literal(""), import_zod50.z.enum(buttonActions)]).default(""),
|
|
3653
|
+
buttonStyle: import_zod50.z.enum(buttonStyles).default(ButtonStyle.primary),
|
|
3654
|
+
custom: import_zod50.z.object({
|
|
3655
|
+
color: import_zod50.z.string().regex(HEX_COLOR_REGEX).default("#005bd3"),
|
|
3656
|
+
height: import_zod50.z.number().default(52),
|
|
3657
|
+
width: import_zod50.z.number().default(300)
|
|
3544
3658
|
}).default({
|
|
3545
3659
|
color: "#005bd3",
|
|
3546
3660
|
height: 52,
|
|
3547
3661
|
width: 300
|
|
3548
3662
|
}),
|
|
3549
|
-
disableDowngrade:
|
|
3550
|
-
name:
|
|
3551
|
-
optionId:
|
|
3552
|
-
popover:
|
|
3553
|
-
alignment:
|
|
3554
|
-
position:
|
|
3663
|
+
disableDowngrade: import_zod50.z.boolean().default(false),
|
|
3664
|
+
name: import_zod50.z.string().optional(),
|
|
3665
|
+
optionId: import_zod50.z.number().optional(),
|
|
3666
|
+
popover: import_zod50.z.object({
|
|
3667
|
+
alignment: import_zod50.z.enum(textAlignments).default(TextAlignment.center),
|
|
3668
|
+
position: import_zod50.z.enum(popoverPositions).default(PopoverPosition.blockStart)
|
|
3555
3669
|
}).optional().default(() => ({
|
|
3556
3670
|
alignment: TextAlignment.center,
|
|
3557
3671
|
position: PopoverPosition.blockStart
|
|
3558
3672
|
})),
|
|
3559
|
-
sectionId:
|
|
3560
|
-
sections:
|
|
3561
|
-
sectionType:
|
|
3673
|
+
sectionId: import_zod50.z.uuid().default(() => (0, import_uuid5.v7)()),
|
|
3674
|
+
sections: import_zod50.z.union([import_zod50.z.array(CABButtonContent), import_zod50.z.strictObject({}).transform(() => [])]).default(() => []),
|
|
3675
|
+
sectionType: import_zod50.z.literal(SectionType.button).default(SectionType.button),
|
|
3562
3676
|
/**
|
|
3563
3677
|
* The smart-cart tier this button acts on (`addGift`/`removeGift`): scopes the click to one tier's gift. The
|
|
3564
3678
|
* client resolves the tier's gift (productId) from the progress-bar context by this `tierId` — the button node
|
|
@@ -3573,96 +3687,96 @@ var CABButtonSection = import_zod46.z.object({
|
|
|
3573
3687
|
* lookup finds no tier and the click resolves to nothing. Safe to bound — the field is new, so there are no
|
|
3574
3688
|
* stored payloads to grandfather, and the producer is client code, not a merchant form.
|
|
3575
3689
|
*/
|
|
3576
|
-
tier:
|
|
3690
|
+
tier: import_zod50.z.object({ tierId: import_zod50.z.string().min(1) }).optional(),
|
|
3577
3691
|
/** Fire-and-forget pixel POSTed when the button is clicked (e.g. a Monetize decline). */
|
|
3578
|
-
trackingUrl:
|
|
3692
|
+
trackingUrl: import_zod50.z.string().optional(),
|
|
3579
3693
|
/**
|
|
3580
3694
|
* Secondary effects applied to in-scope variables on click, alongside (never instead of) the primary
|
|
3581
3695
|
* `action` — an `addToOrder` button can also flip a variable. Applied in array order.
|
|
3582
3696
|
*/
|
|
3583
|
-
variableEffects:
|
|
3697
|
+
variableEffects: import_zod50.z.array(CABVariableEffect).optional()
|
|
3584
3698
|
});
|
|
3585
3699
|
|
|
3586
3700
|
// src/schema/widgets/checkout-and-beyond/carousel.ts
|
|
3587
|
-
var
|
|
3701
|
+
var import_zod55 = require("zod");
|
|
3588
3702
|
|
|
3589
3703
|
// src/schema/widgets/checkout-and-beyond/offers.ts
|
|
3590
|
-
var
|
|
3704
|
+
var import_zod54 = require("zod");
|
|
3591
3705
|
|
|
3592
3706
|
// src/schema/widgets/checkout-and-beyond/dataSource.ts
|
|
3593
3707
|
var import_uuid6 = require("uuid");
|
|
3594
|
-
var
|
|
3595
|
-
var CABDiscount =
|
|
3596
|
-
amount:
|
|
3597
|
-
discountedBy:
|
|
3598
|
-
discountedFrom:
|
|
3599
|
-
type:
|
|
3600
|
-
});
|
|
3601
|
-
var CABIntegrations =
|
|
3602
|
-
judgeme:
|
|
3603
|
-
junip:
|
|
3604
|
-
klaviyo:
|
|
3605
|
-
loox:
|
|
3606
|
-
okendo:
|
|
3607
|
-
opinew:
|
|
3608
|
-
reviewsio:
|
|
3609
|
-
stamped:
|
|
3610
|
-
yotpo:
|
|
3611
|
-
});
|
|
3612
|
-
var CABVariantLabels =
|
|
3613
|
-
variantOption:
|
|
3614
|
-
variantOptions:
|
|
3615
|
-
});
|
|
3616
|
-
var CABDataSourceSection =
|
|
3617
|
-
dataSourceId:
|
|
3618
|
-
dataSourcePath:
|
|
3708
|
+
var import_zod51 = require("zod");
|
|
3709
|
+
var CABDiscount = import_zod51.z.object({
|
|
3710
|
+
amount: import_zod51.z.union([import_zod51.z.number(), import_zod51.z.string()]).catch(0),
|
|
3711
|
+
discountedBy: import_zod51.z.string().optional(),
|
|
3712
|
+
discountedFrom: import_zod51.z.enum(discountSources).optional().catch(void 0),
|
|
3713
|
+
type: import_zod51.z.enum(discountTypes).catch("none")
|
|
3714
|
+
});
|
|
3715
|
+
var CABIntegrations = import_zod51.z.object({
|
|
3716
|
+
judgeme: import_zod51.z.boolean().default(false),
|
|
3717
|
+
junip: import_zod51.z.boolean().default(false),
|
|
3718
|
+
klaviyo: import_zod51.z.boolean().default(false),
|
|
3719
|
+
loox: import_zod51.z.boolean().default(false),
|
|
3720
|
+
okendo: import_zod51.z.boolean().default(false),
|
|
3721
|
+
opinew: import_zod51.z.boolean().default(false),
|
|
3722
|
+
reviewsio: import_zod51.z.boolean().default(false),
|
|
3723
|
+
stamped: import_zod51.z.boolean().default(false),
|
|
3724
|
+
yotpo: import_zod51.z.boolean().default(false)
|
|
3725
|
+
});
|
|
3726
|
+
var CABVariantLabels = import_zod51.z.object({
|
|
3727
|
+
variantOption: import_zod51.z.string().optional().catch(void 0),
|
|
3728
|
+
variantOptions: import_zod51.z.string().optional().catch(void 0)
|
|
3729
|
+
});
|
|
3730
|
+
var CABDataSourceSection = import_zod51.z.object({
|
|
3731
|
+
dataSourceId: import_zod51.z.number().nullable().default(null),
|
|
3732
|
+
dataSourcePath: import_zod51.z.string().default(DEFAULT_ENDPOINTS[0].value),
|
|
3619
3733
|
discount: CABDiscount.optional(),
|
|
3620
3734
|
integrations: CABIntegrations.optional(),
|
|
3621
|
-
limit:
|
|
3622
|
-
matchVariant:
|
|
3623
|
-
matchVariantOutOfStock:
|
|
3624
|
-
name:
|
|
3625
|
-
productType:
|
|
3626
|
-
sectionId:
|
|
3627
|
-
sectionType:
|
|
3735
|
+
limit: import_zod51.z.number().default(1),
|
|
3736
|
+
matchVariant: import_zod51.z.boolean().default(false),
|
|
3737
|
+
matchVariantOutOfStock: import_zod51.z.boolean().default(false),
|
|
3738
|
+
name: import_zod51.z.string().default(DEFAULT_ENDPOINTS[0].label),
|
|
3739
|
+
productType: import_zod51.z.enum(productTypes).optional(),
|
|
3740
|
+
sectionId: import_zod51.z.uuid().default(() => (0, import_uuid6.v7)()),
|
|
3741
|
+
sectionType: import_zod51.z.literal(SectionType.dataSource).default(SectionType.dataSource),
|
|
3628
3742
|
/** Default subscribe-vs-one-time for `productType: both` (legacy `subscription_is_default`). */
|
|
3629
|
-
subscriptionIsDefault:
|
|
3630
|
-
treatAsGwp:
|
|
3743
|
+
subscriptionIsDefault: import_zod51.z.boolean().default(false),
|
|
3744
|
+
treatAsGwp: import_zod51.z.boolean().default(false),
|
|
3631
3745
|
variantLabels: CABVariantLabels.optional().catch(void 0)
|
|
3632
3746
|
});
|
|
3633
3747
|
|
|
3634
3748
|
// src/schema/widgets/checkout-and-beyond/products.ts
|
|
3635
3749
|
var import_uuid8 = require("uuid");
|
|
3636
|
-
var
|
|
3750
|
+
var import_zod53 = require("zod");
|
|
3637
3751
|
|
|
3638
3752
|
// src/schema/widgets/checkout-and-beyond/product.ts
|
|
3639
3753
|
var import_uuid7 = require("uuid");
|
|
3640
|
-
var
|
|
3641
|
-
var CABVariantContent =
|
|
3642
|
-
() =>
|
|
3754
|
+
var import_zod52 = require("zod");
|
|
3755
|
+
var CABVariantContent = import_zod52.z.lazy(
|
|
3756
|
+
() => import_zod52.z.discriminatedUnion("sectionType", [CABButtonSection, CABTextSection])
|
|
3643
3757
|
);
|
|
3644
|
-
var CABProductSection =
|
|
3758
|
+
var CABProductSection = import_zod52.z.object({
|
|
3645
3759
|
...CABVariableFields,
|
|
3646
|
-
name:
|
|
3647
|
-
productId:
|
|
3648
|
-
sectionId:
|
|
3649
|
-
sections:
|
|
3650
|
-
sectionType:
|
|
3651
|
-
selectors:
|
|
3652
|
-
variantMode:
|
|
3760
|
+
name: import_zod52.z.string().optional(),
|
|
3761
|
+
productId: import_zod52.z.number().nullable().default(null),
|
|
3762
|
+
sectionId: import_zod52.z.uuid().default(() => (0, import_uuid7.v7)()),
|
|
3763
|
+
sections: import_zod52.z.union([import_zod52.z.array(CABVariantContent), import_zod52.z.strictObject({}).transform(() => [])]).default(() => []),
|
|
3764
|
+
sectionType: import_zod52.z.literal(SectionType.product).default(SectionType.product),
|
|
3765
|
+
selectors: import_zod52.z.record(import_zod52.z.string(), import_zod52.z.enum(variantSelectors).default(VariantSelector.menu)).default(() => ({})),
|
|
3766
|
+
variantMode: import_zod52.z.enum(variantModes).default(VariantMode.multiple)
|
|
3653
3767
|
});
|
|
3654
3768
|
|
|
3655
3769
|
// src/schema/widgets/checkout-and-beyond/products.ts
|
|
3656
|
-
var CABProductsSection =
|
|
3770
|
+
var CABProductsSection = import_zod53.z.object({
|
|
3657
3771
|
...CABVariableFields,
|
|
3658
|
-
name:
|
|
3659
|
-
sectionId:
|
|
3660
|
-
sections:
|
|
3661
|
-
sectionType:
|
|
3772
|
+
name: import_zod53.z.string().optional(),
|
|
3773
|
+
sectionId: import_zod53.z.uuid().default(() => (0, import_uuid8.v7)()),
|
|
3774
|
+
sections: import_zod53.z.union([import_zod53.z.array(import_zod53.z.lazy(() => CABProductSection)), import_zod53.z.strictObject({}).transform(() => [])]).default(() => []),
|
|
3775
|
+
sectionType: import_zod53.z.literal(SectionType.products).default(SectionType.products)
|
|
3662
3776
|
});
|
|
3663
3777
|
|
|
3664
3778
|
// src/schema/widgets/checkout-and-beyond/offers.ts
|
|
3665
|
-
var CABOffersSection =
|
|
3779
|
+
var CABOffersSection = import_zod54.z.lazy(
|
|
3666
3780
|
() => CABLayoutSection.omit({ sections: true, sectionType: true }).extend({
|
|
3667
3781
|
/**
|
|
3668
3782
|
* A rule between consecutive cards in the vertical list — legacy checkout-offers' `<Divider />`,
|
|
@@ -3670,8 +3784,8 @@ var CABOffersSection = import_zod50.z.lazy(
|
|
|
3670
3784
|
* run of products). Optional, not defaulted: only the v1 converter sets it (REB-24265); a
|
|
3671
3785
|
* hand-built tree keeps React CAB's dividerless rendering.
|
|
3672
3786
|
*/
|
|
3673
|
-
divider:
|
|
3674
|
-
sections:
|
|
3787
|
+
divider: import_zod54.z.boolean().optional(),
|
|
3788
|
+
sections: import_zod54.z.union([import_zod54.z.array(import_zod54.z.lazy(() => CABSection)), import_zod54.z.strictObject({}).transform(() => [])]).default(() => [
|
|
3675
3789
|
CABBannerSection.parse({
|
|
3676
3790
|
buttonField: "undoAddToOrder",
|
|
3677
3791
|
color: "success",
|
|
@@ -3685,77 +3799,77 @@ var CABOffersSection = import_zod50.z.lazy(
|
|
|
3685
3799
|
CABDataSourceSection.parse({}),
|
|
3686
3800
|
CABProductsSection.parse({})
|
|
3687
3801
|
]),
|
|
3688
|
-
sectionType:
|
|
3802
|
+
sectionType: import_zod54.z.literal(SectionType.offers).default(SectionType.offers)
|
|
3689
3803
|
})
|
|
3690
3804
|
);
|
|
3691
3805
|
|
|
3692
3806
|
// src/schema/widgets/checkout-and-beyond/carousel.ts
|
|
3693
|
-
var CABCarouselSection =
|
|
3807
|
+
var CABCarouselSection = import_zod55.z.lazy(
|
|
3694
3808
|
() => CABLayoutSection.omit({ sections: true, sectionType: true }).extend({
|
|
3695
|
-
autoAdvanceInterval:
|
|
3696
|
-
itemsAtOnce:
|
|
3809
|
+
autoAdvanceInterval: import_zod55.z.number().default(0),
|
|
3810
|
+
itemsAtOnce: import_zod55.z.number().min(1).default(1),
|
|
3697
3811
|
/** Card arrangement for the offers child (`horizontal` = side-by-side) — NOT the carousel's own `direction`. */
|
|
3698
|
-
offersDirection:
|
|
3699
|
-
sections:
|
|
3700
|
-
sectionType:
|
|
3812
|
+
offersDirection: import_zod55.z.enum(offersDirections).default("vertical"),
|
|
3813
|
+
sections: import_zod55.z.union([import_zod55.z.array(import_zod55.z.lazy(() => CABSection)), import_zod55.z.strictObject({}).transform(() => [])]).default(() => [CABOffersSection.parse({})]),
|
|
3814
|
+
sectionType: import_zod55.z.literal(SectionType.carousel).default(SectionType.carousel)
|
|
3701
3815
|
})
|
|
3702
3816
|
);
|
|
3703
3817
|
|
|
3704
3818
|
// src/schema/widgets/checkout-and-beyond/cartLine.ts
|
|
3705
|
-
var
|
|
3706
|
-
var CABCartLineSection =
|
|
3819
|
+
var import_zod56 = require("zod");
|
|
3820
|
+
var CABCartLineSection = import_zod56.z.lazy(
|
|
3707
3821
|
() => CABLayoutSection.omit({ sections: true, sectionType: true }).extend({
|
|
3708
|
-
sections:
|
|
3709
|
-
sectionType:
|
|
3822
|
+
sections: import_zod56.z.union([import_zod56.z.array(import_zod56.z.lazy(() => CABSection)), import_zod56.z.strictObject({}).transform(() => [])]).default(() => [CABButtonSection.parse({ action: ButtonAction.switchToSubscription })]),
|
|
3823
|
+
sectionType: import_zod56.z.literal(SectionType.cartLine).default(SectionType.cartLine)
|
|
3710
3824
|
})
|
|
3711
3825
|
);
|
|
3712
3826
|
|
|
3713
3827
|
// src/schema/widgets/checkout-and-beyond/discount.ts
|
|
3714
3828
|
var import_uuid9 = require("uuid");
|
|
3715
|
-
var
|
|
3716
|
-
var CABDiscountSection =
|
|
3829
|
+
var import_zod57 = require("zod");
|
|
3830
|
+
var CABDiscountSection = import_zod57.z.object({
|
|
3717
3831
|
...CABVariableFields,
|
|
3718
|
-
amount:
|
|
3719
|
-
discountedBy:
|
|
3720
|
-
discountedFrom:
|
|
3721
|
-
message:
|
|
3722
|
-
name:
|
|
3723
|
-
quantity:
|
|
3724
|
-
sectionId:
|
|
3725
|
-
sectionType:
|
|
3726
|
-
type:
|
|
3832
|
+
amount: import_zod57.z.union([import_zod57.z.number(), import_zod57.z.string()]).catch(0),
|
|
3833
|
+
discountedBy: import_zod57.z.string().optional(),
|
|
3834
|
+
discountedFrom: import_zod57.z.enum(discountSources).optional().catch(void 0),
|
|
3835
|
+
message: import_zod57.z.string().optional(),
|
|
3836
|
+
name: import_zod57.z.string().optional(),
|
|
3837
|
+
quantity: import_zod57.z.number().default(1),
|
|
3838
|
+
sectionId: import_zod57.z.uuid().default(() => (0, import_uuid9.v7)()),
|
|
3839
|
+
sectionType: import_zod57.z.literal(SectionType.discount).default(SectionType.discount),
|
|
3840
|
+
type: import_zod57.z.enum(discountTypes).catch("none")
|
|
3727
3841
|
});
|
|
3728
3842
|
|
|
3729
3843
|
// src/schema/widgets/checkout-and-beyond/monetize.ts
|
|
3730
3844
|
var import_uuid10 = require("uuid");
|
|
3731
|
-
var
|
|
3732
|
-
var CABMonetizeAds =
|
|
3733
|
-
requestId:
|
|
3845
|
+
var import_zod58 = require("zod");
|
|
3846
|
+
var CABMonetizeAds = import_zod58.z.object({
|
|
3847
|
+
requestId: import_zod58.z.string().optional(),
|
|
3734
3848
|
/** Defaulted here, never in the beacon: absence of information is `ads` itself being absent. */
|
|
3735
|
-
testing:
|
|
3849
|
+
testing: import_zod58.z.boolean().default(false)
|
|
3736
3850
|
});
|
|
3737
|
-
var CABMonetizeSection =
|
|
3851
|
+
var CABMonetizeSection = import_zod58.z.object({
|
|
3738
3852
|
...CABVariableFields,
|
|
3739
3853
|
ads: CABMonetizeAds.optional(),
|
|
3740
|
-
name:
|
|
3854
|
+
name: import_zod58.z.string().optional(),
|
|
3741
3855
|
/**
|
|
3742
3856
|
* Server-hydrated offer cards (inline hydration): when `/cab/sections` was asked with a `monetize`
|
|
3743
3857
|
* context block, the composed cards ride the marker itself — `[]` means "hydrated, no fill" (render
|
|
3744
3858
|
* nothing, skip the fetch); ABSENT means "not hydrated" (the client fetches via `/cab/monetize`).
|
|
3745
3859
|
*/
|
|
3746
|
-
offers:
|
|
3860
|
+
offers: import_zod58.z.array(import_zod58.z.lazy(() => CABSection)).optional(),
|
|
3747
3861
|
/** 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. */
|
|
3748
|
-
privacyPolicyUrl:
|
|
3749
|
-
sectionId:
|
|
3750
|
-
sectionType:
|
|
3862
|
+
privacyPolicyUrl: import_zod58.z.string().optional(),
|
|
3863
|
+
sectionId: import_zod58.z.uuid().default(() => (0, import_uuid10.v7)()),
|
|
3864
|
+
sectionType: import_zod58.z.literal(SectionType.monetize).default(SectionType.monetize),
|
|
3751
3865
|
/** Ads-taxonomy sub-vertical id (the widget's `sub_vertical` setting); paired with `vertical`. */
|
|
3752
|
-
subVertical:
|
|
3866
|
+
subVertical: import_zod58.z.string().optional(),
|
|
3753
3867
|
/** Ads-taxonomy vertical id (the widget's `vertical` setting) — with `subVertical`, the admin Monetize editor's two configurables. */
|
|
3754
|
-
vertical:
|
|
3868
|
+
vertical: import_zod58.z.string().optional()
|
|
3755
3869
|
});
|
|
3756
3870
|
|
|
3757
3871
|
// src/schema/widgets/checkout-and-beyond/progressBar.ts
|
|
3758
|
-
var
|
|
3872
|
+
var import_zod59 = require("zod");
|
|
3759
3873
|
|
|
3760
3874
|
// src/schema/widgets/checkout-and-beyond/giftLabels.ts
|
|
3761
3875
|
var GIFT_LABELS = {
|
|
@@ -3874,34 +3988,34 @@ var GIFT_LABELS = {
|
|
|
3874
3988
|
};
|
|
3875
3989
|
|
|
3876
3990
|
// src/schema/widgets/checkout-and-beyond/progressBar.ts
|
|
3877
|
-
var CABProgressTierExclusion =
|
|
3878
|
-
collectionIds:
|
|
3879
|
-
productIds:
|
|
3880
|
-
tags:
|
|
3881
|
-
type:
|
|
3991
|
+
var CABProgressTierExclusion = import_zod59.z.object({
|
|
3992
|
+
collectionIds: import_zod59.z.array(import_zod59.z.number().int().positive()).default(() => []),
|
|
3993
|
+
productIds: import_zod59.z.array(import_zod59.z.number().int().positive()).default(() => []),
|
|
3994
|
+
tags: import_zod59.z.array(import_zod59.z.string().min(1)).default(() => []),
|
|
3995
|
+
type: import_zod59.z.enum(progressTierExclusionTypes)
|
|
3882
3996
|
});
|
|
3883
|
-
var CABProgressTier =
|
|
3997
|
+
var CABProgressTier = import_zod59.z.object({
|
|
3884
3998
|
/**
|
|
3885
3999
|
* Order-discount tiers only (onsite `discount`): the reward the order-discount Function applies at
|
|
3886
4000
|
* cart time, carried so the client can resolve the `{{discountAmount}}` token in this tier's copy.
|
|
3887
4001
|
* `fixedAmount`: shop-currency CENTS (FX-scaled by the client, like {@link CABProgressTier.threshold});
|
|
3888
4002
|
* `percentage`: the whole-percent number rendered raw (`{n}%`). Absent on non-discount tiers.
|
|
3889
4003
|
*/
|
|
3890
|
-
discount:
|
|
4004
|
+
discount: import_zod59.z.object({ amount: import_zod59.z.number().nonnegative(), type: import_zod59.z.enum(["fixedAmount", "percentage"]) }).optional(),
|
|
3891
4005
|
/**
|
|
3892
4006
|
* Per-tier exclusion rules (onsite `exclusions` when `exclusions_enabled`): lines they match don't count
|
|
3893
4007
|
* toward this tier. Empty (the default, and the converter's output for a disabled or ruleless tier) means
|
|
3894
4008
|
* the tier measures the plain bar-level adjusted progress. Consumers read ONLY the list named by the rule's
|
|
3895
4009
|
* `type` — the converter leaves the other two at `[]`, so a populated off-type list never reaches the tree.
|
|
3896
4010
|
*/
|
|
3897
|
-
exclusions:
|
|
4011
|
+
exclusions: import_zod59.z.array(CABProgressTierExclusion).default(() => []),
|
|
3898
4012
|
/**
|
|
3899
4013
|
* Smart-cart product (gift) tiers only (onsite `filter_oos_variants`): when set, the client drops this
|
|
3900
4014
|
* tier entirely once its gift has NO in-stock eligible variant — the milestone, fill slot and gift
|
|
3901
4015
|
* controls all disappear, mirroring onsite removing the tier from `bar.tiers` before it renders. Absent
|
|
3902
4016
|
* on shipping/discount/decorative tiers and left off by default (the tier renders regardless of stock).
|
|
3903
4017
|
*/
|
|
3904
|
-
filterOosVariants:
|
|
4018
|
+
filterOosVariants: import_zod59.z.boolean().default(false),
|
|
3905
4019
|
/**
|
|
3906
4020
|
* Smart-cart product (gift) tiers only: the reward unlocked at this tier. The client enriches
|
|
3907
4021
|
* `productId`/`variantIds` to live variants (availability, price) and adds the chosen one to the cart
|
|
@@ -3909,10 +4023,10 @@ var CABProgressTier = import_zod55.z.object({
|
|
|
3909
4023
|
* tiers and on tiers with no configured product. Cart add/remove is a later stage; carried here so the
|
|
3910
4024
|
* tree is complete.
|
|
3911
4025
|
*/
|
|
3912
|
-
gift:
|
|
3913
|
-
productId:
|
|
3914
|
-
title:
|
|
3915
|
-
variantIds:
|
|
4026
|
+
gift: import_zod59.z.object({
|
|
4027
|
+
productId: import_zod59.z.number().int().positive(),
|
|
4028
|
+
title: import_zod59.z.string().optional(),
|
|
4029
|
+
variantIds: import_zod59.z.array(import_zod59.z.number().int().positive()).default(() => [])
|
|
3916
4030
|
}).optional(),
|
|
3917
4031
|
/**
|
|
3918
4032
|
* The step-row icon's square size in PIXELS (onsite `product_tier_element_size`, an admin px string the
|
|
@@ -3932,7 +4046,7 @@ var CABProgressTier = import_zod55.z.object({
|
|
|
3932
4046
|
* renderer never spells a fallback), which also makes a tree authored before this field render at
|
|
3933
4047
|
* React's size rather than the old hardcoded 20.
|
|
3934
4048
|
*/
|
|
3935
|
-
iconSizePx:
|
|
4049
|
+
iconSizePx: import_zod59.z.number().int().min(1).max(64).default(18),
|
|
3936
4050
|
/**
|
|
3937
4051
|
* The step-row label at this tier's slot (onsite `getTierLabel`): the merchant custom label, else the
|
|
3938
4052
|
* type default — 'Free Shipping' or '{n}% Discount'. A PRODUCT tier gets NO converter label: its name is
|
|
@@ -3942,35 +4056,35 @@ var CABProgressTier = import_zod55.z.object({
|
|
|
3942
4056
|
* turns a blank label into an absent key, and a client-authored blank means the same thing — the renderer
|
|
3943
4057
|
* emits no caption slot rather than an empty one). Plain text — a compact icon+label.
|
|
3944
4058
|
*/
|
|
3945
|
-
label:
|
|
4059
|
+
label: import_zod59.z.record(import_zod59.z.string(), import_zod59.z.string()).optional(),
|
|
3946
4060
|
/**
|
|
3947
4061
|
* Smart-cart product (gift) tiers only (onsite `product_tier_image`): show the gift's product image in
|
|
3948
4062
|
* the step-row slot instead of the generic bag icon. The converter can't supply the image URL (config
|
|
3949
4063
|
* carries only product IDs), so the client resolves it (authoritative Shopify featured image, React
|
|
3950
4064
|
* parity) and falls back to the bag icon when the flag is off or no image resolves. Default false.
|
|
3951
4065
|
*/
|
|
3952
|
-
productTierImage:
|
|
4066
|
+
productTierImage: import_zod59.z.boolean().default(false),
|
|
3953
4067
|
/**
|
|
3954
4068
|
* The tier's goal, measured per `unit`. `currency` (default): SHOP-currency cents — the canonical
|
|
3955
4069
|
* fallback: when the buyer's presentment currency has no entry in `thresholds`, the client
|
|
3956
4070
|
* multiplies this by the live FX rate (converter maps the v1 `unlock_price`, e.g. `75` → `7500`).
|
|
3957
4071
|
* `item`: a raw item count — no cents, no FX, no `thresholds` overrides.
|
|
3958
4072
|
*/
|
|
3959
|
-
threshold:
|
|
4073
|
+
threshold: import_zod59.z.number().int().nonnegative(),
|
|
3960
4074
|
/**
|
|
3961
4075
|
* Per-presentment-currency goal overrides — lowercased ISO currency code → cents (e.g. `{ cad: 9900 }`).
|
|
3962
4076
|
* When the buyer's currency has an entry, the client uses it verbatim INSTEAD of FX-converting
|
|
3963
4077
|
* `threshold`, so merchants show intentional, clean per-market amounts (Shopify Markets) rather than a
|
|
3964
4078
|
* converted base. Defaults to `{}` — no overrides means always fall back to `threshold`.
|
|
3965
4079
|
*/
|
|
3966
|
-
thresholds:
|
|
4080
|
+
thresholds: import_zod59.z.record(import_zod59.z.string(), import_zod59.z.number().int().nonnegative()).default(() => ({})),
|
|
3967
4081
|
/**
|
|
3968
4082
|
* Smart-cart tier identifier, mirrored onto the gift cart line's `_tier` attribute so the client can
|
|
3969
4083
|
* match an in-cart gift back to its tier (add on reach, remove on downgrade/decline). Absent on the
|
|
3970
4084
|
* shipping bar (single unlabeled tier, no gift).
|
|
3971
4085
|
*/
|
|
3972
|
-
tierId:
|
|
3973
|
-
tierType:
|
|
4086
|
+
tierId: import_zod59.z.string().optional(),
|
|
4087
|
+
tierType: import_zod59.z.enum(progressTierTypes).default(ProgressTierType.shipping),
|
|
3974
4088
|
/**
|
|
3975
4089
|
* What this tier's progress is measured in — PER TIER (onsite's `unlock_condition_type` model, NOT
|
|
3976
4090
|
* the React port's bar-level `tiers[0]` shortcut). `currency` compares money cents against the
|
|
@@ -3981,9 +4095,9 @@ var CABProgressTier = import_zod55.z.object({
|
|
|
3981
4095
|
* count carries no injected noun (no English `item`/`items` inflection on localized copy); merchant
|
|
3982
4096
|
* template text supplies grammatically-neutral wording around the token.
|
|
3983
4097
|
*/
|
|
3984
|
-
unit:
|
|
4098
|
+
unit: import_zod59.z.enum(progressTierUnits).default(ProgressTierUnit.currency)
|
|
3985
4099
|
});
|
|
3986
|
-
var CABProgressBarSection =
|
|
4100
|
+
var CABProgressBarSection = import_zod59.z.lazy(
|
|
3987
4101
|
() => CABLayoutSection.omit({ sectionType: true }).extend({
|
|
3988
4102
|
/**
|
|
3989
4103
|
* The onsite bar id (smart-cart TPB bars only). The client mirrors it to the cart's `_barId` attribute
|
|
@@ -3992,35 +4106,35 @@ var CABProgressBarSection = import_zod55.z.lazy(
|
|
|
3992
4106
|
* checkout reaches the extension without it, so the client writes it or the tier gift's 100% discount
|
|
3993
4107
|
* (and any tier order discount) never applies. Absent on the v1 shipping bar (no gift tiers, no id).
|
|
3994
4108
|
*/
|
|
3995
|
-
barId:
|
|
4109
|
+
barId: import_zod59.z.string().optional(),
|
|
3996
4110
|
/** Empty = shown everywhere; otherwise uppercase ISO country codes. */
|
|
3997
|
-
countryCodes:
|
|
4111
|
+
countryCodes: import_zod59.z.array(import_zod59.z.string().transform((code) => code.trim().toUpperCase())).default(() => []),
|
|
3998
4112
|
/**
|
|
3999
4113
|
* Uppercase ISO codes where a higher-precedence geo bar applies, so this (default, non-geo) bar is
|
|
4000
4114
|
* hidden there — replicates React `getbar`'s geo-match-over-default precedence. Empty = never excluded.
|
|
4001
4115
|
*/
|
|
4002
|
-
excludeCountryCodes:
|
|
4116
|
+
excludeCountryCodes: import_zod59.z.array(import_zod59.z.string().transform((code) => code.trim().toUpperCase())).default(() => []),
|
|
4003
4117
|
/**
|
|
4004
4118
|
* Measure progress against the PRE-discount subtotal (onsite `exclude_discount_in_subtotal`, and
|
|
4005
4119
|
* forced on for bars with a discount tier so its own reward can't un-reach the tier). The client
|
|
4006
4120
|
* adds the cart's discount allocations back to the live subtotal.
|
|
4007
4121
|
*/
|
|
4008
|
-
excludeDiscountInSubtotal:
|
|
4122
|
+
excludeDiscountInSubtotal: import_zod59.z.boolean().default(false),
|
|
4009
4123
|
/** Variant ids the client subtracts from the adjusted subtotal (React `bar.excluded_products`). */
|
|
4010
|
-
excludedVariantIds:
|
|
4124
|
+
excludedVariantIds: import_zod59.z.array(import_zod59.z.number().int().positive()).default(() => []),
|
|
4011
4125
|
/**
|
|
4012
4126
|
* When the cart holds a subscription item, treat the bar as reached regardless of subtotal (React
|
|
4013
4127
|
* `free_shipping_on_subscription(s)`). `freeShippingOnAll` is already a zero-threshold tier instead.
|
|
4014
4128
|
*/
|
|
4015
|
-
freeShippingOnSubscription:
|
|
4129
|
+
freeShippingOnSubscription: import_zod59.z.boolean().default(false),
|
|
4016
4130
|
/** Localized heading over the gift controls (onsite `gift_area_title`, default 'FREE GIFTS'). */
|
|
4017
|
-
giftAreaTitle:
|
|
4131
|
+
giftAreaTitle: import_zod59.z.record(import_zod59.z.string(), import_zod59.z.string()).default(() => ({ en: "FREE GIFTS" })),
|
|
4018
4132
|
/** Localized gift-control labels (add/remove/heading); a tier's gift `title` beats `yourGift`. */
|
|
4019
|
-
giftLabels:
|
|
4020
|
-
addGift:
|
|
4021
|
-
remove:
|
|
4022
|
-
selectOptions:
|
|
4023
|
-
yourGift:
|
|
4133
|
+
giftLabels: import_zod59.z.object({
|
|
4134
|
+
addGift: import_zod59.z.record(import_zod59.z.string(), import_zod59.z.string()).default(() => ({ ...GIFT_LABELS.addGift })),
|
|
4135
|
+
remove: import_zod59.z.record(import_zod59.z.string(), import_zod59.z.string()).default(() => ({ ...GIFT_LABELS.remove })),
|
|
4136
|
+
selectOptions: import_zod59.z.record(import_zod59.z.string(), import_zod59.z.string()).default(() => ({ ...GIFT_LABELS.selectOptions })),
|
|
4137
|
+
yourGift: import_zod59.z.record(import_zod59.z.string(), import_zod59.z.string()).default(() => ({ ...GIFT_LABELS.yourGift }))
|
|
4024
4138
|
}).default(() => ({
|
|
4025
4139
|
addGift: { ...GIFT_LABELS.addGift },
|
|
4026
4140
|
remove: { ...GIFT_LABELS.remove },
|
|
@@ -4028,38 +4142,38 @@ var CABProgressBarSection = import_zod55.z.lazy(
|
|
|
4028
4142
|
yourGift: { ...GIFT_LABELS.yourGift }
|
|
4029
4143
|
})),
|
|
4030
4144
|
/** The bar's a11y label; the merchant names it in the editor, else this default (React parity). */
|
|
4031
|
-
name:
|
|
4145
|
+
name: import_zod59.z.string().default("Order progress"),
|
|
4032
4146
|
/**
|
|
4033
4147
|
* Bar fill color. An explicit (widget-authored) value is used verbatim; when absent the server
|
|
4034
4148
|
* fills it with the live shop theme's `buttonBackground` (React `useRebuyTheme` parity). Still
|
|
4035
4149
|
* absent after that ⇒ the theme fetch failed and the client renders its platform-default bar —
|
|
4036
4150
|
* optional, not defaulted, so "merchant chose no color" stays distinguishable from any real value.
|
|
4037
4151
|
*/
|
|
4038
|
-
progressColor:
|
|
4039
|
-
sectionType:
|
|
4152
|
+
progressColor: import_zod59.z.string().optional(),
|
|
4153
|
+
sectionType: import_zod59.z.literal(SectionType.progressBar).default(SectionType.progressBar),
|
|
4040
4154
|
/**
|
|
4041
4155
|
* The bar's milestones in the merchant's CONFIGURED order — the renderer does NOT sort them (022
|
|
4042
4156
|
* O-B2: sorting by resolved threshold reversed configured milestones on out-of-order or mixed-unit
|
|
4043
4157
|
* count-vs-cents bars). Drives the fill (even slot per tier) and, for smart-cart product tiers, the
|
|
4044
4158
|
* gift add/remove. The visual tier display lives in `sections` (composable), NOT here.
|
|
4045
4159
|
*/
|
|
4046
|
-
tiers:
|
|
4160
|
+
tiers: import_zod59.z.union([import_zod59.z.array(CABProgressTier), import_zod59.z.strictObject({}).transform(() => [])]).default(() => [])
|
|
4047
4161
|
})
|
|
4048
4162
|
);
|
|
4049
4163
|
|
|
4050
4164
|
// src/schema/widgets/checkout-and-beyond/quantity.ts
|
|
4051
4165
|
var import_uuid11 = require("uuid");
|
|
4052
|
-
var
|
|
4053
|
-
var CABQuantitySection =
|
|
4166
|
+
var import_zod60 = require("zod");
|
|
4167
|
+
var CABQuantitySection = import_zod60.z.object({
|
|
4054
4168
|
...CABVariableFields,
|
|
4055
|
-
errorMessages:
|
|
4056
|
-
|
|
4057
|
-
|
|
4169
|
+
errorMessages: import_zod60.z.record(
|
|
4170
|
+
import_zod60.z.string(),
|
|
4171
|
+
import_zod60.z.object({
|
|
4058
4172
|
/** `{{step}}` is interpolated at render — the off-increment message React never gave a merchant key. */
|
|
4059
|
-
increment:
|
|
4060
|
-
max:
|
|
4061
|
-
min:
|
|
4062
|
-
neg:
|
|
4173
|
+
increment: import_zod60.z.string().optional(),
|
|
4174
|
+
max: import_zod60.z.string().optional(),
|
|
4175
|
+
min: import_zod60.z.string().optional(),
|
|
4176
|
+
neg: import_zod60.z.string().optional()
|
|
4063
4177
|
})
|
|
4064
4178
|
).default({
|
|
4065
4179
|
en: {
|
|
@@ -4069,18 +4183,18 @@ var CABQuantitySection = import_zod56.z.object({
|
|
|
4069
4183
|
neg: "Quantity cannot be negative"
|
|
4070
4184
|
}
|
|
4071
4185
|
}),
|
|
4072
|
-
inputType:
|
|
4073
|
-
max:
|
|
4074
|
-
min:
|
|
4186
|
+
inputType: import_zod60.z.enum(quantityInputs).default(QuantityInput.select),
|
|
4187
|
+
max: import_zod60.z.number().min(1).max(100).default(10),
|
|
4188
|
+
min: import_zod60.z.number().min(1).default(1),
|
|
4075
4189
|
/** The a11y label for the quantity control; the merchant names it in the editor, else this default. */
|
|
4076
|
-
name:
|
|
4077
|
-
sectionId:
|
|
4078
|
-
sectionType:
|
|
4190
|
+
name: import_zod60.z.string().default("Quantity"),
|
|
4191
|
+
sectionId: import_zod60.z.uuid().default(() => (0, import_uuid11.v7)()),
|
|
4192
|
+
sectionType: import_zod60.z.literal(SectionType.quantity).default(SectionType.quantity)
|
|
4079
4193
|
});
|
|
4080
4194
|
|
|
4081
4195
|
// src/schema/widgets/checkout-and-beyond/reviews.ts
|
|
4082
4196
|
var import_uuid12 = require("uuid");
|
|
4083
|
-
var
|
|
4197
|
+
var import_zod61 = require("zod");
|
|
4084
4198
|
|
|
4085
4199
|
// src/schema/widgets/checkout-and-beyond/reviewLabels.ts
|
|
4086
4200
|
var REVIEW_LABELS = {
|
|
@@ -4143,68 +4257,69 @@ var REVIEW_LABELS = {
|
|
|
4143
4257
|
};
|
|
4144
4258
|
|
|
4145
4259
|
// src/schema/widgets/checkout-and-beyond/reviews.ts
|
|
4146
|
-
var CABReviewsSection =
|
|
4260
|
+
var CABReviewsSection = import_zod61.z.object({
|
|
4147
4261
|
...CABVariableFields,
|
|
4148
|
-
color:
|
|
4262
|
+
color: import_zod61.z.string().default("#fadb14"),
|
|
4149
4263
|
/**
|
|
4150
4264
|
* Localized review-count templates (`{{reviewCount}}`), one/other plural forms; the client picks the
|
|
4151
4265
|
* form via `Intl.PluralRules`. Defaults here (schema-first) so every tree localizes without converter
|
|
4152
4266
|
* or merchant work.
|
|
4153
4267
|
*/
|
|
4154
|
-
countLabels:
|
|
4155
|
-
one:
|
|
4156
|
-
other:
|
|
4268
|
+
countLabels: import_zod61.z.object({
|
|
4269
|
+
one: import_zod61.z.record(import_zod61.z.string(), import_zod61.z.string()).default(() => ({ ...REVIEW_LABELS.one })),
|
|
4270
|
+
other: import_zod61.z.record(import_zod61.z.string(), import_zod61.z.string()).default(() => ({ ...REVIEW_LABELS.other }))
|
|
4157
4271
|
}).default(() => ({ one: { ...REVIEW_LABELS.one }, other: { ...REVIEW_LABELS.other } })),
|
|
4158
|
-
name:
|
|
4159
|
-
sectionId:
|
|
4160
|
-
sectionType:
|
|
4161
|
-
size:
|
|
4272
|
+
name: import_zod61.z.string().optional(),
|
|
4273
|
+
sectionId: import_zod61.z.uuid().default(() => (0, import_uuid12.v7)()),
|
|
4274
|
+
sectionType: import_zod61.z.literal(SectionType.reviews).default(SectionType.reviews),
|
|
4275
|
+
size: import_zod61.z.enum(reviewsSizes).default(ReviewsSize.default),
|
|
4162
4276
|
/**
|
|
4163
4277
|
* Star outline color, interpolated into a style by the renderer, so it is hex-constrained like
|
|
4164
4278
|
* `CABButtonSection.color`. The legacy source (`PostPurchaseSettings.styles.starStrokeColor`) is a free
|
|
4165
4279
|
* string: its converter must validate and fall back to this default rather than let one odd value drop
|
|
4166
4280
|
* the whole reviews section.
|
|
4167
4281
|
*/
|
|
4168
|
-
strokeColor:
|
|
4282
|
+
strokeColor: import_zod61.z.string().regex(HEX_COLOR_REGEX).default("#fadb14"),
|
|
4169
4283
|
/** Star outline width in px; `0` draws no outline. The legacy `styles.strokeWidth` is a STRING ('1') — its converter coerces. */
|
|
4170
|
-
strokeWidth:
|
|
4284
|
+
strokeWidth: import_zod61.z.number().nonnegative().default(0)
|
|
4171
4285
|
});
|
|
4172
4286
|
|
|
4173
4287
|
// src/schema/widgets/checkout-and-beyond/separator.ts
|
|
4174
4288
|
var import_uuid13 = require("uuid");
|
|
4175
|
-
var
|
|
4176
|
-
var CABSeparatorSection =
|
|
4289
|
+
var import_zod62 = require("zod");
|
|
4290
|
+
var CABSeparatorSection = import_zod62.z.object({
|
|
4177
4291
|
...CABVariableFields,
|
|
4178
|
-
sectionId:
|
|
4179
|
-
sectionType:
|
|
4292
|
+
sectionId: import_zod62.z.uuid().default(() => (0, import_uuid13.v7)()),
|
|
4293
|
+
sectionType: import_zod62.z.literal(SectionType.separator).default(SectionType.separator)
|
|
4180
4294
|
});
|
|
4181
4295
|
|
|
4182
4296
|
// src/schema/widgets/checkout-and-beyond/variants.ts
|
|
4183
4297
|
var import_compat5 = require("es-toolkit/compat");
|
|
4184
4298
|
var import_uuid14 = require("uuid");
|
|
4185
|
-
var
|
|
4186
|
-
var CABVariantsSection =
|
|
4299
|
+
var import_zod63 = require("zod");
|
|
4300
|
+
var CABVariantsSection = import_zod63.z.object({
|
|
4187
4301
|
...CABVariableFields,
|
|
4188
|
-
hideOutOfStockVariants:
|
|
4189
|
-
name:
|
|
4190
|
-
sectionId:
|
|
4191
|
-
sectionType:
|
|
4192
|
-
selector:
|
|
4193
|
-
|
|
4302
|
+
hideOutOfStockVariants: import_zod63.z.boolean().default(false),
|
|
4303
|
+
name: import_zod63.z.string().optional(),
|
|
4304
|
+
sectionId: import_zod63.z.uuid().default(() => (0, import_uuid14.v7)()),
|
|
4305
|
+
sectionType: import_zod63.z.literal(SectionType.variants).default(SectionType.variants),
|
|
4306
|
+
selector: import_zod63.z.enum((0, import_compat5.slice)(variantSelectors, 0, 3)).default(VariantSelector.menu),
|
|
4307
|
+
/** `productGroup` is additive (REB-24817): a renderer without group support must render nothing for it. */
|
|
4308
|
+
variantMode: import_zod63.z.enum(variantsModes).default(VariantsMode.multiple)
|
|
4194
4309
|
});
|
|
4195
4310
|
|
|
4196
4311
|
// src/schema/widgets/checkout-and-beyond/shared.ts
|
|
4197
|
-
var CABBorder =
|
|
4198
|
-
radius:
|
|
4199
|
-
style:
|
|
4200
|
-
width:
|
|
4312
|
+
var CABBorder = import_zod64.z.object({
|
|
4313
|
+
radius: import_zod64.z.enum(borderRadii).default(BorderRadius.base),
|
|
4314
|
+
style: import_zod64.z.enum(borderStyles).default(BorderStyle.none),
|
|
4315
|
+
width: import_zod64.z.enum(borderWidths).default(BorderWidth.base)
|
|
4201
4316
|
}).default({
|
|
4202
4317
|
radius: BorderRadius.base,
|
|
4203
4318
|
style: BorderStyle.none,
|
|
4204
4319
|
width: BorderWidth.base
|
|
4205
4320
|
});
|
|
4206
|
-
var CABSection =
|
|
4207
|
-
() =>
|
|
4321
|
+
var CABSection = import_zod64.z.lazy(
|
|
4322
|
+
() => import_zod64.z.discriminatedUnion("sectionType", [
|
|
4208
4323
|
CABBannerSection,
|
|
4209
4324
|
CABButtonSection,
|
|
4210
4325
|
CABCarouselSection,
|
|
@@ -4227,41 +4342,41 @@ var CABSection = import_zod60.z.lazy(
|
|
|
4227
4342
|
);
|
|
4228
4343
|
|
|
4229
4344
|
// src/schema/widgets/checkout-and-beyond/layout.ts
|
|
4230
|
-
var GridItem =
|
|
4231
|
-
var CABLayoutWrapping =
|
|
4232
|
-
breakAt:
|
|
4233
|
-
maxPerLine:
|
|
4345
|
+
var GridItem = import_zod65.z.union([import_zod65.z.literal("auto"), import_zod65.z.literal("fill"), import_zod65.z.string().regex(/^\d+%$/), import_zod65.z.number()]);
|
|
4346
|
+
var CABLayoutWrapping = import_zod65.z.object({
|
|
4347
|
+
breakAt: import_zod65.z.number().positive(),
|
|
4348
|
+
maxPerLine: import_zod65.z.number().int().positive()
|
|
4234
4349
|
});
|
|
4235
|
-
var CABLayoutSection =
|
|
4350
|
+
var CABLayoutSection = import_zod65.z.object({
|
|
4236
4351
|
...CABVariableFields,
|
|
4237
|
-
alignment:
|
|
4238
|
-
horizontal:
|
|
4239
|
-
vertical:
|
|
4352
|
+
alignment: import_zod65.z.object({
|
|
4353
|
+
horizontal: import_zod65.z.enum(horizontalAlignments).default(HorizontalAlignment.start),
|
|
4354
|
+
vertical: import_zod65.z.enum(verticalAlignments).default(VerticalAlignment.top)
|
|
4240
4355
|
}).default({
|
|
4241
4356
|
horizontal: HorizontalAlignment.start,
|
|
4242
4357
|
vertical: VerticalAlignment.top
|
|
4243
4358
|
}),
|
|
4244
|
-
border:
|
|
4245
|
-
buttonField:
|
|
4246
|
-
direction:
|
|
4359
|
+
border: import_zod65.z.lazy(() => CABBorder),
|
|
4360
|
+
buttonField: import_zod65.z.enum(buttonFields).optional(),
|
|
4361
|
+
direction: import_zod65.z.enum(directions).default(Direction.rows),
|
|
4247
4362
|
/**
|
|
4248
4363
|
* Platform chrome around the section, not a layout behavior: `callout` is a subdued box with block borders
|
|
4249
4364
|
* (the legacy post-purchase callout banner), `offer-content` the post-purchase offer's own content card.
|
|
4250
4365
|
*/
|
|
4251
|
-
frame:
|
|
4252
|
-
grid:
|
|
4253
|
-
columns:
|
|
4254
|
-
rows:
|
|
4366
|
+
frame: import_zod65.z.enum(layoutFrames).optional(),
|
|
4367
|
+
grid: import_zod65.z.object({
|
|
4368
|
+
columns: import_zod65.z.union([import_zod65.z.array(GridItem), import_zod65.z.undefined()]).default(() => ["auto"]),
|
|
4369
|
+
rows: import_zod65.z.union([import_zod65.z.array(GridItem), import_zod65.z.undefined()]).default(() => ["auto"])
|
|
4255
4370
|
}).default({ columns: ["auto"], rows: ["auto"] }).optional(),
|
|
4256
|
-
name:
|
|
4257
|
-
padding:
|
|
4258
|
-
sectionId:
|
|
4259
|
-
sections:
|
|
4260
|
-
sectionType:
|
|
4261
|
-
spacing:
|
|
4371
|
+
name: import_zod65.z.string().optional(),
|
|
4372
|
+
padding: import_zod65.z.enum(spacings).default(Spacing.none),
|
|
4373
|
+
sectionId: import_zod65.z.uuid().default(() => (0, import_uuid15.v7)()),
|
|
4374
|
+
sections: import_zod65.z.union([import_zod65.z.array(import_zod65.z.lazy(() => CABSection)), import_zod65.z.strictObject({}).transform(() => [])]).default(() => []),
|
|
4375
|
+
sectionType: import_zod65.z.literal(SectionType.layout).default(SectionType.layout),
|
|
4376
|
+
spacing: import_zod65.z.enum(spacings).default(Spacing.base),
|
|
4262
4377
|
/** Fire-and-forget impression pixel POSTed once when the section is shown (e.g. a Monetize offer view). */
|
|
4263
|
-
viewUrl:
|
|
4264
|
-
width:
|
|
4378
|
+
viewUrl: import_zod65.z.string().optional(),
|
|
4379
|
+
width: import_zod65.z.number().default(100),
|
|
4265
4380
|
wrapping: CABLayoutWrapping.optional()
|
|
4266
4381
|
});
|
|
4267
4382
|
|
|
@@ -4283,8 +4398,8 @@ var UI_LABELS = {
|
|
|
4283
4398
|
};
|
|
4284
4399
|
|
|
4285
4400
|
// src/schema/widgets/checkout-and-beyond/root.ts
|
|
4286
|
-
var localized = (fallback) =>
|
|
4287
|
-
var CABUILabels =
|
|
4401
|
+
var localized = (fallback) => import_zod66.z.record(import_zod66.z.string(), import_zod66.z.string()).default(() => ({ ...fallback })).transform((labels) => Object.keys(labels).length > 0 ? labels : { ...fallback });
|
|
4402
|
+
var CABUILabels = import_zod66.z.object({
|
|
4288
4403
|
currentPage: localized(UI_LABELS.currentPage),
|
|
4289
4404
|
guest: localized(UI_LABELS.guest),
|
|
4290
4405
|
loadingOptions: localized(UI_LABELS.loadingOptions),
|
|
@@ -4309,47 +4424,49 @@ var CABUILabels = import_zod62.z.object({
|
|
|
4309
4424
|
subscriptionOptions: { ...UI_LABELS.subscriptionOptions },
|
|
4310
4425
|
updating: { ...UI_LABELS.updating }
|
|
4311
4426
|
}));
|
|
4312
|
-
var TargetArea =
|
|
4313
|
-
fill:
|
|
4314
|
-
flip:
|
|
4315
|
-
icon:
|
|
4316
|
-
label:
|
|
4317
|
-
width:
|
|
4427
|
+
var TargetArea = import_zod66.z.object({
|
|
4428
|
+
fill: import_zod66.z.boolean().optional(),
|
|
4429
|
+
flip: import_zod66.z.enum(["both", "horizontal", "vertical"]).optional(),
|
|
4430
|
+
icon: import_zod66.z.string(),
|
|
4431
|
+
label: import_zod66.z.string(),
|
|
4432
|
+
width: import_zod66.z.string()
|
|
4318
4433
|
}).default(targetAreas[EditorMode.checkoutExtension][1]);
|
|
4319
|
-
var CABTracking =
|
|
4320
|
-
enableAttribution:
|
|
4321
|
-
enableSource:
|
|
4322
|
-
enableWidget:
|
|
4434
|
+
var CABTracking = import_zod66.z.object({
|
|
4435
|
+
enableAttribution: import_zod66.z.boolean().nullish().transform((value) => value ?? true),
|
|
4436
|
+
enableSource: import_zod66.z.boolean().nullish().transform((value) => value ?? true),
|
|
4437
|
+
enableWidget: import_zod66.z.boolean().nullish().transform((value) => value ?? true)
|
|
4323
4438
|
}).nullish().transform((value) => value ?? { enableAttribution: true, enableSource: true, enableWidget: true });
|
|
4324
|
-
var CABExperiment =
|
|
4325
|
-
elementId:
|
|
4326
|
-
experimentId:
|
|
4327
|
-
experimentType:
|
|
4328
|
-
selectedId:
|
|
4439
|
+
var CABExperiment = import_zod66.z.object({
|
|
4440
|
+
elementId: import_zod66.z.number(),
|
|
4441
|
+
experimentId: import_zod66.z.number(),
|
|
4442
|
+
experimentType: import_zod66.z.string(),
|
|
4443
|
+
selectedId: import_zod66.z.number()
|
|
4329
4444
|
});
|
|
4330
4445
|
var CABRootSection = CABLayoutSection.extend({
|
|
4331
|
-
editorMode:
|
|
4446
|
+
editorMode: import_zod66.z.enum(editorModes).default(EditorMode.checkoutExtension),
|
|
4332
4447
|
experiment: CABExperiment.optional(),
|
|
4333
4448
|
// Same rule as CABTracking above: the v1 converters pass raw legacy `previewMode` through, so a
|
|
4334
4449
|
// `null` must fall back rather than throw the widget; malformed values still throw.
|
|
4335
|
-
previewMode:
|
|
4336
|
-
storeId:
|
|
4450
|
+
previewMode: import_zod66.z.boolean().nullish().transform((value) => value ?? false),
|
|
4451
|
+
storeId: import_zod66.z.number().nullable().default(null),
|
|
4337
4452
|
targetArea: TargetArea.nullable(),
|
|
4338
4453
|
tracking: CABTracking,
|
|
4339
|
-
type:
|
|
4454
|
+
type: import_zod66.z.enum(widgetTypes).default(WidgetType.ui_extension_content_block),
|
|
4340
4455
|
uiLabels: CABUILabels,
|
|
4341
|
-
version:
|
|
4342
|
-
widgetId:
|
|
4456
|
+
version: import_zod66.z.literal(2).default(2),
|
|
4457
|
+
widgetId: import_zod66.z.number().nullable().default(null)
|
|
4343
4458
|
});
|
|
4344
4459
|
|
|
4345
4460
|
// src/schema/postPurchaseProductView.ts
|
|
4346
|
-
var PostPurchaseProductView =
|
|
4347
|
-
|
|
4461
|
+
var PostPurchaseProductView = import_zod67.z.union([
|
|
4462
|
+
import_zod67.z.object({
|
|
4463
|
+
changeset: PostPurchaseProductChangeset.optional(),
|
|
4464
|
+
displayPrice: PostPurchaseDisplayPrice.optional(),
|
|
4348
4465
|
groupCatalog: PostPurchaseGroupCatalog.optional(),
|
|
4349
4466
|
initialVariant: PostPurchaseVariantSelector.optional(),
|
|
4350
4467
|
planCatalog: PostPurchasePlanCatalog.nullable().optional(),
|
|
4351
4468
|
preparation: PreparedPostPurchaseProduct.extend({
|
|
4352
|
-
display: PreparedPostPurchaseProduct.shape.display.extend({ description:
|
|
4469
|
+
display: PreparedPostPurchaseProduct.shape.display.extend({ description: import_zod67.z.string().nullable() }).refine(
|
|
4353
4470
|
({ description, descriptionDocument }) => description === null === (descriptionDocument !== void 0),
|
|
4354
4471
|
"Exactly one of the plain and rich descriptions is shown"
|
|
4355
4472
|
)
|
|
@@ -4358,33 +4475,35 @@ var PostPurchaseProductView = import_zod63.z.union([
|
|
|
4358
4475
|
sections: CABRootSection,
|
|
4359
4476
|
variantCatalog: PostPurchaseVariantCatalog.optional()
|
|
4360
4477
|
}),
|
|
4361
|
-
|
|
4478
|
+
import_zod67.z.object({
|
|
4362
4479
|
groupCatalog: PostPurchaseGroupCatalog.optional(),
|
|
4363
4480
|
initialVariant: PostPurchaseVariantSelector.optional(),
|
|
4481
|
+
/** The localized unavailable copy, for the choices still offered beneath an unprepared product. */
|
|
4482
|
+
labels: PreparedPostPurchaseProduct.shape.labels.pick({ notAvailable: true }).optional(),
|
|
4364
4483
|
planCatalog: PostPurchasePlanCatalog.nullable().optional(),
|
|
4365
4484
|
preparation: PostPurchasePreparation.options[1],
|
|
4366
4485
|
purchaseOptions: PostPurchaseOptions.optional(),
|
|
4367
|
-
sections:
|
|
4486
|
+
sections: import_zod67.z.null(),
|
|
4368
4487
|
variantCatalog: PostPurchaseVariantCatalog.optional()
|
|
4369
4488
|
})
|
|
4370
4489
|
]);
|
|
4371
4490
|
|
|
4372
4491
|
// src/schema/postPurchaseProductCollectionView.ts
|
|
4373
|
-
var PostPurchaseProductCollectionView =
|
|
4374
|
-
members:
|
|
4375
|
-
|
|
4492
|
+
var PostPurchaseProductCollectionView = import_zod68.z.object({
|
|
4493
|
+
members: import_zod68.z.array(
|
|
4494
|
+
import_zod68.z.object({
|
|
4376
4495
|
productId: PostPurchaseProductId,
|
|
4377
|
-
productIndex:
|
|
4496
|
+
productIndex: import_zod68.z.number().int().nonnegative(),
|
|
4378
4497
|
view: PostPurchaseProductView
|
|
4379
4498
|
})
|
|
4380
4499
|
)
|
|
4381
4500
|
});
|
|
4382
|
-
var PostPurchaseCollectionChoice =
|
|
4501
|
+
var PostPurchaseCollectionChoice = import_zod68.z.object({
|
|
4383
4502
|
choice: PostPurchaseChoice.optional(),
|
|
4384
4503
|
productId: PostPurchaseProductId,
|
|
4385
4504
|
variantId: PostPurchaseVariantSelector.shape.variantId.optional()
|
|
4386
4505
|
}).strict();
|
|
4387
|
-
var PostPurchaseExcludedProductIds =
|
|
4506
|
+
var PostPurchaseExcludedProductIds = import_zod68.z.array(PostPurchaseProductId).default([]);
|
|
4388
4507
|
var PostPurchaseMemberSelector = PostPurchaseProgressSchema.shape.members.element.pick({ productId: true }).extend({ progressRevision: PostPurchaseProgressSchema.shape.revision });
|
|
4389
4508
|
var PostPurchaseMemberPointer = PostPurchaseProgressSchema.shape.members.element.omit({ status: true }).extend({
|
|
4390
4509
|
entryRevision: PostPurchaseProgressSchema.shape.entryRevision,
|
|
@@ -4397,7 +4516,7 @@ var PostPurchaseQuantityChoice = PostPurchaseCollectionChoice.extend({ quantity:
|
|
|
4397
4516
|
var PostPurchaseQuantityPolicy = PostPurchaseSettings.shape.quantityInputs.omit({ defaultQuantity: true }).extend({
|
|
4398
4517
|
initialQuantity: quantity,
|
|
4399
4518
|
maxValue: quantity,
|
|
4400
|
-
minValue:
|
|
4519
|
+
minValue: import_zod69.z.literal(0).transform(() => 1).or(quantity)
|
|
4401
4520
|
}).refine(({ maxValue, minValue }) => minValue <= maxValue, "Quantity bounds are reversed");
|
|
4402
4521
|
|
|
4403
4522
|
// src/schema/postPurchaseGroup.ts
|
|
@@ -4406,33 +4525,33 @@ var PostPurchaseGroupChoice = PostPurchaseQuantityChoice.extend({
|
|
|
4406
4525
|
});
|
|
4407
4526
|
|
|
4408
4527
|
// src/schema/postPurchaseHealth.ts
|
|
4409
|
-
var
|
|
4528
|
+
var import_zod72 = require("zod");
|
|
4410
4529
|
|
|
4411
4530
|
// src/schema/postPurchaseHealthSchedule.ts
|
|
4412
|
-
var
|
|
4531
|
+
var import_zod71 = require("zod");
|
|
4413
4532
|
|
|
4414
4533
|
// src/schema/postPurchaseReleaseSchedule.ts
|
|
4415
|
-
var
|
|
4416
|
-
var postPurchaseTaskNameSchema = (queue, id) =>
|
|
4417
|
-
var SessionReleaseScheduleRequestSchema =
|
|
4534
|
+
var import_zod70 = require("zod");
|
|
4535
|
+
var postPurchaseTaskNameSchema = (queue, id) => import_zod70.z.string().regex(new RegExp(`^projects/[a-zA-Z0-9.:-]+/locations/us-central1/queues/${queue}/tasks/${id}$`));
|
|
4536
|
+
var SessionReleaseScheduleRequestSchema = import_zod70.z.strictObject({
|
|
4418
4537
|
deadline: PostPurchaseTimestampSchema,
|
|
4419
4538
|
orderId: PostPurchaseOrderIdSchema,
|
|
4420
4539
|
releaseOwner: ReleaseOwnerSchema,
|
|
4421
4540
|
sessionId: PostPurchaseSessionIdSchema
|
|
4422
4541
|
});
|
|
4423
|
-
var SessionReleaseScheduleResponseSchema =
|
|
4424
|
-
data:
|
|
4542
|
+
var SessionReleaseScheduleResponseSchema = import_zod70.z.object({
|
|
4543
|
+
data: import_zod70.z.discriminatedUnion("status", [
|
|
4425
4544
|
SessionReleaseScheduleRequestSchema.extend({
|
|
4426
|
-
releaseOwner:
|
|
4427
|
-
status:
|
|
4545
|
+
releaseOwner: import_zod70.z.literal("rebuy"),
|
|
4546
|
+
status: import_zod70.z.literal("queued"),
|
|
4428
4547
|
taskName: postPurchaseTaskNameSchema("post-purchase-order-hold-release", "[a-f0-9]{64}-release")
|
|
4429
4548
|
}),
|
|
4430
4549
|
SessionReleaseScheduleRequestSchema.extend({
|
|
4431
|
-
releaseOwner:
|
|
4432
|
-
status:
|
|
4550
|
+
releaseOwner: import_zod70.z.literal("shopify"),
|
|
4551
|
+
status: import_zod70.z.literal("native")
|
|
4433
4552
|
})
|
|
4434
4553
|
]),
|
|
4435
|
-
successful:
|
|
4554
|
+
successful: import_zod70.z.literal(true)
|
|
4436
4555
|
});
|
|
4437
4556
|
|
|
4438
4557
|
// src/schema/postPurchaseHealthSchedule.ts
|
|
@@ -4441,15 +4560,15 @@ var PostPurchaseHealthTaskNameSchema = postPurchaseTaskNameSchema(
|
|
|
4441
4560
|
"post-purchase-health-check",
|
|
4442
4561
|
"[a-z0-9][a-z0-9-]*--[1-9][0-9]*"
|
|
4443
4562
|
);
|
|
4444
|
-
var HealthScheduleAcknowledgementSchema =
|
|
4563
|
+
var HealthScheduleAcknowledgementSchema = import_zod71.z.strictObject({
|
|
4445
4564
|
data: HealthScheduleSchema.extend({
|
|
4446
|
-
status:
|
|
4565
|
+
status: import_zod71.z.literal("queued"),
|
|
4447
4566
|
taskName: PostPurchaseHealthTaskNameSchema
|
|
4448
4567
|
}).refine(
|
|
4449
4568
|
(data) => data.taskName.endsWith(`/tasks/${postPurchaseHealthTaskId(data)}`),
|
|
4450
4569
|
"taskName must be this order's health task"
|
|
4451
4570
|
),
|
|
4452
|
-
successful:
|
|
4571
|
+
successful: import_zod71.z.literal(true)
|
|
4453
4572
|
});
|
|
4454
4573
|
|
|
4455
4574
|
// src/schema/postPurchaseHealth.ts
|
|
@@ -4458,90 +4577,93 @@ var HealthFactSchema = HealthScheduleSchema.pick({
|
|
|
4458
4577
|
operationId: true,
|
|
4459
4578
|
removePartialOrder: true
|
|
4460
4579
|
});
|
|
4461
|
-
var HealthScheduleReceiptSchema =
|
|
4580
|
+
var HealthScheduleReceiptSchema = import_zod72.z.strictObject({
|
|
4462
4581
|
recordedAt: PostPurchaseTimestampSchema,
|
|
4463
4582
|
taskName: PostPurchaseHealthTaskNameSchema
|
|
4464
4583
|
});
|
|
4465
|
-
var StoredHealthFactSchema = HealthFactSchema.extend({
|
|
4584
|
+
var StoredHealthFactSchema = HealthFactSchema.extend({
|
|
4585
|
+
checkoutToken: HealthScheduleSchema.shape.checkoutToken.optional(),
|
|
4586
|
+
scheduleReceipt: HealthScheduleReceiptSchema.optional()
|
|
4587
|
+
});
|
|
4466
4588
|
var HealthAttemptSchema = StoredHealthFactSchema.extend({
|
|
4467
4589
|
attemptedAt: PostPurchaseTimestampSchema,
|
|
4468
|
-
attemptId:
|
|
4469
|
-
status:
|
|
4590
|
+
attemptId: import_zod72.z.uuid(),
|
|
4591
|
+
status: import_zod72.z.literal("attempted")
|
|
4470
4592
|
});
|
|
4471
4593
|
var HealthResultSchema = HealthAttemptSchema.extend({
|
|
4472
4594
|
finishedAt: PostPurchaseTimestampSchema,
|
|
4473
|
-
status:
|
|
4595
|
+
status: import_zod72.z.enum(["returned", "unknown"])
|
|
4474
4596
|
});
|
|
4475
|
-
var HealthStateSchema =
|
|
4476
|
-
StoredHealthFactSchema.extend({ status:
|
|
4597
|
+
var HealthStateSchema = import_zod72.z.union([
|
|
4598
|
+
StoredHealthFactSchema.extend({ status: import_zod72.z.literal("pending") }),
|
|
4477
4599
|
HealthAttemptSchema,
|
|
4478
4600
|
HealthResultSchema
|
|
4479
4601
|
]);
|
|
4480
4602
|
var HealthPrepareRequestSchema = DecideRequestSchema.extend({
|
|
4481
4603
|
operationId: HealthScheduleSchema.shape.operationId
|
|
4482
4604
|
}).strict();
|
|
4483
|
-
var HealthPrepareResponseSchema =
|
|
4484
|
-
var HealthClaimRequestSchema =
|
|
4605
|
+
var HealthPrepareResponseSchema = import_zod72.z.object({ data: HealthScheduleSchema, successful: import_zod72.z.literal(true) });
|
|
4606
|
+
var HealthClaimRequestSchema = import_zod72.z.strictObject({
|
|
4485
4607
|
orderId: PostPurchaseOrderIdSchema,
|
|
4486
|
-
removePartialOrder:
|
|
4608
|
+
removePartialOrder: import_zod72.z.boolean(),
|
|
4487
4609
|
shop: ShopifyDomainSchema
|
|
4488
4610
|
});
|
|
4489
4611
|
var HealthClaimFactSchema = HealthClaimRequestSchema.extend({
|
|
4490
4612
|
healthScheduledAt: HealthFactSchema.shape.healthScheduledAt
|
|
4491
4613
|
});
|
|
4492
|
-
var HealthClaimResponseSchema =
|
|
4493
|
-
data:
|
|
4494
|
-
|
|
4495
|
-
HealthClaimFactSchema.extend({ status:
|
|
4496
|
-
HealthClaimFactSchema.extend({ attemptId: HealthAttemptSchema.shape.attemptId, status:
|
|
4614
|
+
var HealthClaimResponseSchema = import_zod72.z.object({
|
|
4615
|
+
data: import_zod72.z.union([
|
|
4616
|
+
import_zod72.z.strictObject({ status: import_zod72.z.literal("missing") }),
|
|
4617
|
+
HealthClaimFactSchema.extend({ status: import_zod72.z.enum(["pending", "attempted", "returned", "unknown"]) }),
|
|
4618
|
+
HealthClaimFactSchema.extend({ attemptId: HealthAttemptSchema.shape.attemptId, status: import_zod72.z.literal("claimed") })
|
|
4497
4619
|
]),
|
|
4498
|
-
successful:
|
|
4620
|
+
successful: import_zod72.z.literal(true)
|
|
4499
4621
|
});
|
|
4500
4622
|
var HealthResultRequestSchema = HealthClaimRequestSchema.extend({
|
|
4501
4623
|
attemptId: HealthAttemptSchema.shape.attemptId,
|
|
4502
4624
|
outcome: HealthResultSchema.shape.status
|
|
4503
4625
|
});
|
|
4504
|
-
var HealthResultResponseSchema =
|
|
4626
|
+
var HealthResultResponseSchema = import_zod72.z.object({
|
|
4505
4627
|
data: HealthClaimFactSchema.extend({
|
|
4506
4628
|
finishedAt: HealthResultSchema.shape.finishedAt,
|
|
4507
4629
|
status: HealthResultSchema.shape.status
|
|
4508
4630
|
}),
|
|
4509
|
-
successful:
|
|
4631
|
+
successful: import_zod72.z.literal(true)
|
|
4510
4632
|
});
|
|
4511
4633
|
|
|
4512
4634
|
// src/schema/postPurchaseLifecycle.ts
|
|
4513
|
-
var
|
|
4514
|
-
var Presentation =
|
|
4635
|
+
var import_zod73 = require("zod");
|
|
4636
|
+
var Presentation = import_zod73.z.strictObject({
|
|
4515
4637
|
member: PostPurchaseMemberIdentity,
|
|
4516
4638
|
selectedProductId: PostPurchaseMemberIdentity.shape.productId.optional(),
|
|
4517
4639
|
variant: PostPurchaseVariantSelector
|
|
4518
4640
|
});
|
|
4519
4641
|
var LifecycleObservationRequestSchema = DecideRequestSchema.extend({
|
|
4520
4642
|
entryRevision: PostPurchaseProgressSchema.shape.entryRevision,
|
|
4521
|
-
eventType:
|
|
4643
|
+
eventType: import_zod73.z.enum(["OFFER_VIEWED", "OFFER_TIMER_EXPIRED"]),
|
|
4522
4644
|
presentation: Presentation.nullable(),
|
|
4523
4645
|
progressRevision: PostPurchaseProgressSchema.shape.revision,
|
|
4524
|
-
requestId:
|
|
4646
|
+
requestId: import_zod73.z.uuid()
|
|
4525
4647
|
}).strict().refine(
|
|
4526
4648
|
({ eventType, presentation }) => eventType !== "OFFER_VIEWED" || presentation !== null,
|
|
4527
4649
|
"Viewed observations require a presented product"
|
|
4528
4650
|
);
|
|
4529
|
-
var LifecycleObservationResponseSchema =
|
|
4530
|
-
data:
|
|
4651
|
+
var LifecycleObservationResponseSchema = import_zod73.z.object({
|
|
4652
|
+
data: import_zod73.z.strictObject({
|
|
4531
4653
|
requestId: LifecycleObservationRequestSchema.shape.requestId,
|
|
4532
|
-
status:
|
|
4654
|
+
status: import_zod73.z.union([AcceptedEventOutcomeSchema, import_zod73.z.literal("unavailable")])
|
|
4533
4655
|
}),
|
|
4534
|
-
successful:
|
|
4656
|
+
successful: import_zod73.z.literal(true)
|
|
4535
4657
|
});
|
|
4536
4658
|
|
|
4537
4659
|
// src/schema/postPurchaseOffer.ts
|
|
4538
|
-
var
|
|
4660
|
+
var import_zod75 = require("zod");
|
|
4539
4661
|
|
|
4540
4662
|
// src/schema/postPurchaseSkipTrace.ts
|
|
4541
|
-
var
|
|
4663
|
+
var import_zod74 = require("zod");
|
|
4542
4664
|
var POST_PURCHASE_SKIP_LIMIT = 32;
|
|
4543
|
-
var PostPurchaseSkipTraceSchema =
|
|
4544
|
-
|
|
4665
|
+
var PostPurchaseSkipTraceSchema = import_zod74.z.array(
|
|
4666
|
+
import_zod74.z.object({
|
|
4545
4667
|
entry: DecisionEntrySchema,
|
|
4546
4668
|
reason: PostPurchaseSkipReasonSchema
|
|
4547
4669
|
})
|
|
@@ -4549,66 +4671,66 @@ var PostPurchaseSkipTraceSchema = import_zod70.z.array(
|
|
|
4549
4671
|
|
|
4550
4672
|
// src/schema/postPurchaseOffer.ts
|
|
4551
4673
|
var OfferPreparationRequestSchema = DecideRequestSchema.strict();
|
|
4552
|
-
var OfferPreparationResponseSchema =
|
|
4553
|
-
data:
|
|
4554
|
-
successful:
|
|
4674
|
+
var OfferPreparationResponseSchema = import_zod75.z.object({
|
|
4675
|
+
data: import_zod75.z.object({ attemptedSkips: PostPurchaseSkipTraceSchema.optional(), progress: PostPurchaseProgressSchema }),
|
|
4676
|
+
successful: import_zod75.z.literal(true)
|
|
4555
4677
|
});
|
|
4556
4678
|
|
|
4557
4679
|
// src/schema/postPurchaseOfferEligibility.ts
|
|
4558
|
-
var
|
|
4559
|
-
var
|
|
4560
|
-
var PostPurchaseOfferSkipReason =
|
|
4561
|
-
var PostPurchaseOfferEligibilityContext =
|
|
4680
|
+
var import_zod76 = require("zod");
|
|
4681
|
+
var selection2 = PreparedPostPurchaseProduct.shape.selection;
|
|
4682
|
+
var PostPurchaseOfferSkipReason = import_zod76.z.enum(["empty", "no-eligible-subscription"]);
|
|
4683
|
+
var PostPurchaseOfferEligibilityContext = import_zod76.z.object({
|
|
4562
4684
|
excludedProductIds: PostPurchaseExcludedProductIds,
|
|
4563
|
-
originalLineItems:
|
|
4685
|
+
originalLineItems: import_zod76.z.array(selection2.pick({ productId: true, sellingPlanId: true, variantId: true }))
|
|
4564
4686
|
});
|
|
4565
|
-
var PostPurchaseOfferEligibility =
|
|
4566
|
-
|
|
4567
|
-
members:
|
|
4568
|
-
|
|
4687
|
+
var PostPurchaseOfferEligibility = import_zod76.z.discriminatedUnion("status", [
|
|
4688
|
+
import_zod76.z.object({
|
|
4689
|
+
members: import_zod76.z.array(
|
|
4690
|
+
import_zod76.z.object({ productId: selection2.shape.productId, productIndex: import_zod76.z.number().int().nonnegative() })
|
|
4569
4691
|
),
|
|
4570
|
-
status:
|
|
4692
|
+
status: import_zod76.z.literal("retain")
|
|
4571
4693
|
}),
|
|
4572
|
-
|
|
4573
|
-
|
|
4694
|
+
import_zod76.z.object({ reason: PostPurchaseOfferSkipReason, status: import_zod76.z.literal("skip") }),
|
|
4695
|
+
import_zod76.z.object({ reason: import_zod76.z.literal("eligible-upgrade").optional(), status: import_zod76.z.literal("unavailable") })
|
|
4574
4696
|
]);
|
|
4575
4697
|
|
|
4576
4698
|
// src/schema/postPurchaseOfferPresentation.ts
|
|
4577
|
-
var
|
|
4699
|
+
var import_zod77 = require("zod");
|
|
4578
4700
|
var language2 = PostPurchaseSettings.shape.language.shape.global.unwrap().unwrap();
|
|
4579
|
-
var PostPurchaseOfferPresentation =
|
|
4701
|
+
var PostPurchaseOfferPresentation = import_zod77.z.strictObject({
|
|
4580
4702
|
labels: language2.pick({ declineAll: true, declineThisOffer: true }),
|
|
4581
4703
|
layout: PostPurchaseSettings.shape.offersLayout,
|
|
4582
4704
|
sections: CABRootSection.nullable(),
|
|
4583
4705
|
showDeclineAll: PostPurchaseSettings.shape.productOptions.shape.showDeclineAll
|
|
4584
4706
|
});
|
|
4585
4707
|
var OfferPresentationRequestSchema = DecideRequestSchema.strict();
|
|
4586
|
-
var OfferPresentationResponseSchema =
|
|
4587
|
-
data:
|
|
4708
|
+
var OfferPresentationResponseSchema = import_zod77.z.object({
|
|
4709
|
+
data: import_zod77.z.strictObject({
|
|
4588
4710
|
presentation: PostPurchaseOfferPresentation.nullable(),
|
|
4589
4711
|
progress: PostPurchaseProgressSchema.nullable(),
|
|
4590
4712
|
serverNow: PostPurchaseTimestampSchema
|
|
4591
4713
|
}),
|
|
4592
|
-
successful:
|
|
4714
|
+
successful: import_zod77.z.literal(true)
|
|
4593
4715
|
});
|
|
4594
4716
|
|
|
4595
4717
|
// src/schema/postPurchaseOrderDecision.ts
|
|
4596
|
-
var
|
|
4597
|
-
var OrderDecisionSchema =
|
|
4598
|
-
|
|
4599
|
-
|
|
4718
|
+
var import_zod78 = require("zod");
|
|
4719
|
+
var OrderDecisionSchema = import_zod78.z.discriminatedUnion("owner", [
|
|
4720
|
+
import_zod78.z.object({ owner: import_zod78.z.literal("session"), sessionId: PostPurchaseSessionIdSchema }),
|
|
4721
|
+
import_zod78.z.object({ owner: import_zod78.z.literal("release"), sessionId: import_zod78.z.null() })
|
|
4600
4722
|
]);
|
|
4601
4723
|
|
|
4602
4724
|
// src/schema/postPurchasePolicy.ts
|
|
4603
|
-
var
|
|
4604
|
-
var HoldSettingSchema =
|
|
4605
|
-
|
|
4606
|
-
|
|
4725
|
+
var import_zod79 = require("zod");
|
|
4726
|
+
var HoldSettingSchema = import_zod79.z.discriminatedUnion("enabled", [
|
|
4727
|
+
import_zod79.z.object({ durationMinutes: import_zod79.z.number().int().min(1).max(60), enabled: import_zod79.z.literal(true) }),
|
|
4728
|
+
import_zod79.z.object({ durationMinutes: import_zod79.z.null(), enabled: import_zod79.z.literal(false) })
|
|
4607
4729
|
]);
|
|
4608
|
-
var TimingSettingsSchema =
|
|
4730
|
+
var TimingSettingsSchema = import_zod79.z.object({ flowHold: HoldSettingSchema, shopHold: HoldSettingSchema });
|
|
4609
4731
|
var SessionPolicySchema = TimingSettingsSchema.extend({
|
|
4610
|
-
durationMinutes:
|
|
4611
|
-
source:
|
|
4732
|
+
durationMinutes: import_zod79.z.number().int().min(1).max(60).nullable(),
|
|
4733
|
+
source: import_zod79.z.enum(["shop", "flow", "native"])
|
|
4612
4734
|
}).refine(
|
|
4613
4735
|
(policy) => {
|
|
4614
4736
|
const expectedSource = policy.shopHold.enabled ? "shop" : policy.flowHold.enabled ? "flow" : "native";
|
|
@@ -4622,8 +4744,8 @@ var SessionPolicySchema = TimingSettingsSchema.extend({
|
|
|
4622
4744
|
);
|
|
4623
4745
|
|
|
4624
4746
|
// src/schema/postPurchasePreparationOptions.ts
|
|
4625
|
-
var
|
|
4626
|
-
var PostPurchasePreparationOptions =
|
|
4747
|
+
var import_zod80 = require("zod");
|
|
4748
|
+
var PostPurchasePreparationOptions = import_zod80.z.object({
|
|
4627
4749
|
choice: PostPurchaseChoice.optional(),
|
|
4628
4750
|
member: PostPurchaseMemberSelector.strict().optional(),
|
|
4629
4751
|
quantity: PreparedPostPurchaseProduct.shape.selection.shape.quantity.optional(),
|
|
@@ -4635,8 +4757,8 @@ var PostPurchasePreparationOptions = import_zod76.z.object({
|
|
|
4635
4757
|
);
|
|
4636
4758
|
|
|
4637
4759
|
// src/schema/postPurchaseProductSettings.ts
|
|
4638
|
-
var
|
|
4639
|
-
var amount =
|
|
4760
|
+
var import_zod81 = require("zod");
|
|
4761
|
+
var amount = import_zod81.z.union([import_zod81.z.number().nonnegative(), PostPurchaseAmount.transform(Number)]);
|
|
4640
4762
|
var PostPurchaseProductSettings = PostPurchaseSettings.pick({
|
|
4641
4763
|
discountedFrom: true,
|
|
4642
4764
|
language: true,
|
|
@@ -4648,62 +4770,66 @@ var PostPurchaseProductSettings = PostPurchaseSettings.pick({
|
|
|
4648
4770
|
subscriptionIsDefault: true,
|
|
4649
4771
|
upgradeToSubscription: true
|
|
4650
4772
|
}).extend({
|
|
4651
|
-
advance:
|
|
4652
|
-
blocks:
|
|
4773
|
+
advance: import_zod81.z.unknown().default({}),
|
|
4774
|
+
blocks: import_zod81.z.array(import_zod81.z.unknown()).optional(),
|
|
4653
4775
|
discount: PostPurchaseSettings.shape.discount.extend({ amount: amount.default(30) }),
|
|
4654
|
-
integrations:
|
|
4776
|
+
integrations: import_zod81.z.unknown().default({}),
|
|
4655
4777
|
shipping: PostPurchaseSettings.shape.shipping.extend({ amount: amount.default(10) }),
|
|
4656
|
-
styles:
|
|
4778
|
+
styles: import_zod81.z.unknown().default({}),
|
|
4657
4779
|
subImages: PostPurchaseSettings.shape.subImages.catch(null),
|
|
4658
|
-
subscription:
|
|
4780
|
+
subscription: import_zod81.z.unknown().default(PostPurchaseSettings.shape.subscription.parse(void 0))
|
|
4659
4781
|
});
|
|
4660
4782
|
|
|
4661
4783
|
// src/schema/postPurchaseRecovery.ts
|
|
4662
|
-
var
|
|
4784
|
+
var import_zod82 = require("zod");
|
|
4663
4785
|
var PurchaseRecoveryRequestSchema = DecideRequestSchema.strict();
|
|
4664
|
-
var PurchaseRecoveryResponseSchema =
|
|
4665
|
-
data:
|
|
4666
|
-
operation:
|
|
4786
|
+
var PurchaseRecoveryResponseSchema = import_zod82.z.object({
|
|
4787
|
+
data: import_zod82.z.object({
|
|
4788
|
+
operation: import_zod82.z.object({
|
|
4667
4789
|
observation: RecordedPurchaseObservationSchema.nullable(),
|
|
4668
|
-
operationId: PurchaseReceiptSchema.shape.operationId
|
|
4669
|
-
|
|
4790
|
+
operationId: PurchaseReceiptSchema.shape.operationId,
|
|
4791
|
+
upgrade: UpgradeProgressSchema.optional()
|
|
4792
|
+
}).strict().refine(({ operationId, upgrade }) => !upgrade || upgrade.operationId === operationId, {
|
|
4793
|
+
message: "Upgrade progress belongs to its operation",
|
|
4794
|
+
path: ["upgrade", "operationId"]
|
|
4795
|
+
}).nullable(),
|
|
4670
4796
|
progress: PostPurchaseProgressSchema.nullable().optional()
|
|
4671
4797
|
}),
|
|
4672
|
-
successful:
|
|
4798
|
+
successful: import_zod82.z.literal(true)
|
|
4673
4799
|
});
|
|
4674
4800
|
|
|
4675
4801
|
// src/schema/postPurchaseReleaseClaim.ts
|
|
4676
|
-
var
|
|
4802
|
+
var import_zod83 = require("zod");
|
|
4677
4803
|
var ReleaseClaimRequestSchema = ReleaseAuthorityRequestSchema;
|
|
4678
|
-
var ReleaseClaimResponseSchema =
|
|
4679
|
-
data:
|
|
4680
|
-
|
|
4804
|
+
var ReleaseClaimResponseSchema = import_zod83.z.object({
|
|
4805
|
+
data: import_zod83.z.discriminatedUnion("status", [
|
|
4806
|
+
import_zod83.z.object({ status: import_zod83.z.literal("release-permitted") }),
|
|
4681
4807
|
PendingReleaseAuthoritySchema,
|
|
4682
4808
|
ReadyReleaseAuthoritySchema
|
|
4683
4809
|
]),
|
|
4684
|
-
successful:
|
|
4810
|
+
successful: import_zod83.z.literal(true)
|
|
4685
4811
|
});
|
|
4686
4812
|
|
|
4687
4813
|
// src/schema/postPurchaseSelection.ts
|
|
4688
|
-
var
|
|
4814
|
+
var import_zod84 = require("zod");
|
|
4689
4815
|
var SelectionClaimsSchema = DecideRequestSchema.extend({
|
|
4690
4816
|
appId: PostPurchaseAppIdSchema,
|
|
4691
4817
|
entry: DecisionEntrySchema,
|
|
4692
|
-
iss:
|
|
4693
|
-
purpose:
|
|
4818
|
+
iss: import_zod84.z.literal("rebuy-api"),
|
|
4819
|
+
purpose: import_zod84.z.literal("post-purchase-selection")
|
|
4694
4820
|
});
|
|
4695
4821
|
var SessionStartRequestSchema = DecideRequestSchema.extend({
|
|
4696
|
-
selectionToken:
|
|
4822
|
+
selectionToken: import_zod84.z.string().min(1).max(8192).optional()
|
|
4697
4823
|
}).strict();
|
|
4698
4824
|
|
|
4699
4825
|
// src/schema/postPurchaseSession.ts
|
|
4700
|
-
var
|
|
4826
|
+
var import_zod85 = require("zod");
|
|
4701
4827
|
var SessionIdentitySchema = DecideRequestSchema.extend({ appId: PostPurchaseAppIdSchema });
|
|
4702
|
-
var SessionOrderTimingSchema =
|
|
4828
|
+
var SessionOrderTimingSchema = import_zod85.z.object({
|
|
4703
4829
|
nativeDeadline: PostPurchaseTimestampSchema,
|
|
4704
4830
|
orderCreatedAt: PostPurchaseTimestampSchema,
|
|
4705
4831
|
orderId: PostPurchaseOrderIdSchema,
|
|
4706
|
-
timingSource:
|
|
4832
|
+
timingSource: import_zod85.z.literal("shopify-order-created-at")
|
|
4707
4833
|
});
|
|
4708
4834
|
var ReadySessionTimingSchema = SessionOrderTimingSchema.extend({
|
|
4709
4835
|
deadline: PostPurchaseTimestampSchema,
|
|
@@ -4720,33 +4846,33 @@ var ReadySessionTimingSchema = SessionOrderTimingSchema.extend({
|
|
|
4720
4846
|
message: "deadline must not exceed nativeDeadline",
|
|
4721
4847
|
path: ["deadline"]
|
|
4722
4848
|
});
|
|
4723
|
-
var SessionStartResponseSchema =
|
|
4724
|
-
data:
|
|
4725
|
-
phase:
|
|
4849
|
+
var SessionStartResponseSchema = import_zod85.z.object({
|
|
4850
|
+
data: import_zod85.z.object({
|
|
4851
|
+
phase: import_zod85.z.literal("render"),
|
|
4726
4852
|
serverNow: PostPurchaseTimestampSchema,
|
|
4727
4853
|
session: ReadySessionTimingSchema,
|
|
4728
|
-
workflowPhase:
|
|
4854
|
+
workflowPhase: import_zod85.z.literal("start")
|
|
4729
4855
|
}),
|
|
4730
|
-
successful:
|
|
4856
|
+
successful: import_zod85.z.literal(true)
|
|
4731
4857
|
});
|
|
4732
4858
|
|
|
4733
4859
|
// src/schema/postPurchaseShadow.ts
|
|
4734
|
-
var
|
|
4735
|
-
var PostPurchaseShadowSelectionSchema =
|
|
4736
|
-
|
|
4737
|
-
|
|
4860
|
+
var import_zod86 = require("zod");
|
|
4861
|
+
var PostPurchaseShadowSelectionSchema = import_zod86.z.discriminatedUnion("verdict", [
|
|
4862
|
+
import_zod86.z.object({ entry: DecisionEntrySchema, verdict: import_zod86.z.literal("render") }),
|
|
4863
|
+
import_zod86.z.object({ verdict: import_zod86.z.literal("skip") })
|
|
4738
4864
|
]);
|
|
4739
|
-
var PostPurchaseShadowReportFields =
|
|
4740
|
-
differences:
|
|
4865
|
+
var PostPurchaseShadowReportFields = import_zod86.z.object({
|
|
4866
|
+
differences: import_zod86.z.array(import_zod86.z.enum(["verdict", "entry", "targeting", "incomplete-capture", "unsupported-configuration"])).refine((differences) => new Set(differences).size === differences.length, {
|
|
4741
4867
|
message: "differences must not contain duplicate entries"
|
|
4742
4868
|
}),
|
|
4743
4869
|
legacySelection: PostPurchaseShadowSelectionSchema,
|
|
4744
|
-
phase:
|
|
4745
|
-
sampleId:
|
|
4870
|
+
phase: import_zod86.z.literal("shouldRender"),
|
|
4871
|
+
sampleId: import_zod86.z.string(),
|
|
4746
4872
|
serverSelection: PostPurchaseShadowSelectionSchema.optional(),
|
|
4747
|
-
status:
|
|
4748
|
-
targetingFlowIds:
|
|
4749
|
-
workflowPhase:
|
|
4873
|
+
status: import_zod86.z.enum(["match", "diverged", "incomplete"]),
|
|
4874
|
+
targetingFlowIds: import_zod86.z.array(import_zod86.z.number().int().positive()),
|
|
4875
|
+
workflowPhase: import_zod86.z.literal("decide")
|
|
4750
4876
|
});
|
|
4751
4877
|
var PostPurchaseShadowReportSchema = PostPurchaseShadowReportFields.refine(
|
|
4752
4878
|
(report) => report.status !== "match" || report.differences.length === 0,
|
|
@@ -4759,21 +4885,10 @@ var PostPurchaseShadowReportSchema = PostPurchaseShadowReportFields.refine(
|
|
|
4759
4885
|
path: ["status"]
|
|
4760
4886
|
});
|
|
4761
4887
|
|
|
4762
|
-
// src/schema/postPurchaseSubscriptionDisplay.ts
|
|
4763
|
-
var import_zod83 = require("zod");
|
|
4764
|
-
var Minor2 = import_zod83.z.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER);
|
|
4765
|
-
var PostPurchaseSubscriptionDisplay = import_zod83.z.object({
|
|
4766
|
-
comparisonMinor: Minor2,
|
|
4767
|
-
currencyCode: import_zod83.z.string().regex(/^[A-Z]{3}$/),
|
|
4768
|
-
priceMinor: Minor2,
|
|
4769
|
-
savingMinor: Minor2,
|
|
4770
|
-
savingPercent: import_zod83.z.number().int().min(0).max(100)
|
|
4771
|
-
});
|
|
4772
|
-
|
|
4773
4888
|
// src/schema/postPurchaseSubscriptionProduct.ts
|
|
4774
|
-
var
|
|
4889
|
+
var import_zod87 = require("zod");
|
|
4775
4890
|
var PreparedPostPurchaseSubscription = PreparedPostPurchaseProduct.extend({
|
|
4776
|
-
selection: PreparedPostPurchaseProduct.shape.selection.extend({ sellingPlanId:
|
|
4891
|
+
selection: PreparedPostPurchaseProduct.shape.selection.extend({ sellingPlanId: import_zod87.z.number().int().positive() }),
|
|
4777
4892
|
terms: PreparedPostPurchaseProduct.shape.terms.extend({
|
|
4778
4893
|
subscription: PostPurchaseSubscriptionTerms
|
|
4779
4894
|
}).refine(
|
|
@@ -4786,108 +4901,108 @@ var readPostPurchaseSubscription = (prepared) => {
|
|
|
4786
4901
|
};
|
|
4787
4902
|
|
|
4788
4903
|
// src/schema/postPurchaseTransition.ts
|
|
4789
|
-
var
|
|
4904
|
+
var import_zod88 = require("zod");
|
|
4790
4905
|
var OfferTransitionRequestSchema = DecideRequestSchema.extend({
|
|
4791
4906
|
entryRevision: PostPurchaseProgressSchema.shape.entryRevision,
|
|
4792
4907
|
progressRevision: PostPurchaseProgressSchema.shape.revision
|
|
4793
4908
|
}).strict();
|
|
4794
|
-
var OfferTransitionResponseSchema =
|
|
4795
|
-
data:
|
|
4909
|
+
var OfferTransitionResponseSchema = import_zod88.z.object({
|
|
4910
|
+
data: import_zod88.z.object({
|
|
4796
4911
|
attemptedSkips: PostPurchaseSkipTraceSchema.optional(),
|
|
4797
4912
|
progress: PostPurchaseProgressSchema,
|
|
4798
|
-
status:
|
|
4913
|
+
status: import_zod88.z.enum(["advanced", "no-child", "unavailable"])
|
|
4799
4914
|
}),
|
|
4800
|
-
successful:
|
|
4915
|
+
successful: import_zod88.z.literal(true)
|
|
4801
4916
|
});
|
|
4802
4917
|
|
|
4803
4918
|
// src/schema/postPurchaseVariantDefault.ts
|
|
4804
|
-
var
|
|
4919
|
+
var import_zod89 = require("zod");
|
|
4805
4920
|
var values = PostPurchaseVariantValues.partial().extend({
|
|
4806
4921
|
option1: PostPurchaseVariantValues.shape.option1.nullish()
|
|
4807
4922
|
});
|
|
4808
4923
|
var variant = values.extend({
|
|
4809
4924
|
id: PostPurchaseVariantId,
|
|
4810
|
-
inventoryManagement:
|
|
4811
|
-
inventoryPolicy:
|
|
4812
|
-
inventoryQuantity:
|
|
4925
|
+
inventoryManagement: import_zod89.z.string().nullable(),
|
|
4926
|
+
inventoryPolicy: import_zod89.z.string(),
|
|
4927
|
+
inventoryQuantity: import_zod89.z.number()
|
|
4813
4928
|
});
|
|
4814
|
-
var options =
|
|
4815
|
-
var PostPurchaseVariantDefaultProduct =
|
|
4929
|
+
var options = import_zod89.z.array(PostPurchaseVariantOption.pick({ name: true, values: true }));
|
|
4930
|
+
var PostPurchaseVariantDefaultProduct = import_zod89.z.object({
|
|
4816
4931
|
id: PostPurchaseProductId,
|
|
4817
4932
|
options,
|
|
4818
4933
|
selectedVariant: variant.optional(),
|
|
4819
|
-
variants:
|
|
4934
|
+
variants: import_zod89.z.array(variant)
|
|
4820
4935
|
});
|
|
4821
4936
|
var PostPurchaseVariantDefaultSettings = PostPurchaseSettings.shape.productOptions.pick({
|
|
4822
4937
|
hideOutOfStockVariants: true,
|
|
4823
4938
|
matchVariant: true
|
|
4824
4939
|
});
|
|
4825
|
-
var PostPurchaseOrderAttributes =
|
|
4826
|
-
var PostPurchaseOriginalVariants =
|
|
4827
|
-
|
|
4940
|
+
var PostPurchaseOrderAttributes = import_zod89.z.record(import_zod89.z.string(), import_zod89.z.array(import_zod89.z.string())).default({});
|
|
4941
|
+
var PostPurchaseOriginalVariants = import_zod89.z.array(
|
|
4942
|
+
import_zod89.z.object({ productId: PostPurchaseProductId, variantId: PostPurchaseVariantId })
|
|
4828
4943
|
);
|
|
4829
|
-
var PostPurchaseAttributeProducts =
|
|
4830
|
-
|
|
4944
|
+
var PostPurchaseAttributeProducts = import_zod89.z.array(
|
|
4945
|
+
import_zod89.z.object({ id: PostPurchaseProductId, options, variants: import_zod89.z.array(values.extend({ id: PostPurchaseVariantId })) })
|
|
4831
4946
|
);
|
|
4832
4947
|
|
|
4833
4948
|
// src/schema/postPurchaseVariantDefaultContext.ts
|
|
4834
|
-
var
|
|
4835
|
-
var PostPurchaseVariantDefaultContext =
|
|
4836
|
-
enrichedLineItems:
|
|
4949
|
+
var import_zod90 = require("zod");
|
|
4950
|
+
var PostPurchaseVariantDefaultContext = import_zod90.z.object({
|
|
4951
|
+
enrichedLineItems: import_zod90.z.unknown().optional(),
|
|
4837
4952
|
originalVariants: PostPurchaseOriginalVariants
|
|
4838
4953
|
});
|
|
4839
4954
|
|
|
4840
4955
|
// src/schema/shopConfig.ts
|
|
4841
|
-
var
|
|
4842
|
-
var ShopConfig =
|
|
4843
|
-
activeExperiments:
|
|
4844
|
-
|
|
4845
|
-
data:
|
|
4846
|
-
|
|
4847
|
-
aliasName:
|
|
4848
|
-
cssInput:
|
|
4849
|
-
elementId:
|
|
4850
|
-
id:
|
|
4851
|
-
javascriptInput:
|
|
4852
|
-
traffic:
|
|
4956
|
+
var import_zod91 = require("zod");
|
|
4957
|
+
var ShopConfig = import_zod91.z.object({
|
|
4958
|
+
activeExperiments: import_zod91.z.array(
|
|
4959
|
+
import_zod91.z.object({
|
|
4960
|
+
data: import_zod91.z.array(
|
|
4961
|
+
import_zod91.z.object({
|
|
4962
|
+
aliasName: import_zod91.z.string(),
|
|
4963
|
+
cssInput: import_zod91.z.string().nullish(),
|
|
4964
|
+
elementId: import_zod91.z.coerce.number(),
|
|
4965
|
+
id: import_zod91.z.coerce.number(),
|
|
4966
|
+
javascriptInput: import_zod91.z.string().nullish(),
|
|
4967
|
+
traffic: import_zod91.z.coerce.number()
|
|
4853
4968
|
})
|
|
4854
4969
|
),
|
|
4855
|
-
id:
|
|
4856
|
-
name:
|
|
4857
|
-
pageTarget:
|
|
4858
|
-
pageTargetUrl:
|
|
4859
|
-
placeholderId:
|
|
4860
|
-
type:
|
|
4970
|
+
id: import_zod91.z.coerce.number(),
|
|
4971
|
+
name: import_zod91.z.string(),
|
|
4972
|
+
pageTarget: import_zod91.z.string().nullable(),
|
|
4973
|
+
pageTargetUrl: import_zod91.z.string().nullable(),
|
|
4974
|
+
placeholderId: import_zod91.z.coerce.number().nullable(),
|
|
4975
|
+
type: import_zod91.z.string()
|
|
4861
4976
|
})
|
|
4862
4977
|
),
|
|
4863
|
-
activePackages:
|
|
4864
|
-
|
|
4865
|
-
cancelledAt:
|
|
4866
|
-
id:
|
|
4867
|
-
installedAt:
|
|
4868
|
-
isActive:
|
|
4869
|
-
isBillable:
|
|
4870
|
-
packageId:
|
|
4871
|
-
packageName:
|
|
4872
|
-
shortName:
|
|
4873
|
-
trialDays:
|
|
4874
|
-
uninstalledAt:
|
|
4978
|
+
activePackages: import_zod91.z.array(
|
|
4979
|
+
import_zod91.z.object({
|
|
4980
|
+
cancelledAt: import_zod91.z.string().nullable(),
|
|
4981
|
+
id: import_zod91.z.number(),
|
|
4982
|
+
installedAt: import_zod91.z.string().nullable(),
|
|
4983
|
+
isActive: import_zod91.z.boolean(),
|
|
4984
|
+
isBillable: import_zod91.z.boolean(),
|
|
4985
|
+
packageId: import_zod91.z.number(),
|
|
4986
|
+
packageName: import_zod91.z.string(),
|
|
4987
|
+
shortName: import_zod91.z.string(),
|
|
4988
|
+
trialDays: import_zod91.z.number(),
|
|
4989
|
+
uninstalledAt: import_zod91.z.string().nullable()
|
|
4875
4990
|
})
|
|
4876
4991
|
),
|
|
4877
|
-
apiKey:
|
|
4878
|
-
billingVersion:
|
|
4879
|
-
cacheKey:
|
|
4880
|
-
carousel:
|
|
4881
|
-
currency:
|
|
4882
|
-
currencySymbol:
|
|
4883
|
-
domain:
|
|
4884
|
-
enabledJquery:
|
|
4885
|
-
enabledPresentmentCurrencies:
|
|
4886
|
-
hasSmartCollectionsEnabled:
|
|
4887
|
-
hasSmartSearchEnabled:
|
|
4888
|
-
id:
|
|
4889
|
-
integrations:
|
|
4890
|
-
|
|
4992
|
+
apiKey: import_zod91.z.string(),
|
|
4993
|
+
billingVersion: import_zod91.z.string().nullable(),
|
|
4994
|
+
cacheKey: import_zod91.z.coerce.number(),
|
|
4995
|
+
carousel: import_zod91.z.enum(["flickity", "splide"]),
|
|
4996
|
+
currency: import_zod91.z.string(),
|
|
4997
|
+
currencySymbol: import_zod91.z.string(),
|
|
4998
|
+
domain: import_zod91.z.string(),
|
|
4999
|
+
enabledJquery: import_zod91.z.boolean(),
|
|
5000
|
+
enabledPresentmentCurrencies: import_zod91.z.array(import_zod91.z.string()),
|
|
5001
|
+
hasSmartCollectionsEnabled: import_zod91.z.boolean(),
|
|
5002
|
+
hasSmartSearchEnabled: import_zod91.z.boolean(),
|
|
5003
|
+
id: import_zod91.z.coerce.number(),
|
|
5004
|
+
integrations: import_zod91.z.record(
|
|
5005
|
+
import_zod91.z.enum([
|
|
4891
5006
|
"attentive",
|
|
4892
5007
|
"judgeme",
|
|
4893
5008
|
"junip",
|
|
@@ -4900,170 +5015,170 @@ var ShopConfig = import_zod88.z.object({
|
|
|
4900
5015
|
"stamped",
|
|
4901
5016
|
"yotpo"
|
|
4902
5017
|
]),
|
|
4903
|
-
|
|
5018
|
+
import_zod91.z.union([import_zod91.z.boolean(), import_zod91.z.unknown()])
|
|
4904
5019
|
),
|
|
4905
|
-
markets:
|
|
4906
|
-
enabled:
|
|
5020
|
+
markets: import_zod91.z.object({
|
|
5021
|
+
enabled: import_zod91.z.boolean()
|
|
4907
5022
|
}),
|
|
4908
|
-
monetize:
|
|
4909
|
-
publisherKey:
|
|
5023
|
+
monetize: import_zod91.z.object({
|
|
5024
|
+
publisherKey: import_zod91.z.string().nullable()
|
|
4910
5025
|
}).nullish(),
|
|
4911
|
-
moneyFormat:
|
|
4912
|
-
myshopifyDomain:
|
|
4913
|
-
primaryLocale:
|
|
4914
|
-
productGroupsEnabled:
|
|
4915
|
-
rechargeCustomDomain:
|
|
4916
|
-
sellingPlansEnabled:
|
|
4917
|
-
shopId:
|
|
4918
|
-
shopifySellingPlansEnabled:
|
|
4919
|
-
shopName:
|
|
4920
|
-
storefrontAccessToken:
|
|
4921
|
-
useRebuyIcons:
|
|
5026
|
+
moneyFormat: import_zod91.z.string(),
|
|
5027
|
+
myshopifyDomain: import_zod91.z.string(),
|
|
5028
|
+
primaryLocale: import_zod91.z.string(),
|
|
5029
|
+
productGroupsEnabled: import_zod91.z.enum(["no", "yes"]).transform((value) => value === "yes"),
|
|
5030
|
+
rechargeCustomDomain: import_zod91.z.string().nullable(),
|
|
5031
|
+
sellingPlansEnabled: import_zod91.z.boolean(),
|
|
5032
|
+
shopId: import_zod91.z.number(),
|
|
5033
|
+
shopifySellingPlansEnabled: import_zod91.z.boolean(),
|
|
5034
|
+
shopName: import_zod91.z.string(),
|
|
5035
|
+
storefrontAccessToken: import_zod91.z.string().nullable(),
|
|
5036
|
+
useRebuyIcons: import_zod91.z.boolean()
|
|
4922
5037
|
});
|
|
4923
5038
|
|
|
4924
5039
|
// src/schema/userConfig.ts
|
|
4925
|
-
var
|
|
4926
|
-
var UserConfig =
|
|
5040
|
+
var import_zod92 = require("zod");
|
|
5041
|
+
var UserConfig = import_zod92.z.object({
|
|
4927
5042
|
shop: ShopConfig,
|
|
4928
5043
|
/**
|
|
4929
5044
|
* `.catch(undefined)` is the safety bar: smart-cart shape drift can NEVER fail `fetchUserConfig`,
|
|
4930
5045
|
* which resolves the apiKey for every offers/monetize/analytics/gift request.
|
|
4931
5046
|
*/
|
|
4932
5047
|
smartCart: SmartCartConfig.nullish().catch(void 0),
|
|
4933
|
-
smartFlows:
|
|
5048
|
+
smartFlows: import_zod92.z.array(import_zod92.z.unknown())
|
|
4934
5049
|
});
|
|
4935
5050
|
|
|
4936
5051
|
// src/schema/widgetData.ts
|
|
4937
|
-
var
|
|
5052
|
+
var import_zod101 = require("zod");
|
|
4938
5053
|
|
|
4939
5054
|
// src/schema/widgets/abTestingPlaceholder.ts
|
|
4940
|
-
var
|
|
4941
|
-
var ABTestingPlaceholder =
|
|
4942
|
-
type:
|
|
5055
|
+
var import_zod93 = require("zod");
|
|
5056
|
+
var ABTestingPlaceholder = import_zod93.z.looseObject({
|
|
5057
|
+
type: import_zod93.z.literal("placeholder")
|
|
4943
5058
|
});
|
|
4944
5059
|
|
|
4945
5060
|
// src/schema/widgets/checkoutExtension.ts
|
|
4946
|
-
var
|
|
4947
|
-
var CheckoutExtension =
|
|
4948
|
-
type:
|
|
5061
|
+
var import_zod94 = require("zod");
|
|
5062
|
+
var CheckoutExtension = import_zod94.z.looseObject({
|
|
5063
|
+
type: import_zod94.z.literal(WidgetType.shopify_checkout_extension).default(WidgetType.shopify_checkout_extension)
|
|
4949
5064
|
});
|
|
4950
5065
|
|
|
4951
5066
|
// src/schema/widgets/contentBlock.ts
|
|
4952
|
-
var
|
|
4953
|
-
var ContentBlockV1 =
|
|
4954
|
-
blockSpacing:
|
|
4955
|
-
imageBlocks:
|
|
4956
|
-
|
|
4957
|
-
|
|
4958
|
-
altText:
|
|
4959
|
-
description:
|
|
4960
|
-
id:
|
|
4961
|
-
imagePlacement:
|
|
4962
|
-
imageSize:
|
|
4963
|
-
imageUrl:
|
|
4964
|
-
textAlignment:
|
|
5067
|
+
var import_zod95 = require("zod");
|
|
5068
|
+
var ContentBlockV1 = import_zod95.z.object({
|
|
5069
|
+
blockSpacing: import_zod95.z.enum(spacings).optional(),
|
|
5070
|
+
imageBlocks: import_zod95.z.union([
|
|
5071
|
+
import_zod95.z.array(
|
|
5072
|
+
import_zod95.z.object({
|
|
5073
|
+
altText: import_zod95.z.string().nullable(),
|
|
5074
|
+
description: import_zod95.z.string().nullable(),
|
|
5075
|
+
id: import_zod95.z.uuid(),
|
|
5076
|
+
imagePlacement: import_zod95.z.enum(["top", "right", "bottom", "left"]),
|
|
5077
|
+
imageSize: import_zod95.z.number(),
|
|
5078
|
+
imageUrl: import_zod95.z.url(),
|
|
5079
|
+
textAlignment: import_zod95.z.enum(["left", "center", "right"]),
|
|
4965
5080
|
/** Inline scale only: an image caption can never be a block-level heading. */
|
|
4966
|
-
textSize:
|
|
5081
|
+
textSize: import_zod95.z.enum(inlineTextSizeNames)
|
|
4967
5082
|
})
|
|
4968
5083
|
),
|
|
4969
|
-
|
|
5084
|
+
import_zod95.z.strictObject({}).transform(() => [])
|
|
4970
5085
|
]).optional(),
|
|
4971
|
-
imageLayout:
|
|
4972
|
-
language:
|
|
4973
|
-
description:
|
|
4974
|
-
superTitle:
|
|
4975
|
-
title:
|
|
5086
|
+
imageLayout: import_zod95.z.enum(["row", "column"]).optional(),
|
|
5087
|
+
language: import_zod95.z.object({
|
|
5088
|
+
description: import_zod95.z.string(),
|
|
5089
|
+
superTitle: import_zod95.z.string(),
|
|
5090
|
+
title: import_zod95.z.string()
|
|
4976
5091
|
}),
|
|
4977
|
-
previewMode:
|
|
4978
|
-
type:
|
|
4979
|
-
version:
|
|
5092
|
+
previewMode: import_zod95.z.boolean(),
|
|
5093
|
+
type: import_zod95.z.literal(WidgetType.ui_extension_content_block).default(WidgetType.ui_extension_content_block),
|
|
5094
|
+
version: import_zod95.z.literal(1)
|
|
4980
5095
|
});
|
|
4981
|
-
var ContentBlock =
|
|
5096
|
+
var ContentBlock = import_zod95.z.discriminatedUnion("version", [
|
|
4982
5097
|
ContentBlockV1,
|
|
4983
5098
|
CABRootSection.extend({
|
|
4984
|
-
type:
|
|
5099
|
+
type: import_zod95.z.literal(WidgetType.ui_extension_content_block).default(WidgetType.ui_extension_content_block)
|
|
4985
5100
|
})
|
|
4986
5101
|
]);
|
|
4987
5102
|
|
|
4988
5103
|
// src/schema/widgets/giftWithPurchase.ts
|
|
4989
|
-
var
|
|
4990
|
-
var GiftWithPurchase =
|
|
4991
|
-
type:
|
|
5104
|
+
var import_zod96 = require("zod");
|
|
5105
|
+
var GiftWithPurchase = import_zod96.z.looseObject({
|
|
5106
|
+
type: import_zod96.z.literal(WidgetType.gift_with_purchase).default(WidgetType.gift_with_purchase)
|
|
4992
5107
|
});
|
|
4993
5108
|
|
|
4994
5109
|
// src/schema/widgets/lineItemEditor.ts
|
|
4995
|
-
var
|
|
4996
|
-
var LineItemEditorSwitchLanguageV1 =
|
|
4997
|
-
downgradeToOneTimeLabel:
|
|
5110
|
+
var import_zod97 = require("zod");
|
|
5111
|
+
var LineItemEditorSwitchLanguageV1 = import_zod97.z.object({
|
|
5112
|
+
downgradeToOneTimeLabel: import_zod97.z.string().optional(),
|
|
4998
5113
|
/** Frequency-option template (`{{frequency}}`/`{{interval}}`) for the plan select. */
|
|
4999
|
-
subscriptionOptionLabel:
|
|
5000
|
-
upgradeToSubscriptionLabel:
|
|
5001
|
-
upgradeToSubscriptionWithoutDiscountLabel:
|
|
5114
|
+
subscriptionOptionLabel: import_zod97.z.string().optional(),
|
|
5115
|
+
upgradeToSubscriptionLabel: import_zod97.z.string().optional(),
|
|
5116
|
+
upgradeToSubscriptionWithoutDiscountLabel: import_zod97.z.string().optional()
|
|
5002
5117
|
});
|
|
5003
|
-
var LineItemEditorV1 =
|
|
5118
|
+
var LineItemEditorV1 = import_zod97.z.object({
|
|
5004
5119
|
/** Legacy `getStyles` button style; the converter carries a valid kind, defaulting to `plain`. */
|
|
5005
|
-
button:
|
|
5006
|
-
previewMode:
|
|
5007
|
-
switchToSubscription:
|
|
5008
|
-
disableDowngrade:
|
|
5120
|
+
button: import_zod97.z.object({ kind: import_zod97.z.enum(["plain", "primary", "secondary"]).optional() }).optional(),
|
|
5121
|
+
previewMode: import_zod97.z.boolean().optional(),
|
|
5122
|
+
switchToSubscription: import_zod97.z.object({
|
|
5123
|
+
disableDowngrade: import_zod97.z.boolean().optional(),
|
|
5009
5124
|
language: LineItemEditorSwitchLanguageV1.optional()
|
|
5010
5125
|
}).optional(),
|
|
5011
|
-
switchToSubscriptionEnabled:
|
|
5012
|
-
tracking:
|
|
5013
|
-
enableAttribution:
|
|
5014
|
-
enableSource:
|
|
5015
|
-
enableWidget:
|
|
5126
|
+
switchToSubscriptionEnabled: import_zod97.z.boolean().optional(),
|
|
5127
|
+
tracking: import_zod97.z.object({
|
|
5128
|
+
enableAttribution: import_zod97.z.boolean().optional(),
|
|
5129
|
+
enableSource: import_zod97.z.boolean().optional(),
|
|
5130
|
+
enableWidget: import_zod97.z.boolean().optional()
|
|
5016
5131
|
}).optional(),
|
|
5017
|
-
type:
|
|
5018
|
-
version:
|
|
5132
|
+
type: import_zod97.z.literal(WidgetType.ui_extension_line_item_editor).default(WidgetType.ui_extension_line_item_editor),
|
|
5133
|
+
version: import_zod97.z.literal(1)
|
|
5019
5134
|
});
|
|
5020
|
-
var LineItemEditor =
|
|
5135
|
+
var LineItemEditor = import_zod97.z.discriminatedUnion("version", [
|
|
5021
5136
|
LineItemEditorV1,
|
|
5022
5137
|
CABRootSection.extend({
|
|
5023
|
-
type:
|
|
5138
|
+
type: import_zod97.z.literal(WidgetType.ui_extension_line_item_editor).default(WidgetType.ui_extension_line_item_editor)
|
|
5024
5139
|
})
|
|
5025
5140
|
]);
|
|
5026
5141
|
|
|
5027
5142
|
// src/schema/widgets/progressBar.ts
|
|
5028
|
-
var
|
|
5029
|
-
var ProgressBar =
|
|
5030
|
-
type:
|
|
5143
|
+
var import_zod98 = require("zod");
|
|
5144
|
+
var ProgressBar = import_zod98.z.looseObject({
|
|
5145
|
+
type: import_zod98.z.literal(WidgetType.ui_extension_progress_bar).default(WidgetType.ui_extension_progress_bar)
|
|
5031
5146
|
});
|
|
5032
5147
|
|
|
5033
5148
|
// src/schema/widgets/rebuyButton.ts
|
|
5034
|
-
var
|
|
5035
|
-
var RebuyButtonV1 =
|
|
5036
|
-
type:
|
|
5037
|
-
version:
|
|
5149
|
+
var import_zod99 = require("zod");
|
|
5150
|
+
var RebuyButtonV1 = import_zod99.z.looseObject({
|
|
5151
|
+
type: import_zod99.z.literal(WidgetType.ui_extension_button).default(WidgetType.ui_extension_button),
|
|
5152
|
+
version: import_zod99.z.literal(1)
|
|
5038
5153
|
});
|
|
5039
|
-
var RebuyButton =
|
|
5154
|
+
var RebuyButton = import_zod99.z.discriminatedUnion("version", [
|
|
5040
5155
|
RebuyButtonV1,
|
|
5041
5156
|
CABRootSection.extend({
|
|
5042
|
-
type:
|
|
5157
|
+
type: import_zod99.z.literal(WidgetType.ui_extension_button).default(WidgetType.ui_extension_button)
|
|
5043
5158
|
})
|
|
5044
5159
|
]);
|
|
5045
5160
|
|
|
5046
5161
|
// src/schema/widgets/rebuyMonetize.ts
|
|
5047
|
-
var
|
|
5048
|
-
var RebuyMonetize =
|
|
5049
|
-
type:
|
|
5162
|
+
var import_zod100 = require("zod");
|
|
5163
|
+
var RebuyMonetize = import_zod100.z.looseObject({
|
|
5164
|
+
type: import_zod100.z.literal(WidgetType.ui_extension_ad).default(WidgetType.ui_extension_ad)
|
|
5050
5165
|
});
|
|
5051
|
-
var RebuyMonetizeV1 =
|
|
5052
|
-
name:
|
|
5053
|
-
previewMode:
|
|
5166
|
+
var RebuyMonetizeV1 = import_zod100.z.object({
|
|
5167
|
+
name: import_zod100.z.string().nullable().optional(),
|
|
5168
|
+
previewMode: import_zod100.z.boolean().optional(),
|
|
5054
5169
|
/** Privacy Policy footer href → the marker section's `privacyPolicyUrl`. */
|
|
5055
|
-
privacyPolicyUrl:
|
|
5170
|
+
privacyPolicyUrl: import_zod100.z.string().nullable().optional(),
|
|
5056
5171
|
/** Ads-taxonomy sub-vertical id — one of the admin Monetize editor's two configurables. */
|
|
5057
|
-
subVertical:
|
|
5058
|
-
tracking:
|
|
5059
|
-
enableAttribution:
|
|
5060
|
-
enableSource:
|
|
5061
|
-
enableWidget:
|
|
5172
|
+
subVertical: import_zod100.z.string().nullable().optional(),
|
|
5173
|
+
tracking: import_zod100.z.object({
|
|
5174
|
+
enableAttribution: import_zod100.z.boolean().optional(),
|
|
5175
|
+
enableSource: import_zod100.z.boolean().optional(),
|
|
5176
|
+
enableWidget: import_zod100.z.boolean().optional()
|
|
5062
5177
|
}).optional(),
|
|
5063
|
-
type:
|
|
5064
|
-
version:
|
|
5178
|
+
type: import_zod100.z.literal(WidgetType.ui_extension_ad).default(WidgetType.ui_extension_ad),
|
|
5179
|
+
version: import_zod100.z.literal(1),
|
|
5065
5180
|
/** Ads-taxonomy vertical id — one of the admin Monetize editor's two configurables. */
|
|
5066
|
-
vertical:
|
|
5181
|
+
vertical: import_zod100.z.string().nullable().optional()
|
|
5067
5182
|
});
|
|
5068
5183
|
|
|
5069
5184
|
// src/schema/widgetData.ts
|
|
@@ -5077,7 +5192,7 @@ var extensionWidgetTypes = [
|
|
|
5077
5192
|
WidgetType.ui_extension_line_item_editor,
|
|
5078
5193
|
WidgetType.ui_extension_progress_bar
|
|
5079
5194
|
];
|
|
5080
|
-
var WidgetData =
|
|
5195
|
+
var WidgetData = import_zod101.z.discriminatedUnion("type", [
|
|
5081
5196
|
ABTestingPlaceholder,
|
|
5082
5197
|
CheckoutExtension,
|
|
5083
5198
|
ContentBlock,
|
|
@@ -5437,36 +5552,36 @@ var SWITCH_LABELS = {
|
|
|
5437
5552
|
};
|
|
5438
5553
|
|
|
5439
5554
|
// src/schema/widgets/post-purchase-offer/postPurchaseOffer.ts
|
|
5440
|
-
var
|
|
5555
|
+
var import_zod103 = require("zod");
|
|
5441
5556
|
|
|
5442
5557
|
// src/schema/widgets/post-purchase-offer/postPurchaseWidget.ts
|
|
5443
|
-
var
|
|
5444
|
-
var PostPurchaseWidgetLinkedFlow =
|
|
5445
|
-
id:
|
|
5446
|
-
name:
|
|
5447
|
-
});
|
|
5448
|
-
var PostPurchaseWidget =
|
|
5449
|
-
classification:
|
|
5450
|
-
createdAtTime:
|
|
5451
|
-
customEndpointName:
|
|
5452
|
-
id:
|
|
5453
|
-
lastViewed:
|
|
5454
|
-
linkedCustomEndpointId:
|
|
5455
|
-
linkedFlows:
|
|
5456
|
-
name:
|
|
5457
|
-
owner:
|
|
5558
|
+
var import_zod102 = require("zod");
|
|
5559
|
+
var PostPurchaseWidgetLinkedFlow = import_zod102.z.object({
|
|
5560
|
+
id: import_zod102.z.number(),
|
|
5561
|
+
name: import_zod102.z.string()
|
|
5562
|
+
});
|
|
5563
|
+
var PostPurchaseWidget = import_zod102.z.object({
|
|
5564
|
+
classification: import_zod102.z.literal("post_purchase_offer_page").default("post_purchase_offer_page"),
|
|
5565
|
+
createdAtTime: import_zod102.z.iso.datetime({ offset: true }).optional(),
|
|
5566
|
+
customEndpointName: import_zod102.z.string().nullish(),
|
|
5567
|
+
id: import_zod102.z.number().default(0),
|
|
5568
|
+
lastViewed: import_zod102.z.iso.datetime({ offset: true }).nullish(),
|
|
5569
|
+
linkedCustomEndpointId: import_zod102.z.number().nullish(),
|
|
5570
|
+
linkedFlows: import_zod102.z.array(PostPurchaseWidgetLinkedFlow).optional(),
|
|
5571
|
+
name: import_zod102.z.string().default(""),
|
|
5572
|
+
owner: import_zod102.z.number().nullish(),
|
|
5458
5573
|
settings: PostPurchaseSettings
|
|
5459
5574
|
});
|
|
5460
5575
|
|
|
5461
5576
|
// src/schema/widgets/post-purchase-offer/postPurchaseOffer.ts
|
|
5462
|
-
var PostPurchaseOffer =
|
|
5463
|
-
|
|
5464
|
-
errors:
|
|
5465
|
-
message:
|
|
5466
|
-
successful:
|
|
5577
|
+
var PostPurchaseOffer = import_zod103.z.discriminatedUnion("successful", [
|
|
5578
|
+
import_zod103.z.strictObject({
|
|
5579
|
+
errors: import_zod103.z.array(import_zod103.z.object({ message: import_zod103.z.string() })),
|
|
5580
|
+
message: import_zod103.z.string(),
|
|
5581
|
+
successful: import_zod103.z.literal(false)
|
|
5467
5582
|
}),
|
|
5468
|
-
|
|
5469
|
-
successful:
|
|
5583
|
+
import_zod103.z.strictObject({
|
|
5584
|
+
successful: import_zod103.z.literal(true),
|
|
5470
5585
|
widget: PostPurchaseWidget
|
|
5471
5586
|
})
|
|
5472
5587
|
]);
|
|
@@ -5969,21 +6084,26 @@ var buildOfferTemplate = ({ location: location2, name } = {}) => CABRootSection.
|
|
|
5969
6084
|
type: SHOPIFY_CHECKOUT_EXTENSION
|
|
5970
6085
|
});
|
|
5971
6086
|
|
|
5972
|
-
// src/transforms/
|
|
5973
|
-
var
|
|
5974
|
-
|
|
5975
|
-
|
|
5976
|
-
|
|
5977
|
-
|
|
5978
|
-
var
|
|
5979
|
-
|
|
5980
|
-
|
|
5981
|
-
|
|
5982
|
-
|
|
5983
|
-
|
|
5984
|
-
|
|
5985
|
-
|
|
5986
|
-
|
|
6087
|
+
// src/transforms/productCard/earnedText.ts
|
|
6088
|
+
var contentMutator = (effect, variable, operator) => ({
|
|
6089
|
+
effect,
|
|
6090
|
+
variable,
|
|
6091
|
+
when: { operator, type: "content" }
|
|
6092
|
+
});
|
|
6093
|
+
var earnedFrom = (variable) => [
|
|
6094
|
+
contentMutator("set_false", variable, "is_empty"),
|
|
6095
|
+
contentMutator("set_true", variable, "is_not_empty")
|
|
6096
|
+
];
|
|
6097
|
+
var shownWhile = (variable) => ({ variable, visibleWhen: true });
|
|
6098
|
+
var earnedText = (variable, content) => ({
|
|
6099
|
+
content: { en: content },
|
|
6100
|
+
mutators: earnedFrom(variable),
|
|
6101
|
+
sectionType: "text",
|
|
6102
|
+
visibility: shownWhile(variable)
|
|
6103
|
+
});
|
|
6104
|
+
|
|
6105
|
+
// src/transforms/productCard/priceText.ts
|
|
6106
|
+
var priceContent = () => ({
|
|
5987
6107
|
content: [
|
|
5988
6108
|
{
|
|
5989
6109
|
content: [
|
|
@@ -6009,6 +6129,64 @@ var buildPriceContent = () => ({
|
|
|
6009
6129
|
],
|
|
6010
6130
|
type: "doc"
|
|
6011
6131
|
});
|
|
6132
|
+
var priceText = () => ({
|
|
6133
|
+
content: { en: priceContent() },
|
|
6134
|
+
sectionType: "text"
|
|
6135
|
+
});
|
|
6136
|
+
|
|
6137
|
+
// src/transforms/productCard/quantitySection.ts
|
|
6138
|
+
var quantitySection = ({ errorMessages, inputType, maxValue, minValue, name }) => {
|
|
6139
|
+
const max = Math.min(Math.max(maxValue ?? 10, 1), 100);
|
|
6140
|
+
const min = Math.min(Math.max(minValue ?? 1, 1), max);
|
|
6141
|
+
return {
|
|
6142
|
+
...errorMessages && { errorMessages },
|
|
6143
|
+
...inputType && { inputType },
|
|
6144
|
+
max,
|
|
6145
|
+
min,
|
|
6146
|
+
...name && { name },
|
|
6147
|
+
sectionType: "quantity"
|
|
6148
|
+
};
|
|
6149
|
+
};
|
|
6150
|
+
|
|
6151
|
+
// src/transforms/productCard/subscriptionToggle.ts
|
|
6152
|
+
var SWITCH_LABEL_TOKENS = ["subscriptionDiscount", "frequency", "interval"];
|
|
6153
|
+
var subscriptionToggle = (productType, labels = {}) => {
|
|
6154
|
+
if (productType !== "both" && productType !== "subscription") return [];
|
|
6155
|
+
const slot = (buttonField, override) => ({
|
|
6156
|
+
buttonField,
|
|
6157
|
+
content: localizedContent(SWITCH_LABELS[buttonField], override, SWITCH_LABEL_TOKENS),
|
|
6158
|
+
sectionType: "text"
|
|
6159
|
+
});
|
|
6160
|
+
return [
|
|
6161
|
+
{
|
|
6162
|
+
action: "switchToSubscription",
|
|
6163
|
+
buttonStyle: "plain",
|
|
6164
|
+
/** A `subscription` widget offers no one-time purchase; suppress the downgrade so the buyer can't switch to one-time. */
|
|
6165
|
+
...productType === "subscription" && { disableDowngrade: true },
|
|
6166
|
+
sections: [
|
|
6167
|
+
slot("subscriptionOption", void 0),
|
|
6168
|
+
slot("switchToOneTimePurchase", labels.oneTime),
|
|
6169
|
+
slot("switchToSubscriptionNoDiscount", labels.upgrade),
|
|
6170
|
+
slot("switchToSubscriptionWithDiscount", labels.upgrade)
|
|
6171
|
+
],
|
|
6172
|
+
sectionType: "button"
|
|
6173
|
+
}
|
|
6174
|
+
];
|
|
6175
|
+
};
|
|
6176
|
+
|
|
6177
|
+
// src/transforms/offerV1/offerCard.ts
|
|
6178
|
+
var borderToken = (tokens, value) => value !== void 0 && tokens.includes(value) ? value : "base";
|
|
6179
|
+
var GRID_CARD_IMAGE_PX = 120;
|
|
6180
|
+
var COMPACT_CARD_IMAGE_PX = 64;
|
|
6181
|
+
var ADD_LABEL_TOKENS = ["quantity", "price", "total"];
|
|
6182
|
+
var QUANTITY_ERROR_TOKENS = ["max", "min", "step"];
|
|
6183
|
+
var VARIANT_SELECTOR = { button: "button", radio: "radio", select: "menu" };
|
|
6184
|
+
var buildStyledText = (token, style, fontSize = style?.textSize ?? "base") => {
|
|
6185
|
+
const marks = [{ attrs: { color: "base", fontSize }, type: "textStyle" }];
|
|
6186
|
+
if (style?.textEmphasis === "bold") marks.push({ type: "bold" });
|
|
6187
|
+
if (style?.textEmphasis === "italic") marks.push({ type: "italic" });
|
|
6188
|
+
return { content: [{ content: [{ marks, text: token, type: "text" }], type: "paragraph" }], type: "doc" };
|
|
6189
|
+
};
|
|
6012
6190
|
var buildReviews = (settings) => {
|
|
6013
6191
|
if (!settings.integrations || !Object.values(settings.integrations).some(Boolean)) return [];
|
|
6014
6192
|
const reviews = settings.displaySettings?.reviews;
|
|
@@ -6050,29 +6228,11 @@ var buildTitle = (settings) => ({
|
|
|
6050
6228
|
},
|
|
6051
6229
|
sectionType: "text"
|
|
6052
6230
|
});
|
|
6053
|
-
var buildPrice = () => ({
|
|
6054
|
-
content: { en: buildPriceContent() },
|
|
6055
|
-
sectionType: "text"
|
|
6056
|
-
});
|
|
6057
6231
|
var HAS_VARIANT_TITLE = "hasVariantTitle";
|
|
6058
6232
|
var buildVariantTitle = (settings) => {
|
|
6059
6233
|
const show = settings.productOptions?.showVariantTitle;
|
|
6060
6234
|
if (!show || show === "hide") return [];
|
|
6061
|
-
return [
|
|
6062
|
-
{
|
|
6063
|
-
content: { en: buildStyledText("{{variantTitle}}", settings.displaySettings?.variant) },
|
|
6064
|
-
mutators: [
|
|
6065
|
-
{ effect: "set_false", variable: HAS_VARIANT_TITLE, when: { operator: "is_empty", type: "content" } },
|
|
6066
|
-
{
|
|
6067
|
-
effect: "set_true",
|
|
6068
|
-
variable: HAS_VARIANT_TITLE,
|
|
6069
|
-
when: { operator: "is_not_empty", type: "content" }
|
|
6070
|
-
}
|
|
6071
|
-
],
|
|
6072
|
-
sectionType: "text",
|
|
6073
|
-
visibility: { variable: HAS_VARIANT_TITLE, visibleWhen: true }
|
|
6074
|
-
}
|
|
6075
|
-
];
|
|
6235
|
+
return [earnedText(HAS_VARIANT_TITLE, buildStyledText("{{variantTitle}}", settings.displaySettings?.variant))];
|
|
6076
6236
|
};
|
|
6077
6237
|
var detailBlock = (sections, horizontal, hasVariantTitleLine) => ({
|
|
6078
6238
|
alignment: { horizontal: horizontal ? "start" : "center", vertical: "top" },
|
|
@@ -6101,18 +6261,7 @@ var buildDescription = (settings) => {
|
|
|
6101
6261
|
},
|
|
6102
6262
|
{
|
|
6103
6263
|
content: { en: buildStyledText("{{productDescription}}", void 0) },
|
|
6104
|
-
mutators:
|
|
6105
|
-
{
|
|
6106
|
-
effect: "set_false",
|
|
6107
|
-
variable: HAS_DESCRIPTION,
|
|
6108
|
-
when: { operator: "is_empty", type: "content" }
|
|
6109
|
-
},
|
|
6110
|
-
{
|
|
6111
|
-
effect: "set_true",
|
|
6112
|
-
variable: HAS_DESCRIPTION,
|
|
6113
|
-
when: { operator: "is_not_empty", type: "content" }
|
|
6114
|
-
}
|
|
6115
|
-
],
|
|
6264
|
+
mutators: earnedFrom(HAS_DESCRIPTION),
|
|
6116
6265
|
sectionType: "text",
|
|
6117
6266
|
visibility: { variable: SHOW_DESCRIPTION, visibleWhen: true }
|
|
6118
6267
|
}
|
|
@@ -6128,7 +6277,7 @@ var buildDescription = (settings) => {
|
|
|
6128
6277
|
var SHOW_VARIANTS = "showVariants";
|
|
6129
6278
|
var REVEAL_PENDING = "revealPending";
|
|
6130
6279
|
var revealsVariants = (settings) => settings.viewOptions?.displayActions !== false && settings.productOptions?.showVariantOptions === "default";
|
|
6131
|
-
var
|
|
6280
|
+
var contentMutator2 = (effect, variable, operator) => ({
|
|
6132
6281
|
effect,
|
|
6133
6282
|
variable,
|
|
6134
6283
|
when: { operator, type: "content" }
|
|
@@ -6142,10 +6291,10 @@ var buildVariants = (settings) => {
|
|
|
6142
6291
|
hideOutOfStockVariants: !!settings.productOptions?.hideOutOfStockVariants,
|
|
6143
6292
|
...revealsVariants(settings) && {
|
|
6144
6293
|
mutators: [
|
|
6145
|
-
|
|
6146
|
-
|
|
6147
|
-
|
|
6148
|
-
|
|
6294
|
+
contentMutator2("set_true", SHOW_VARIANTS, "is_empty"),
|
|
6295
|
+
contentMutator2("set_false", REVEAL_PENDING, "is_empty"),
|
|
6296
|
+
contentMutator2("set_true", REVEAL_PENDING, "is_not_empty"),
|
|
6297
|
+
contentMutator2("set_false", SHOW_VARIANTS, "is_not_empty")
|
|
6149
6298
|
]
|
|
6150
6299
|
},
|
|
6151
6300
|
...selector && { selector: VARIANT_SELECTOR[selector] },
|
|
@@ -6170,43 +6319,20 @@ var buildQuantityErrors = (quantity2) => {
|
|
|
6170
6319
|
var buildQuantity = (settings) => {
|
|
6171
6320
|
const quantity2 = settings.quantityInputs;
|
|
6172
6321
|
if (!quantity2?.enabled) return [];
|
|
6173
|
-
const
|
|
6174
|
-
const max = Math.min(Math.max(quantity2.maxValue ?? 10, 1), 100);
|
|
6175
|
-
const min = Math.min(Math.max(quantity2.minValue ?? 1, 1), max);
|
|
6176
|
-
return [
|
|
6177
|
-
{
|
|
6178
|
-
...buildQuantityErrors(quantity2),
|
|
6179
|
-
...inputType && { inputType },
|
|
6180
|
-
max,
|
|
6181
|
-
min,
|
|
6182
|
-
sectionType: "quantity"
|
|
6183
|
-
}
|
|
6184
|
-
];
|
|
6185
|
-
};
|
|
6186
|
-
var buildSubscriptionButton = (settings) => {
|
|
6187
|
-
if (settings.productType !== "both" && settings.productType !== "subscription") return [];
|
|
6188
|
-
const language3 = settings.language;
|
|
6189
|
-
const slot = (buttonField, override) => ({
|
|
6190
|
-
buttonField,
|
|
6191
|
-
content: localizedContent(SWITCH_LABELS[buttonField], override, SWITCH_LABEL_TOKENS),
|
|
6192
|
-
sectionType: "text"
|
|
6193
|
-
});
|
|
6322
|
+
const errors = buildQuantityErrors(quantity2);
|
|
6194
6323
|
return [
|
|
6195
|
-
{
|
|
6196
|
-
|
|
6197
|
-
|
|
6198
|
-
|
|
6199
|
-
|
|
6200
|
-
|
|
6201
|
-
slot("subscriptionOption", void 0),
|
|
6202
|
-
slot("switchToOneTimePurchase", language3?.cartSwitchToOnetime),
|
|
6203
|
-
slot("switchToSubscriptionNoDiscount", language3?.upgradeToSubscription),
|
|
6204
|
-
slot("switchToSubscriptionWithDiscount", language3?.upgradeToSubscription)
|
|
6205
|
-
],
|
|
6206
|
-
sectionType: "button"
|
|
6207
|
-
}
|
|
6324
|
+
quantitySection({
|
|
6325
|
+
...errors,
|
|
6326
|
+
inputType: quantity2.type ? QUANTITY_INPUT_TYPE[quantity2.type] : void 0,
|
|
6327
|
+
maxValue: quantity2.maxValue,
|
|
6328
|
+
minValue: quantity2.minValue
|
|
6329
|
+
})
|
|
6208
6330
|
];
|
|
6209
6331
|
};
|
|
6332
|
+
var buildSubscriptionButton = (settings) => subscriptionToggle(settings.productType, {
|
|
6333
|
+
oneTime: settings.language?.cartSwitchToOnetime,
|
|
6334
|
+
upgrade: settings.language?.upgradeToSubscription
|
|
6335
|
+
});
|
|
6210
6336
|
var BUTTON_KINDS = ["plain", "primary", "secondary"];
|
|
6211
6337
|
var buttonKind = (settings) => {
|
|
6212
6338
|
const kind = settings.button?.kind;
|
|
@@ -6252,7 +6378,7 @@ var buildOfferCard = (settings, horizontal) => {
|
|
|
6252
6378
|
const image = buildImage(settings);
|
|
6253
6379
|
const title = buildTitle(settings);
|
|
6254
6380
|
const variantTitle = buildVariantTitle(settings);
|
|
6255
|
-
const price =
|
|
6381
|
+
const price = priceText();
|
|
6256
6382
|
const description = buildDescription(settings);
|
|
6257
6383
|
const reviews = buildReviews(settings);
|
|
6258
6384
|
const variants = buildVariants(settings);
|
|
@@ -6554,7 +6680,7 @@ var convertOfferToV2 = ({ id, name, settings }) => {
|
|
|
6554
6680
|
|
|
6555
6681
|
// src/pricing/postPurchaseChangeset.ts
|
|
6556
6682
|
var postPurchaseChangeset = (prepared) => {
|
|
6557
|
-
const { selection:
|
|
6683
|
+
const { selection: selection3, terms } = prepared;
|
|
6558
6684
|
const subscription = readPostPurchaseSubscription(prepared);
|
|
6559
6685
|
const { discount, shipping } = terms;
|
|
6560
6686
|
const changesetDiscount = discount.type === "none" ? void 0 : {
|
|
@@ -6569,21 +6695,21 @@ var postPurchaseChangeset = (prepared) => {
|
|
|
6569
6695
|
{
|
|
6570
6696
|
...changesetDiscount ? { discount: changesetDiscount } : {},
|
|
6571
6697
|
initialShippingPrice,
|
|
6572
|
-
quantity:
|
|
6698
|
+
quantity: selection3.quantity,
|
|
6573
6699
|
recurringShippingPrice,
|
|
6574
6700
|
sellingPlanId: subscription.selection.sellingPlanId,
|
|
6575
6701
|
shippingOption,
|
|
6576
6702
|
type: "add_subscription",
|
|
6577
|
-
variantId:
|
|
6703
|
+
variantId: selection3.variantId
|
|
6578
6704
|
}
|
|
6579
6705
|
]
|
|
6580
6706
|
});
|
|
6581
6707
|
}
|
|
6582
6708
|
const changes = [
|
|
6583
6709
|
{
|
|
6584
|
-
quantity:
|
|
6710
|
+
quantity: selection3.quantity,
|
|
6585
6711
|
type: "add_variant",
|
|
6586
|
-
variantId:
|
|
6712
|
+
variantId: selection3.variantId,
|
|
6587
6713
|
...changesetDiscount && changesetDiscount.value > 0 ? { discount: changesetDiscount } : {}
|
|
6588
6714
|
}
|
|
6589
6715
|
];
|
|
@@ -6665,28 +6791,86 @@ var postPurchaseCosts = (prepared, response, currencyCode) => {
|
|
|
6665
6791
|
});
|
|
6666
6792
|
};
|
|
6667
6793
|
|
|
6794
|
+
// src/pricing/postPurchaseReduction.ts
|
|
6795
|
+
var reducePostPurchaseMinor = (priceMinor, { amount: amount2, type }, decimals) => {
|
|
6796
|
+
if (type === "price") return amountToCents2(amount2, decimals);
|
|
6797
|
+
const reduction = type === "percentage" ? Math.round(priceMinor * (amount2 / 100)) : type === "fixed_amount" ? amountToCents2(amount2, decimals) : 0;
|
|
6798
|
+
return Math.max(0, priceMinor - reduction);
|
|
6799
|
+
};
|
|
6800
|
+
|
|
6801
|
+
// src/pricing/postPurchaseDisplayFacts.ts
|
|
6802
|
+
var wholePercent = (savingMinor, struckMinor) => {
|
|
6803
|
+
const percent = savingMinor / struckMinor * 100;
|
|
6804
|
+
return Math.round(percent.toString().length > 5 ? Number(percent.toFixed(2)) : percent);
|
|
6805
|
+
};
|
|
6806
|
+
var postPurchaseDisplayPricing = ({
|
|
6807
|
+
compareAtPrice,
|
|
6808
|
+
currencyCode,
|
|
6809
|
+
discount,
|
|
6810
|
+
discountedFrom,
|
|
6811
|
+
plan,
|
|
6812
|
+
price
|
|
6813
|
+
}) => {
|
|
6814
|
+
const decimals = currencyDecimals(currencyCode);
|
|
6815
|
+
const regularMinor = amountToCents2(price, decimals);
|
|
6816
|
+
const compareAtMinor = amountToCents2(compareAtPrice, decimals);
|
|
6817
|
+
const fromCompareAt = discountedFrom === "compare_at_price" || discount.type === "none" && !plan;
|
|
6818
|
+
const comparisonMinor = fromCompareAt && compareAtMinor > regularMinor ? compareAtMinor : regularMinor;
|
|
6819
|
+
const planMinor = plan ? reducePostPurchaseMinor(regularMinor, plan, decimals) : regularMinor;
|
|
6820
|
+
const priceMinor = reducePostPurchaseMinor(planMinor, discount, decimals);
|
|
6821
|
+
const savingMinor = Math.max(0, comparisonMinor - priceMinor);
|
|
6822
|
+
return {
|
|
6823
|
+
comparisonMinor,
|
|
6824
|
+
priceMinor,
|
|
6825
|
+
savingMinor,
|
|
6826
|
+
savingPercent: savingMinor && wholePercent(savingMinor, comparisonMinor)
|
|
6827
|
+
};
|
|
6828
|
+
};
|
|
6829
|
+
var postPurchaseDisplayFacts = (input) => {
|
|
6830
|
+
const { comparisonMinor, priceMinor, savingMinor, savingPercent } = postPurchaseDisplayPricing(input);
|
|
6831
|
+
const percentPlan = input.plan?.type === "fixed_amount" || input.plan?.type === "price";
|
|
6832
|
+
return {
|
|
6833
|
+
currencyCode: input.currencyCode,
|
|
6834
|
+
savingFormat: !percentPlan && input.discount.type === "fixed_amount" ? "amount" : "percent",
|
|
6835
|
+
savingMinor,
|
|
6836
|
+
savingPercent,
|
|
6837
|
+
variantCompareAtPriceMinor: savingMinor > 0 ? comparisonMinor : null,
|
|
6838
|
+
variantPriceMinor: priceMinor
|
|
6839
|
+
};
|
|
6840
|
+
};
|
|
6841
|
+
|
|
6668
6842
|
// src/pricing/postPurchaseSubscriptionDisplay.ts
|
|
6669
6843
|
var postPurchaseSubscriptionDisplay = (prepared, currencyCode) => {
|
|
6670
6844
|
const subscription = readPostPurchaseSubscription(prepared);
|
|
6671
6845
|
if (!subscription) return void 0;
|
|
6672
|
-
const
|
|
6673
|
-
const variant2 = subscription.product.variant;
|
|
6674
|
-
const regular = amountToCents2(variant2.price, decimals);
|
|
6675
|
-
const compareAt = amountToCents2(variant2.compareAtPrice, decimals);
|
|
6676
|
-
const comparisonMinor = subscription.display.discountedFrom === "compare_at_price" && compareAt > regular ? compareAt : regular;
|
|
6677
|
-
const adjustment = subscription.terms.subscription.adjustment;
|
|
6678
|
-
const reduce = (price, discount) => {
|
|
6679
|
-
const reduction = discount.type === "percentage" ? Math.round(price * discount.amount / 100) : discount.type === "fixed_amount" ? amountToCents2(discount.amount, decimals) : 0;
|
|
6680
|
-
return Math.max(0, price - reduction);
|
|
6681
|
-
};
|
|
6682
|
-
const planPrice = adjustment?.type === "price" ? amountToCents2(adjustment.amount, decimals) : adjustment ? reduce(regular, { amount: adjustment.amount, type: adjustment.type }) : regular;
|
|
6683
|
-
const priceMinor = reduce(planPrice, subscription.terms.discount);
|
|
6684
|
-
const savingMinor = Math.max(0, comparisonMinor - priceMinor);
|
|
6846
|
+
const { compareAtPrice, price } = subscription.product.variant;
|
|
6685
6847
|
return PostPurchaseSubscriptionDisplay.parse({
|
|
6686
|
-
|
|
6848
|
+
...postPurchaseDisplayPricing({
|
|
6849
|
+
compareAtPrice,
|
|
6850
|
+
currencyCode,
|
|
6851
|
+
discount: subscription.terms.discount,
|
|
6852
|
+
discountedFrom: subscription.display.discountedFrom,
|
|
6853
|
+
plan: subscription.terms.subscription.adjustment,
|
|
6854
|
+
price
|
|
6855
|
+
}),
|
|
6856
|
+
currencyCode
|
|
6857
|
+
});
|
|
6858
|
+
};
|
|
6859
|
+
|
|
6860
|
+
// src/pricing/postPurchaseDisplayPrice.ts
|
|
6861
|
+
var postPurchaseDisplayPrice = (prepared, currencyCode) => {
|
|
6862
|
+
const subscription = readPostPurchaseSubscription(prepared);
|
|
6863
|
+
const { compareAtPrice, price } = prepared.product.variant;
|
|
6864
|
+
const facts = postPurchaseDisplayFacts({
|
|
6865
|
+
compareAtPrice,
|
|
6687
6866
|
currencyCode,
|
|
6688
|
-
|
|
6689
|
-
|
|
6690
|
-
|
|
6867
|
+
discount: prepared.terms.discount,
|
|
6868
|
+
discountedFrom: prepared.display.discountedFrom,
|
|
6869
|
+
plan: subscription?.terms.subscription.adjustment,
|
|
6870
|
+
price
|
|
6871
|
+
});
|
|
6872
|
+
return PostPurchaseDisplayPrice.parse({
|
|
6873
|
+
...facts,
|
|
6874
|
+
...subscription && { subscriptionUnit: postPurchaseSubscriptionDisplay(subscription, currencyCode) }
|
|
6691
6875
|
});
|
|
6692
6876
|
};
|