@rebuy/rebuy 3.42.0 → 3.43.1
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 +899 -781
- package/dist/index.d.ts +1 -0
- package/dist/index.mjs +899 -781
- 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 +1 -0
- package/dist/schema/postPurchaseDisplayPrice.d.ts +31 -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 +24 -0
- package/dist/schema/postPurchaseProductView.d.ts +26 -1
- package/dist/schema/postPurchaseSubscriptionProduct.d.ts +2 -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 +1665 -1365
- package/dist/server/index.mjs +1659 -1359
- package/dist/server/postPurchasePlanCatalog.d.ts +4 -1
- package/dist/server/postPurchaseReviewData.d.ts +5 -1
- package/dist/server/preparePostPurchaseAdmissionView.d.ts +21 -0
- package/dist/server/preparePostPurchaseCollectionGroup.d.ts +25 -0
- package/dist/server/preparePostPurchaseCollectionView.d.ts +21 -0
- package/dist/server/preparePostPurchaseGroupAdmissionView.d.ts +21 -0
- package/dist/server/preparePostPurchaseGroupDefault.d.ts +21 -0
- package/dist/server/preparePostPurchaseGroupView.d.ts +21 -0
- package/dist/server/preparePostPurchaseMemberView.d.ts +63 -0
- package/dist/server/preparePostPurchaseQuantityAdmissionView.d.ts +21 -0
- package/dist/server/preparePostPurchaseQuantityView.d.ts +21 -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,
|
|
@@ -341,6 +343,7 @@ __export(src_exports, {
|
|
|
341
343
|
VariableType: () => VariableType,
|
|
342
344
|
VariantMode: () => VariantMode,
|
|
343
345
|
VariantSelector: () => VariantSelector,
|
|
346
|
+
VariantsMode: () => VariantsMode,
|
|
344
347
|
VerticalAlignment: () => VerticalAlignment,
|
|
345
348
|
WidgetData: () => WidgetData,
|
|
346
349
|
WidgetType: () => WidgetType,
|
|
@@ -419,6 +422,7 @@ __export(src_exports, {
|
|
|
419
422
|
popoverPositions: () => popoverPositions,
|
|
420
423
|
postPurchaseChangeset: () => postPurchaseChangeset,
|
|
421
424
|
postPurchaseCosts: () => postPurchaseCosts,
|
|
425
|
+
postPurchaseDisplayPrice: () => postPurchaseDisplayPrice,
|
|
422
426
|
postPurchaseHealthTaskId: () => postPurchaseHealthTaskId,
|
|
423
427
|
postPurchaseSubscriptionDisplay: () => postPurchaseSubscriptionDisplay,
|
|
424
428
|
postPurchaseTaskNameSchema: () => postPurchaseTaskNameSchema,
|
|
@@ -457,6 +461,7 @@ __export(src_exports, {
|
|
|
457
461
|
variantModes: () => variantModes,
|
|
458
462
|
variantPriceObject: () => variantPriceObject,
|
|
459
463
|
variantSelectors: () => variantSelectors,
|
|
464
|
+
variantsModes: () => variantsModes,
|
|
460
465
|
verticalAlignments: () => verticalAlignments,
|
|
461
466
|
widgetTypes: () => widgetTypes
|
|
462
467
|
});
|
|
@@ -1994,6 +1999,8 @@ var variableTypes = ["boolean", "number", "text"];
|
|
|
1994
1999
|
var VariableType = freezeEnum(variableTypes);
|
|
1995
2000
|
var variantModes = ["multiple", "single"];
|
|
1996
2001
|
var VariantMode = freezeEnum(variantModes);
|
|
2002
|
+
var variantsModes = [...variantModes, "productGroup"];
|
|
2003
|
+
var VariantsMode = freezeEnum(variantsModes);
|
|
1997
2004
|
var variantSelectors = ["menu", "radio", "button"];
|
|
1998
2005
|
var VariantSelector = freezeEnum(variantSelectors);
|
|
1999
2006
|
var verticalAlignments = ["top", "middle", "bottom"];
|
|
@@ -2789,6 +2796,7 @@ var PreparedPostPurchaseProduct = import_zod22.z.object({
|
|
|
2789
2796
|
labels: import_zod22.z.object({
|
|
2790
2797
|
declineAll: global.declineAll,
|
|
2791
2798
|
free: import_zod22.z.string(),
|
|
2799
|
+
notAvailable: global.notAvailable,
|
|
2792
2800
|
payNow: import_zod22.z.string(),
|
|
2793
2801
|
quantity: import_zod22.z.string(),
|
|
2794
2802
|
recurringShipping: global.recurringShipping,
|
|
@@ -2992,6 +3000,8 @@ var import_zod29 = require("zod");
|
|
|
2992
3000
|
var import_zod28 = require("zod");
|
|
2993
3001
|
var PostPurchasePlanOption = import_zod28.z.object({
|
|
2994
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(),
|
|
2995
3005
|
id: import_zod28.z.number().int().positive(),
|
|
2996
3006
|
intervalFrequency: import_zod28.z.string().regex(/^[1-9]\d*$/).optional(),
|
|
2997
3007
|
intervalLabel: import_zod28.z.string().min(1),
|
|
@@ -3111,85 +3121,120 @@ var OfferDeclineResponseSchema = import_zod34.z.object({
|
|
|
3111
3121
|
successful: import_zod34.z.literal(true)
|
|
3112
3122
|
});
|
|
3113
3123
|
|
|
3114
|
-
// src/schema/
|
|
3124
|
+
// src/schema/postPurchaseDisplayPrice.ts
|
|
3125
|
+
var import_zod36 = require("zod");
|
|
3126
|
+
|
|
3127
|
+
// src/schema/postPurchaseSubscriptionDisplay.ts
|
|
3115
3128
|
var import_zod35 = require("zod");
|
|
3116
|
-
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"]);
|
|
3117
3162
|
|
|
3118
3163
|
// src/schema/postPurchaseExitPolicy.ts
|
|
3119
|
-
var
|
|
3164
|
+
var import_zod38 = require("zod");
|
|
3120
3165
|
var EXIT_DELAY_MAX_MS = 60 * 60 * 1e3;
|
|
3121
|
-
var ExitPolicySchema =
|
|
3122
|
-
|
|
3123
|
-
|
|
3124
|
-
delayMs:
|
|
3125
|
-
source:
|
|
3126
|
-
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")
|
|
3127
3172
|
})
|
|
3128
3173
|
]);
|
|
3129
3174
|
|
|
3130
3175
|
// src/schema/postPurchaseFinish.ts
|
|
3131
|
-
var
|
|
3176
|
+
var import_zod45 = require("zod");
|
|
3132
3177
|
|
|
3133
3178
|
// src/schema/postPurchaseFollowups.ts
|
|
3134
|
-
var
|
|
3179
|
+
var import_zod43 = require("zod");
|
|
3135
3180
|
|
|
3136
3181
|
// src/schema/postPurchaseHealthProgress.ts
|
|
3137
|
-
var
|
|
3182
|
+
var import_zod40 = require("zod");
|
|
3138
3183
|
|
|
3139
3184
|
// src/schema/postPurchaseReleaseAuthority.ts
|
|
3140
|
-
var
|
|
3141
|
-
var PostPurchaseSessionIdSchema =
|
|
3142
|
-
var ReleaseOwnerSchema =
|
|
3143
|
-
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({
|
|
3144
3189
|
orderId: PostPurchaseOrderIdSchema,
|
|
3145
3190
|
shop: ShopifyDomainSchema
|
|
3146
3191
|
});
|
|
3147
|
-
var ReadyReleaseAuthoritySchema =
|
|
3192
|
+
var ReadyReleaseAuthoritySchema = import_zod39.z.object({
|
|
3148
3193
|
deadline: PostPurchaseTimestampSchema,
|
|
3149
3194
|
releaseOwner: ReleaseOwnerSchema,
|
|
3150
3195
|
sessionId: PostPurchaseSessionIdSchema,
|
|
3151
|
-
status:
|
|
3196
|
+
status: import_zod39.z.literal("ready")
|
|
3152
3197
|
});
|
|
3153
|
-
var PendingReleaseAuthoritySchema =
|
|
3154
|
-
var ReleaseAuthorityResponseSchema =
|
|
3155
|
-
data:
|
|
3156
|
-
|
|
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") }),
|
|
3157
3202
|
PendingReleaseAuthoritySchema,
|
|
3158
3203
|
ReadyReleaseAuthoritySchema
|
|
3159
3204
|
]),
|
|
3160
|
-
successful:
|
|
3205
|
+
successful: import_zod39.z.literal(true)
|
|
3161
3206
|
});
|
|
3162
3207
|
|
|
3163
3208
|
// src/schema/postPurchaseHealthProgress.ts
|
|
3164
|
-
var HealthScheduleSchema =
|
|
3209
|
+
var HealthScheduleSchema = import_zod40.z.strictObject({
|
|
3165
3210
|
checkoutToken: DecideRequestSchema.shape.checkoutToken,
|
|
3166
3211
|
healthScheduledAt: PostPurchaseTimestampSchema,
|
|
3167
3212
|
operationId: PurchaseReceiptSchema.shape.operationId.regex(/^[a-f0-9-]{36}$/),
|
|
3168
3213
|
orderId: PostPurchaseOrderIdSchema,
|
|
3169
|
-
removePartialOrder:
|
|
3214
|
+
removePartialOrder: import_zod40.z.boolean(),
|
|
3170
3215
|
sessionId: PostPurchaseSessionIdSchema,
|
|
3171
3216
|
shop: DecideRequestSchema.shape.shop
|
|
3172
3217
|
});
|
|
3173
|
-
var HealthSchedulingResponseSchema =
|
|
3174
|
-
data:
|
|
3175
|
-
callbackStatus:
|
|
3218
|
+
var HealthSchedulingResponseSchema = import_zod40.z.object({
|
|
3219
|
+
data: import_zod40.z.object({
|
|
3220
|
+
callbackStatus: import_zod40.z.enum(["pending", "attempted", "returned", "unknown"]),
|
|
3176
3221
|
facts: HealthScheduleSchema,
|
|
3177
|
-
scheduling:
|
|
3178
|
-
|
|
3179
|
-
|
|
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"]) })
|
|
3180
3225
|
])
|
|
3181
3226
|
}),
|
|
3182
|
-
successful:
|
|
3227
|
+
successful: import_zod40.z.literal(true)
|
|
3183
3228
|
});
|
|
3184
3229
|
|
|
3185
3230
|
// src/schema/postPurchaseObservation.ts
|
|
3186
|
-
var
|
|
3187
|
-
var PurchaseObservationSchema =
|
|
3188
|
-
|
|
3189
|
-
changesetApplicationsRemaining:
|
|
3190
|
-
errors:
|
|
3191
|
-
|
|
3192
|
-
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([
|
|
3193
3238
|
"payment_required",
|
|
3194
3239
|
"insufficient_inventory",
|
|
3195
3240
|
"changeset_already_applied",
|
|
@@ -3203,41 +3248,41 @@ var PurchaseObservationSchema = import_zod39.z.union([
|
|
|
3203
3248
|
"subscription_limit_error",
|
|
3204
3249
|
"order_released_error"
|
|
3205
3250
|
]),
|
|
3206
|
-
message:
|
|
3251
|
+
message: import_zod41.z.string()
|
|
3207
3252
|
}).strict()
|
|
3208
3253
|
),
|
|
3209
|
-
status:
|
|
3254
|
+
status: import_zod41.z.enum(["processed", "partially_processed", "unprocessed"])
|
|
3210
3255
|
}).strict(),
|
|
3211
|
-
|
|
3256
|
+
import_zod41.z.object({ reason: import_zod41.z.literal("application-error"), status: import_zod41.z.literal("unknown") }).strict()
|
|
3212
3257
|
]);
|
|
3213
|
-
var RecordedPurchaseObservationSchema =
|
|
3258
|
+
var RecordedPurchaseObservationSchema = import_zod41.z.object({
|
|
3214
3259
|
observation: PurchaseObservationSchema,
|
|
3215
3260
|
recordedAt: PostPurchaseTimestampSchema
|
|
3216
3261
|
}).strict();
|
|
3217
3262
|
var PurchaseObservationRequestSchema = DecideRequestSchema.extend({
|
|
3218
3263
|
observation: PurchaseObservationSchema,
|
|
3219
|
-
operationId:
|
|
3264
|
+
operationId: import_zod41.z.uuid()
|
|
3220
3265
|
}).strict();
|
|
3221
|
-
var PurchaseObservationResponseSchema =
|
|
3222
|
-
data: RecordedPurchaseObservationSchema.extend({ operationId:
|
|
3223
|
-
successful:
|
|
3266
|
+
var PurchaseObservationResponseSchema = import_zod41.z.object({
|
|
3267
|
+
data: RecordedPurchaseObservationSchema.extend({ operationId: import_zod41.z.uuid() }),
|
|
3268
|
+
successful: import_zod41.z.literal(true)
|
|
3224
3269
|
});
|
|
3225
3270
|
|
|
3226
3271
|
// src/schema/postPurchaseUpgrade.ts
|
|
3227
|
-
var
|
|
3228
|
-
var AttemptSchema2 =
|
|
3272
|
+
var import_zod42 = require("zod");
|
|
3273
|
+
var AttemptSchema2 = import_zod42.z.strictObject({ attemptedAt: PostPurchaseTimestampSchema, status: import_zod42.z.literal("attempted") });
|
|
3229
3274
|
var FinishedSchema = AttemptSchema2.extend({ finishedAt: PostPurchaseTimestampSchema });
|
|
3230
|
-
var UpgradeRefundProgressSchema =
|
|
3275
|
+
var UpgradeRefundProgressSchema = import_zod42.z.union([
|
|
3231
3276
|
AttemptSchema2,
|
|
3232
|
-
FinishedSchema.extend({ refundId:
|
|
3233
|
-
FinishedSchema.extend({ status:
|
|
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"]) })
|
|
3234
3279
|
]);
|
|
3235
|
-
var UpgradeCompensationProgressSchema =
|
|
3280
|
+
var UpgradeCompensationProgressSchema = import_zod42.z.union([
|
|
3236
3281
|
AttemptSchema2,
|
|
3237
|
-
FinishedSchema.extend({ status:
|
|
3282
|
+
FinishedSchema.extend({ status: import_zod42.z.enum(["removed", "failed", "unknown"]) })
|
|
3238
3283
|
]);
|
|
3239
|
-
var UpgradeReviewReasonSchema =
|
|
3240
|
-
var UpgradeReviewProgressSchema =
|
|
3284
|
+
var UpgradeReviewReasonSchema = import_zod42.z.enum(["refund-unknown", "compensation-failed", "compensation-unknown"]);
|
|
3285
|
+
var UpgradeReviewProgressSchema = import_zod42.z.strictObject({
|
|
3241
3286
|
markedAt: PostPurchaseTimestampSchema,
|
|
3242
3287
|
marker: AcceptedMetafieldResultSchema.shape.status,
|
|
3243
3288
|
reason: UpgradeReviewReasonSchema
|
|
@@ -3248,7 +3293,7 @@ var reviewReason = (refund, compensation) => {
|
|
|
3248
3293
|
return `compensation-${compensation.status}`;
|
|
3249
3294
|
return null;
|
|
3250
3295
|
};
|
|
3251
|
-
var UpgradeProgressSchema =
|
|
3296
|
+
var UpgradeProgressSchema = import_zod42.z.strictObject({
|
|
3252
3297
|
compensation: UpgradeCompensationProgressSchema.nullable(),
|
|
3253
3298
|
operationId: PurchaseReceiptSchema.shape.operationId,
|
|
3254
3299
|
refund: UpgradeRefundProgressSchema.nullable(),
|
|
@@ -3262,15 +3307,15 @@ var UpgradeProgressSchema = import_zod40.z.strictObject({
|
|
|
3262
3307
|
);
|
|
3263
3308
|
|
|
3264
3309
|
// src/schema/postPurchaseFollowups.ts
|
|
3265
|
-
var RequiredHealthSchema =
|
|
3310
|
+
var RequiredHealthSchema = import_zod43.z.union([
|
|
3266
3311
|
HealthSchedulingResponseSchema.shape.data,
|
|
3267
|
-
|
|
3312
|
+
import_zod43.z.strictObject({ status: import_zod43.z.literal("unavailable") })
|
|
3268
3313
|
]);
|
|
3269
|
-
var AcceptedFollowupsResponseSchema =
|
|
3270
|
-
data:
|
|
3271
|
-
acceptedEvent:
|
|
3314
|
+
var AcceptedFollowupsResponseSchema = import_zod43.z.object({
|
|
3315
|
+
data: import_zod43.z.object({
|
|
3316
|
+
acceptedEvent: import_zod43.z.union([
|
|
3272
3317
|
AcceptedEventResponseSchema.shape.data,
|
|
3273
|
-
|
|
3318
|
+
import_zod43.z.strictObject({ status: import_zod43.z.literal("unavailable") })
|
|
3274
3319
|
]),
|
|
3275
3320
|
acceptedMetafield: AcceptedMetafieldResultSchema,
|
|
3276
3321
|
health: RequiredHealthSchema,
|
|
@@ -3281,48 +3326,48 @@ var AcceptedFollowupsResponseSchema = import_zod41.z.object({
|
|
|
3281
3326
|
message: "Upgrade progress belongs to its operation",
|
|
3282
3327
|
path: ["upgrade", "operationId"]
|
|
3283
3328
|
}),
|
|
3284
|
-
successful:
|
|
3329
|
+
successful: import_zod43.z.literal(true)
|
|
3285
3330
|
});
|
|
3286
3331
|
|
|
3287
3332
|
// src/schema/postPurchaseSessionClose.ts
|
|
3288
|
-
var
|
|
3289
|
-
var SessionClosureSchema =
|
|
3333
|
+
var import_zod44 = require("zod");
|
|
3334
|
+
var SessionClosureSchema = import_zod44.z.object({ closedAt: PostPurchaseTimestampSchema, status: import_zod44.z.literal("closed") });
|
|
3290
3335
|
var SessionCloseRequestSchema = DecideRequestSchema.strict();
|
|
3291
|
-
var SessionCloseResponseSchema =
|
|
3336
|
+
var SessionCloseResponseSchema = import_zod44.z.object({ data: SessionClosureSchema, successful: import_zod44.z.literal(true) });
|
|
3292
3337
|
|
|
3293
3338
|
// src/schema/postPurchaseFinish.ts
|
|
3294
|
-
var FinishedPurchaseSchema =
|
|
3295
|
-
|
|
3296
|
-
|
|
3339
|
+
var FinishedPurchaseSchema = import_zod45.z.union([
|
|
3340
|
+
import_zod45.z.strictObject({ status: import_zod45.z.literal("none") }),
|
|
3341
|
+
import_zod45.z.strictObject({
|
|
3297
3342
|
operationId: PurchaseReceiptSchema.shape.operationId,
|
|
3298
|
-
status:
|
|
3299
|
-
|
|
3343
|
+
status: import_zod45.z.union([
|
|
3344
|
+
import_zod45.z.literal("pending"),
|
|
3300
3345
|
...PurchaseObservationSchema.options.map((option) => option.shape.status)
|
|
3301
3346
|
])
|
|
3302
3347
|
})
|
|
3303
3348
|
]);
|
|
3304
3349
|
var SessionFinishRequestSchema = DecideRequestSchema.strict();
|
|
3305
|
-
var SessionFinishResponseSchema =
|
|
3350
|
+
var SessionFinishResponseSchema = import_zod45.z.object({
|
|
3306
3351
|
data: SessionClosureSchema.extend({
|
|
3307
3352
|
classification: ClassificationProgressSchema,
|
|
3308
3353
|
exitPolicy: ExitPolicySchema,
|
|
3309
3354
|
health: RequiredHealthSchema.nullable(),
|
|
3310
3355
|
purchase: FinishedPurchaseSchema
|
|
3311
3356
|
}),
|
|
3312
|
-
successful:
|
|
3357
|
+
successful: import_zod45.z.literal(true)
|
|
3313
3358
|
});
|
|
3314
3359
|
|
|
3315
3360
|
// src/schema/postPurchaseQuantity.ts
|
|
3316
|
-
var
|
|
3361
|
+
var import_zod69 = require("zod");
|
|
3317
3362
|
|
|
3318
3363
|
// src/schema/postPurchaseProductCollectionView.ts
|
|
3319
|
-
var
|
|
3364
|
+
var import_zod68 = require("zod");
|
|
3320
3365
|
|
|
3321
3366
|
// src/schema/postPurchaseProductView.ts
|
|
3322
|
-
var
|
|
3367
|
+
var import_zod67 = require("zod");
|
|
3323
3368
|
|
|
3324
3369
|
// src/schema/postPurchaseGroupCatalog.ts
|
|
3325
|
-
var
|
|
3370
|
+
var import_zod46 = require("zod");
|
|
3326
3371
|
var productId = PreparedPostPurchaseProduct.shape.selection.shape.productId;
|
|
3327
3372
|
var source = PostPurchaseProductSource.shape.data.element;
|
|
3328
3373
|
var PostPurchaseGroupDescription = source.pick({ description: true, id: true, image: true, images: true, title: true }).extend({
|
|
@@ -3330,17 +3375,17 @@ var PostPurchaseGroupDescription = source.pick({ description: true, id: true, im
|
|
|
3330
3375
|
image: source.shape.image.default(null),
|
|
3331
3376
|
options: PostPurchaseVariantCatalog.shape.options.default([])
|
|
3332
3377
|
});
|
|
3333
|
-
var PostPurchaseGroupCatalog =
|
|
3378
|
+
var PostPurchaseGroupCatalog = import_zod46.z.object({
|
|
3334
3379
|
memberProductId: productId,
|
|
3335
|
-
options:
|
|
3380
|
+
options: import_zod46.z.array(import_zod46.z.object({ productId, title: import_zod46.z.string(), variantCatalog: PostPurchaseVariantCatalog }))
|
|
3336
3381
|
});
|
|
3337
|
-
var PostPurchaseGroupSelection =
|
|
3382
|
+
var PostPurchaseGroupSelection = import_zod46.z.object({
|
|
3338
3383
|
memberProductId: productId,
|
|
3339
3384
|
productId
|
|
3340
3385
|
});
|
|
3341
3386
|
|
|
3342
3387
|
// src/schema/widgets/checkout-and-beyond/root.ts
|
|
3343
|
-
var
|
|
3388
|
+
var import_zod66 = require("zod");
|
|
3344
3389
|
|
|
3345
3390
|
// src/schema/widgets/checkout-and-beyond/constants.ts
|
|
3346
3391
|
var import_es_toolkit3 = require("es-toolkit");
|
|
@@ -3395,18 +3440,18 @@ var targetAreas = {
|
|
|
3395
3440
|
|
|
3396
3441
|
// src/schema/widgets/checkout-and-beyond/layout.ts
|
|
3397
3442
|
var import_uuid15 = require("uuid");
|
|
3398
|
-
var
|
|
3443
|
+
var import_zod65 = require("zod");
|
|
3399
3444
|
|
|
3400
3445
|
// src/schema/widgets/checkout-and-beyond/shared.ts
|
|
3401
|
-
var
|
|
3446
|
+
var import_zod64 = require("zod");
|
|
3402
3447
|
|
|
3403
3448
|
// src/schema/widgets/checkout-and-beyond/banner.ts
|
|
3404
|
-
var
|
|
3405
|
-
var CABBannerSection =
|
|
3449
|
+
var import_zod47 = require("zod");
|
|
3450
|
+
var CABBannerSection = import_zod47.z.lazy(
|
|
3406
3451
|
() => CABLayoutSection.omit({ sectionType: true }).extend({
|
|
3407
|
-
buttonField:
|
|
3408
|
-
color:
|
|
3409
|
-
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),
|
|
3410
3455
|
/**
|
|
3411
3456
|
* The `s-banner` heading — localized content (a buyer can see a merchant-composed banner). Absent OR
|
|
3412
3457
|
* blank ⇒ no heading; the renderer emits no heading slot for `''` rather than an empty one.
|
|
@@ -3422,18 +3467,18 @@ var CABBannerSection = import_zod45.z.lazy(
|
|
|
3422
3467
|
* not a 500. Nothing emits `heading` yet; the first converter that maps merchant banner copy into it
|
|
3423
3468
|
* either strips first or teaches `normalizeTextContent` to strip this field.
|
|
3424
3469
|
*/
|
|
3425
|
-
heading:
|
|
3426
|
-
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)
|
|
3427
3472
|
})
|
|
3428
3473
|
);
|
|
3429
3474
|
|
|
3430
3475
|
// src/schema/widgets/checkout-and-beyond/button.ts
|
|
3431
3476
|
var import_uuid5 = require("uuid");
|
|
3432
|
-
var
|
|
3477
|
+
var import_zod50 = require("zod");
|
|
3433
3478
|
|
|
3434
3479
|
// src/schema/widgets/checkout-and-beyond/image.ts
|
|
3435
3480
|
var import_uuid4 = require("uuid");
|
|
3436
|
-
var
|
|
3481
|
+
var import_zod49 = require("zod");
|
|
3437
3482
|
|
|
3438
3483
|
// src/schema/widgets/checkout-and-beyond/icons.ts
|
|
3439
3484
|
var iconNames = [
|
|
@@ -3519,18 +3564,25 @@ var IconSize = freezeEnum(iconSizes);
|
|
|
3519
3564
|
var iconTones = ["auto", "critical", "custom", "info", "neutral", "success", "warning"];
|
|
3520
3565
|
var IconTone = freezeEnum(iconTones);
|
|
3521
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
|
+
|
|
3522
3574
|
// src/schema/widgets/checkout-and-beyond/image.ts
|
|
3523
|
-
var CABImageSectionFields =
|
|
3575
|
+
var CABImageSectionFields = import_zod49.z.object({
|
|
3524
3576
|
...CABVariableFields,
|
|
3525
|
-
altText:
|
|
3577
|
+
altText: import_zod49.z.string().refine(checkForHTML, NO_HTML).default(""),
|
|
3526
3578
|
/**
|
|
3527
3579
|
* Image width÷height (e.g. `46` for the progress-bar fill); `null` renders at natural size. Any POSITIVE
|
|
3528
3580
|
* ratio — never limited to 1, but never `0`/negative either: a renderer dividing by it would get `Infinity`,
|
|
3529
3581
|
* and CSS `aspect-ratio` drops a negative value and silently reverts to natural size.
|
|
3530
3582
|
*/
|
|
3531
|
-
aspectRatio:
|
|
3532
|
-
border:
|
|
3533
|
-
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(),
|
|
3534
3586
|
/**
|
|
3535
3587
|
* `icon` renders `source` as a single `s-icon` by name (the uber-image path covers icons too), reading
|
|
3536
3588
|
* `iconSize`/`iconTone`. The other values are a harmless informational holdover from the previous
|
|
@@ -3549,29 +3601,30 @@ var CABImageSectionFields = import_zod46.z.object({
|
|
|
3549
3601
|
* behavior degraded gracefully and told us about it. The client-assembled half of the invariant was never
|
|
3550
3602
|
* the risky half.
|
|
3551
3603
|
*/
|
|
3552
|
-
category:
|
|
3604
|
+
category: import_zod49.z.enum(["gallery", "icon", "icons", "payment-methods", "secure-checkout"]).nullable().default(null),
|
|
3553
3605
|
/** `icon`-mode only: the `s-icon` `size`; `null` ⇒ the component default (`base`). Ignored by image treatments. */
|
|
3554
|
-
iconSize:
|
|
3606
|
+
iconSize: import_zod49.z.enum(iconSizes).nullable().default(null),
|
|
3555
3607
|
/** `icon`-mode only: the `s-icon` `tone`; `null` ⇒ the component default (`auto`). Ignored by image treatments. */
|
|
3556
|
-
iconTone:
|
|
3557
|
-
name:
|
|
3558
|
-
naturalHeight:
|
|
3559
|
-
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),
|
|
3560
3612
|
/**
|
|
3561
3613
|
* `contain` (the component default): dimensionless images render in s-image's 1/1 default frame, and
|
|
3562
3614
|
* `cover` would crop non-square art (payment badges lost their edges — 15993); `contain` letterboxes.
|
|
3563
3615
|
*/
|
|
3564
|
-
objectFit:
|
|
3565
|
-
sectionId:
|
|
3566
|
-
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),
|
|
3567
3619
|
/**
|
|
3568
3620
|
* An image URL or dynamic token, an empty default, or — when `category: 'icon'` — an icon NAME. Icon mode
|
|
3569
3621
|
* takes a name or `''` only, NOT a token: no renderer resolves a token to an icon today, so accepting one
|
|
3570
3622
|
* would promise a capability that doesn't exist. Widen the refine's carve-out to `DYNAMIC_TOKEN_REGEX` when a
|
|
3571
3623
|
* server-chosen tier icon actually needs it.
|
|
3572
3624
|
*/
|
|
3573
|
-
source:
|
|
3574
|
-
|
|
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)
|
|
3575
3628
|
});
|
|
3576
3629
|
var iconNameSet = new Set(iconNames);
|
|
3577
3630
|
var isIconName = (source2) => iconNameSet.has(source2);
|
|
@@ -3591,35 +3644,35 @@ var CABImageSection = CABImageSectionFields.superRefine(({ category, source: sou
|
|
|
3591
3644
|
});
|
|
3592
3645
|
|
|
3593
3646
|
// src/schema/widgets/checkout-and-beyond/button.ts
|
|
3594
|
-
var CABButtonContent =
|
|
3595
|
-
() =>
|
|
3647
|
+
var CABButtonContent = import_zod50.z.lazy(
|
|
3648
|
+
() => import_zod50.z.discriminatedUnion("sectionType", [CABImageSection, CABLayoutSection, CABTextSection])
|
|
3596
3649
|
);
|
|
3597
|
-
var CABButtonSection =
|
|
3650
|
+
var CABButtonSection = import_zod50.z.object({
|
|
3598
3651
|
...CABVariableFields,
|
|
3599
|
-
action:
|
|
3600
|
-
buttonStyle:
|
|
3601
|
-
custom:
|
|
3602
|
-
color:
|
|
3603
|
-
height:
|
|
3604
|
-
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)
|
|
3605
3658
|
}).default({
|
|
3606
3659
|
color: "#005bd3",
|
|
3607
3660
|
height: 52,
|
|
3608
3661
|
width: 300
|
|
3609
3662
|
}),
|
|
3610
|
-
disableDowngrade:
|
|
3611
|
-
name:
|
|
3612
|
-
optionId:
|
|
3613
|
-
popover:
|
|
3614
|
-
alignment:
|
|
3615
|
-
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)
|
|
3616
3669
|
}).optional().default(() => ({
|
|
3617
3670
|
alignment: TextAlignment.center,
|
|
3618
3671
|
position: PopoverPosition.blockStart
|
|
3619
3672
|
})),
|
|
3620
|
-
sectionId:
|
|
3621
|
-
sections:
|
|
3622
|
-
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),
|
|
3623
3676
|
/**
|
|
3624
3677
|
* The smart-cart tier this button acts on (`addGift`/`removeGift`): scopes the click to one tier's gift. The
|
|
3625
3678
|
* client resolves the tier's gift (productId) from the progress-bar context by this `tierId` — the button node
|
|
@@ -3634,96 +3687,96 @@ var CABButtonSection = import_zod47.z.object({
|
|
|
3634
3687
|
* lookup finds no tier and the click resolves to nothing. Safe to bound — the field is new, so there are no
|
|
3635
3688
|
* stored payloads to grandfather, and the producer is client code, not a merchant form.
|
|
3636
3689
|
*/
|
|
3637
|
-
tier:
|
|
3690
|
+
tier: import_zod50.z.object({ tierId: import_zod50.z.string().min(1) }).optional(),
|
|
3638
3691
|
/** Fire-and-forget pixel POSTed when the button is clicked (e.g. a Monetize decline). */
|
|
3639
|
-
trackingUrl:
|
|
3692
|
+
trackingUrl: import_zod50.z.string().optional(),
|
|
3640
3693
|
/**
|
|
3641
3694
|
* Secondary effects applied to in-scope variables on click, alongside (never instead of) the primary
|
|
3642
3695
|
* `action` — an `addToOrder` button can also flip a variable. Applied in array order.
|
|
3643
3696
|
*/
|
|
3644
|
-
variableEffects:
|
|
3697
|
+
variableEffects: import_zod50.z.array(CABVariableEffect).optional()
|
|
3645
3698
|
});
|
|
3646
3699
|
|
|
3647
3700
|
// src/schema/widgets/checkout-and-beyond/carousel.ts
|
|
3648
|
-
var
|
|
3701
|
+
var import_zod55 = require("zod");
|
|
3649
3702
|
|
|
3650
3703
|
// src/schema/widgets/checkout-and-beyond/offers.ts
|
|
3651
|
-
var
|
|
3704
|
+
var import_zod54 = require("zod");
|
|
3652
3705
|
|
|
3653
3706
|
// src/schema/widgets/checkout-and-beyond/dataSource.ts
|
|
3654
3707
|
var import_uuid6 = require("uuid");
|
|
3655
|
-
var
|
|
3656
|
-
var CABDiscount =
|
|
3657
|
-
amount:
|
|
3658
|
-
discountedBy:
|
|
3659
|
-
discountedFrom:
|
|
3660
|
-
type:
|
|
3661
|
-
});
|
|
3662
|
-
var CABIntegrations =
|
|
3663
|
-
judgeme:
|
|
3664
|
-
junip:
|
|
3665
|
-
klaviyo:
|
|
3666
|
-
loox:
|
|
3667
|
-
okendo:
|
|
3668
|
-
opinew:
|
|
3669
|
-
reviewsio:
|
|
3670
|
-
stamped:
|
|
3671
|
-
yotpo:
|
|
3672
|
-
});
|
|
3673
|
-
var CABVariantLabels =
|
|
3674
|
-
variantOption:
|
|
3675
|
-
variantOptions:
|
|
3676
|
-
});
|
|
3677
|
-
var CABDataSourceSection =
|
|
3678
|
-
dataSourceId:
|
|
3679
|
-
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),
|
|
3680
3733
|
discount: CABDiscount.optional(),
|
|
3681
3734
|
integrations: CABIntegrations.optional(),
|
|
3682
|
-
limit:
|
|
3683
|
-
matchVariant:
|
|
3684
|
-
matchVariantOutOfStock:
|
|
3685
|
-
name:
|
|
3686
|
-
productType:
|
|
3687
|
-
sectionId:
|
|
3688
|
-
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),
|
|
3689
3742
|
/** Default subscribe-vs-one-time for `productType: both` (legacy `subscription_is_default`). */
|
|
3690
|
-
subscriptionIsDefault:
|
|
3691
|
-
treatAsGwp:
|
|
3743
|
+
subscriptionIsDefault: import_zod51.z.boolean().default(false),
|
|
3744
|
+
treatAsGwp: import_zod51.z.boolean().default(false),
|
|
3692
3745
|
variantLabels: CABVariantLabels.optional().catch(void 0)
|
|
3693
3746
|
});
|
|
3694
3747
|
|
|
3695
3748
|
// src/schema/widgets/checkout-and-beyond/products.ts
|
|
3696
3749
|
var import_uuid8 = require("uuid");
|
|
3697
|
-
var
|
|
3750
|
+
var import_zod53 = require("zod");
|
|
3698
3751
|
|
|
3699
3752
|
// src/schema/widgets/checkout-and-beyond/product.ts
|
|
3700
3753
|
var import_uuid7 = require("uuid");
|
|
3701
|
-
var
|
|
3702
|
-
var CABVariantContent =
|
|
3703
|
-
() =>
|
|
3754
|
+
var import_zod52 = require("zod");
|
|
3755
|
+
var CABVariantContent = import_zod52.z.lazy(
|
|
3756
|
+
() => import_zod52.z.discriminatedUnion("sectionType", [CABButtonSection, CABTextSection])
|
|
3704
3757
|
);
|
|
3705
|
-
var CABProductSection =
|
|
3758
|
+
var CABProductSection = import_zod52.z.object({
|
|
3706
3759
|
...CABVariableFields,
|
|
3707
|
-
name:
|
|
3708
|
-
productId:
|
|
3709
|
-
sectionId:
|
|
3710
|
-
sections:
|
|
3711
|
-
sectionType:
|
|
3712
|
-
selectors:
|
|
3713
|
-
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)
|
|
3714
3767
|
});
|
|
3715
3768
|
|
|
3716
3769
|
// src/schema/widgets/checkout-and-beyond/products.ts
|
|
3717
|
-
var CABProductsSection =
|
|
3770
|
+
var CABProductsSection = import_zod53.z.object({
|
|
3718
3771
|
...CABVariableFields,
|
|
3719
|
-
name:
|
|
3720
|
-
sectionId:
|
|
3721
|
-
sections:
|
|
3722
|
-
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)
|
|
3723
3776
|
});
|
|
3724
3777
|
|
|
3725
3778
|
// src/schema/widgets/checkout-and-beyond/offers.ts
|
|
3726
|
-
var CABOffersSection =
|
|
3779
|
+
var CABOffersSection = import_zod54.z.lazy(
|
|
3727
3780
|
() => CABLayoutSection.omit({ sections: true, sectionType: true }).extend({
|
|
3728
3781
|
/**
|
|
3729
3782
|
* A rule between consecutive cards in the vertical list — legacy checkout-offers' `<Divider />`,
|
|
@@ -3731,8 +3784,8 @@ var CABOffersSection = import_zod51.z.lazy(
|
|
|
3731
3784
|
* run of products). Optional, not defaulted: only the v1 converter sets it (REB-24265); a
|
|
3732
3785
|
* hand-built tree keeps React CAB's dividerless rendering.
|
|
3733
3786
|
*/
|
|
3734
|
-
divider:
|
|
3735
|
-
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(() => [
|
|
3736
3789
|
CABBannerSection.parse({
|
|
3737
3790
|
buttonField: "undoAddToOrder",
|
|
3738
3791
|
color: "success",
|
|
@@ -3746,77 +3799,77 @@ var CABOffersSection = import_zod51.z.lazy(
|
|
|
3746
3799
|
CABDataSourceSection.parse({}),
|
|
3747
3800
|
CABProductsSection.parse({})
|
|
3748
3801
|
]),
|
|
3749
|
-
sectionType:
|
|
3802
|
+
sectionType: import_zod54.z.literal(SectionType.offers).default(SectionType.offers)
|
|
3750
3803
|
})
|
|
3751
3804
|
);
|
|
3752
3805
|
|
|
3753
3806
|
// src/schema/widgets/checkout-and-beyond/carousel.ts
|
|
3754
|
-
var CABCarouselSection =
|
|
3807
|
+
var CABCarouselSection = import_zod55.z.lazy(
|
|
3755
3808
|
() => CABLayoutSection.omit({ sections: true, sectionType: true }).extend({
|
|
3756
|
-
autoAdvanceInterval:
|
|
3757
|
-
itemsAtOnce:
|
|
3809
|
+
autoAdvanceInterval: import_zod55.z.number().default(0),
|
|
3810
|
+
itemsAtOnce: import_zod55.z.number().min(1).default(1),
|
|
3758
3811
|
/** Card arrangement for the offers child (`horizontal` = side-by-side) — NOT the carousel's own `direction`. */
|
|
3759
|
-
offersDirection:
|
|
3760
|
-
sections:
|
|
3761
|
-
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)
|
|
3762
3815
|
})
|
|
3763
3816
|
);
|
|
3764
3817
|
|
|
3765
3818
|
// src/schema/widgets/checkout-and-beyond/cartLine.ts
|
|
3766
|
-
var
|
|
3767
|
-
var CABCartLineSection =
|
|
3819
|
+
var import_zod56 = require("zod");
|
|
3820
|
+
var CABCartLineSection = import_zod56.z.lazy(
|
|
3768
3821
|
() => CABLayoutSection.omit({ sections: true, sectionType: true }).extend({
|
|
3769
|
-
sections:
|
|
3770
|
-
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)
|
|
3771
3824
|
})
|
|
3772
3825
|
);
|
|
3773
3826
|
|
|
3774
3827
|
// src/schema/widgets/checkout-and-beyond/discount.ts
|
|
3775
3828
|
var import_uuid9 = require("uuid");
|
|
3776
|
-
var
|
|
3777
|
-
var CABDiscountSection =
|
|
3829
|
+
var import_zod57 = require("zod");
|
|
3830
|
+
var CABDiscountSection = import_zod57.z.object({
|
|
3778
3831
|
...CABVariableFields,
|
|
3779
|
-
amount:
|
|
3780
|
-
discountedBy:
|
|
3781
|
-
discountedFrom:
|
|
3782
|
-
message:
|
|
3783
|
-
name:
|
|
3784
|
-
quantity:
|
|
3785
|
-
sectionId:
|
|
3786
|
-
sectionType:
|
|
3787
|
-
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")
|
|
3788
3841
|
});
|
|
3789
3842
|
|
|
3790
3843
|
// src/schema/widgets/checkout-and-beyond/monetize.ts
|
|
3791
3844
|
var import_uuid10 = require("uuid");
|
|
3792
|
-
var
|
|
3793
|
-
var CABMonetizeAds =
|
|
3794
|
-
requestId:
|
|
3845
|
+
var import_zod58 = require("zod");
|
|
3846
|
+
var CABMonetizeAds = import_zod58.z.object({
|
|
3847
|
+
requestId: import_zod58.z.string().optional(),
|
|
3795
3848
|
/** Defaulted here, never in the beacon: absence of information is `ads` itself being absent. */
|
|
3796
|
-
testing:
|
|
3849
|
+
testing: import_zod58.z.boolean().default(false)
|
|
3797
3850
|
});
|
|
3798
|
-
var CABMonetizeSection =
|
|
3851
|
+
var CABMonetizeSection = import_zod58.z.object({
|
|
3799
3852
|
...CABVariableFields,
|
|
3800
3853
|
ads: CABMonetizeAds.optional(),
|
|
3801
|
-
name:
|
|
3854
|
+
name: import_zod58.z.string().optional(),
|
|
3802
3855
|
/**
|
|
3803
3856
|
* Server-hydrated offer cards (inline hydration): when `/cab/sections` was asked with a `monetize`
|
|
3804
3857
|
* context block, the composed cards ride the marker itself — `[]` means "hydrated, no fill" (render
|
|
3805
3858
|
* nothing, skip the fetch); ABSENT means "not hydrated" (the client fetches via `/cab/monetize`).
|
|
3806
3859
|
*/
|
|
3807
|
-
offers:
|
|
3860
|
+
offers: import_zod58.z.array(import_zod58.z.lazy(() => CABSection)).optional(),
|
|
3808
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. */
|
|
3809
|
-
privacyPolicyUrl:
|
|
3810
|
-
sectionId:
|
|
3811
|
-
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),
|
|
3812
3865
|
/** Ads-taxonomy sub-vertical id (the widget's `sub_vertical` setting); paired with `vertical`. */
|
|
3813
|
-
subVertical:
|
|
3866
|
+
subVertical: import_zod58.z.string().optional(),
|
|
3814
3867
|
/** Ads-taxonomy vertical id (the widget's `vertical` setting) — with `subVertical`, the admin Monetize editor's two configurables. */
|
|
3815
|
-
vertical:
|
|
3868
|
+
vertical: import_zod58.z.string().optional()
|
|
3816
3869
|
});
|
|
3817
3870
|
|
|
3818
3871
|
// src/schema/widgets/checkout-and-beyond/progressBar.ts
|
|
3819
|
-
var
|
|
3872
|
+
var import_zod59 = require("zod");
|
|
3820
3873
|
|
|
3821
3874
|
// src/schema/widgets/checkout-and-beyond/giftLabels.ts
|
|
3822
3875
|
var GIFT_LABELS = {
|
|
@@ -3935,34 +3988,34 @@ var GIFT_LABELS = {
|
|
|
3935
3988
|
};
|
|
3936
3989
|
|
|
3937
3990
|
// src/schema/widgets/checkout-and-beyond/progressBar.ts
|
|
3938
|
-
var CABProgressTierExclusion =
|
|
3939
|
-
collectionIds:
|
|
3940
|
-
productIds:
|
|
3941
|
-
tags:
|
|
3942
|
-
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)
|
|
3943
3996
|
});
|
|
3944
|
-
var CABProgressTier =
|
|
3997
|
+
var CABProgressTier = import_zod59.z.object({
|
|
3945
3998
|
/**
|
|
3946
3999
|
* Order-discount tiers only (onsite `discount`): the reward the order-discount Function applies at
|
|
3947
4000
|
* cart time, carried so the client can resolve the `{{discountAmount}}` token in this tier's copy.
|
|
3948
4001
|
* `fixedAmount`: shop-currency CENTS (FX-scaled by the client, like {@link CABProgressTier.threshold});
|
|
3949
4002
|
* `percentage`: the whole-percent number rendered raw (`{n}%`). Absent on non-discount tiers.
|
|
3950
4003
|
*/
|
|
3951
|
-
discount:
|
|
4004
|
+
discount: import_zod59.z.object({ amount: import_zod59.z.number().nonnegative(), type: import_zod59.z.enum(["fixedAmount", "percentage"]) }).optional(),
|
|
3952
4005
|
/**
|
|
3953
4006
|
* Per-tier exclusion rules (onsite `exclusions` when `exclusions_enabled`): lines they match don't count
|
|
3954
4007
|
* toward this tier. Empty (the default, and the converter's output for a disabled or ruleless tier) means
|
|
3955
4008
|
* the tier measures the plain bar-level adjusted progress. Consumers read ONLY the list named by the rule's
|
|
3956
4009
|
* `type` — the converter leaves the other two at `[]`, so a populated off-type list never reaches the tree.
|
|
3957
4010
|
*/
|
|
3958
|
-
exclusions:
|
|
4011
|
+
exclusions: import_zod59.z.array(CABProgressTierExclusion).default(() => []),
|
|
3959
4012
|
/**
|
|
3960
4013
|
* Smart-cart product (gift) tiers only (onsite `filter_oos_variants`): when set, the client drops this
|
|
3961
4014
|
* tier entirely once its gift has NO in-stock eligible variant — the milestone, fill slot and gift
|
|
3962
4015
|
* controls all disappear, mirroring onsite removing the tier from `bar.tiers` before it renders. Absent
|
|
3963
4016
|
* on shipping/discount/decorative tiers and left off by default (the tier renders regardless of stock).
|
|
3964
4017
|
*/
|
|
3965
|
-
filterOosVariants:
|
|
4018
|
+
filterOosVariants: import_zod59.z.boolean().default(false),
|
|
3966
4019
|
/**
|
|
3967
4020
|
* Smart-cart product (gift) tiers only: the reward unlocked at this tier. The client enriches
|
|
3968
4021
|
* `productId`/`variantIds` to live variants (availability, price) and adds the chosen one to the cart
|
|
@@ -3970,10 +4023,10 @@ var CABProgressTier = import_zod56.z.object({
|
|
|
3970
4023
|
* tiers and on tiers with no configured product. Cart add/remove is a later stage; carried here so the
|
|
3971
4024
|
* tree is complete.
|
|
3972
4025
|
*/
|
|
3973
|
-
gift:
|
|
3974
|
-
productId:
|
|
3975
|
-
title:
|
|
3976
|
-
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(() => [])
|
|
3977
4030
|
}).optional(),
|
|
3978
4031
|
/**
|
|
3979
4032
|
* The step-row icon's square size in PIXELS (onsite `product_tier_element_size`, an admin px string the
|
|
@@ -3993,7 +4046,7 @@ var CABProgressTier = import_zod56.z.object({
|
|
|
3993
4046
|
* renderer never spells a fallback), which also makes a tree authored before this field render at
|
|
3994
4047
|
* React's size rather than the old hardcoded 20.
|
|
3995
4048
|
*/
|
|
3996
|
-
iconSizePx:
|
|
4049
|
+
iconSizePx: import_zod59.z.number().int().min(1).max(64).default(18),
|
|
3997
4050
|
/**
|
|
3998
4051
|
* The step-row label at this tier's slot (onsite `getTierLabel`): the merchant custom label, else the
|
|
3999
4052
|
* type default — 'Free Shipping' or '{n}% Discount'. A PRODUCT tier gets NO converter label: its name is
|
|
@@ -4003,35 +4056,35 @@ var CABProgressTier = import_zod56.z.object({
|
|
|
4003
4056
|
* turns a blank label into an absent key, and a client-authored blank means the same thing — the renderer
|
|
4004
4057
|
* emits no caption slot rather than an empty one). Plain text — a compact icon+label.
|
|
4005
4058
|
*/
|
|
4006
|
-
label:
|
|
4059
|
+
label: import_zod59.z.record(import_zod59.z.string(), import_zod59.z.string()).optional(),
|
|
4007
4060
|
/**
|
|
4008
4061
|
* Smart-cart product (gift) tiers only (onsite `product_tier_image`): show the gift's product image in
|
|
4009
4062
|
* the step-row slot instead of the generic bag icon. The converter can't supply the image URL (config
|
|
4010
4063
|
* carries only product IDs), so the client resolves it (authoritative Shopify featured image, React
|
|
4011
4064
|
* parity) and falls back to the bag icon when the flag is off or no image resolves. Default false.
|
|
4012
4065
|
*/
|
|
4013
|
-
productTierImage:
|
|
4066
|
+
productTierImage: import_zod59.z.boolean().default(false),
|
|
4014
4067
|
/**
|
|
4015
4068
|
* The tier's goal, measured per `unit`. `currency` (default): SHOP-currency cents — the canonical
|
|
4016
4069
|
* fallback: when the buyer's presentment currency has no entry in `thresholds`, the client
|
|
4017
4070
|
* multiplies this by the live FX rate (converter maps the v1 `unlock_price`, e.g. `75` → `7500`).
|
|
4018
4071
|
* `item`: a raw item count — no cents, no FX, no `thresholds` overrides.
|
|
4019
4072
|
*/
|
|
4020
|
-
threshold:
|
|
4073
|
+
threshold: import_zod59.z.number().int().nonnegative(),
|
|
4021
4074
|
/**
|
|
4022
4075
|
* Per-presentment-currency goal overrides — lowercased ISO currency code → cents (e.g. `{ cad: 9900 }`).
|
|
4023
4076
|
* When the buyer's currency has an entry, the client uses it verbatim INSTEAD of FX-converting
|
|
4024
4077
|
* `threshold`, so merchants show intentional, clean per-market amounts (Shopify Markets) rather than a
|
|
4025
4078
|
* converted base. Defaults to `{}` — no overrides means always fall back to `threshold`.
|
|
4026
4079
|
*/
|
|
4027
|
-
thresholds:
|
|
4080
|
+
thresholds: import_zod59.z.record(import_zod59.z.string(), import_zod59.z.number().int().nonnegative()).default(() => ({})),
|
|
4028
4081
|
/**
|
|
4029
4082
|
* Smart-cart tier identifier, mirrored onto the gift cart line's `_tier` attribute so the client can
|
|
4030
4083
|
* match an in-cart gift back to its tier (add on reach, remove on downgrade/decline). Absent on the
|
|
4031
4084
|
* shipping bar (single unlabeled tier, no gift).
|
|
4032
4085
|
*/
|
|
4033
|
-
tierId:
|
|
4034
|
-
tierType:
|
|
4086
|
+
tierId: import_zod59.z.string().optional(),
|
|
4087
|
+
tierType: import_zod59.z.enum(progressTierTypes).default(ProgressTierType.shipping),
|
|
4035
4088
|
/**
|
|
4036
4089
|
* What this tier's progress is measured in — PER TIER (onsite's `unlock_condition_type` model, NOT
|
|
4037
4090
|
* the React port's bar-level `tiers[0]` shortcut). `currency` compares money cents against the
|
|
@@ -4042,9 +4095,9 @@ var CABProgressTier = import_zod56.z.object({
|
|
|
4042
4095
|
* count carries no injected noun (no English `item`/`items` inflection on localized copy); merchant
|
|
4043
4096
|
* template text supplies grammatically-neutral wording around the token.
|
|
4044
4097
|
*/
|
|
4045
|
-
unit:
|
|
4098
|
+
unit: import_zod59.z.enum(progressTierUnits).default(ProgressTierUnit.currency)
|
|
4046
4099
|
});
|
|
4047
|
-
var CABProgressBarSection =
|
|
4100
|
+
var CABProgressBarSection = import_zod59.z.lazy(
|
|
4048
4101
|
() => CABLayoutSection.omit({ sectionType: true }).extend({
|
|
4049
4102
|
/**
|
|
4050
4103
|
* The onsite bar id (smart-cart TPB bars only). The client mirrors it to the cart's `_barId` attribute
|
|
@@ -4053,35 +4106,35 @@ var CABProgressBarSection = import_zod56.z.lazy(
|
|
|
4053
4106
|
* checkout reaches the extension without it, so the client writes it or the tier gift's 100% discount
|
|
4054
4107
|
* (and any tier order discount) never applies. Absent on the v1 shipping bar (no gift tiers, no id).
|
|
4055
4108
|
*/
|
|
4056
|
-
barId:
|
|
4109
|
+
barId: import_zod59.z.string().optional(),
|
|
4057
4110
|
/** Empty = shown everywhere; otherwise uppercase ISO country codes. */
|
|
4058
|
-
countryCodes:
|
|
4111
|
+
countryCodes: import_zod59.z.array(import_zod59.z.string().transform((code) => code.trim().toUpperCase())).default(() => []),
|
|
4059
4112
|
/**
|
|
4060
4113
|
* Uppercase ISO codes where a higher-precedence geo bar applies, so this (default, non-geo) bar is
|
|
4061
4114
|
* hidden there — replicates React `getbar`'s geo-match-over-default precedence. Empty = never excluded.
|
|
4062
4115
|
*/
|
|
4063
|
-
excludeCountryCodes:
|
|
4116
|
+
excludeCountryCodes: import_zod59.z.array(import_zod59.z.string().transform((code) => code.trim().toUpperCase())).default(() => []),
|
|
4064
4117
|
/**
|
|
4065
4118
|
* Measure progress against the PRE-discount subtotal (onsite `exclude_discount_in_subtotal`, and
|
|
4066
4119
|
* forced on for bars with a discount tier so its own reward can't un-reach the tier). The client
|
|
4067
4120
|
* adds the cart's discount allocations back to the live subtotal.
|
|
4068
4121
|
*/
|
|
4069
|
-
excludeDiscountInSubtotal:
|
|
4122
|
+
excludeDiscountInSubtotal: import_zod59.z.boolean().default(false),
|
|
4070
4123
|
/** Variant ids the client subtracts from the adjusted subtotal (React `bar.excluded_products`). */
|
|
4071
|
-
excludedVariantIds:
|
|
4124
|
+
excludedVariantIds: import_zod59.z.array(import_zod59.z.number().int().positive()).default(() => []),
|
|
4072
4125
|
/**
|
|
4073
4126
|
* When the cart holds a subscription item, treat the bar as reached regardless of subtotal (React
|
|
4074
4127
|
* `free_shipping_on_subscription(s)`). `freeShippingOnAll` is already a zero-threshold tier instead.
|
|
4075
4128
|
*/
|
|
4076
|
-
freeShippingOnSubscription:
|
|
4129
|
+
freeShippingOnSubscription: import_zod59.z.boolean().default(false),
|
|
4077
4130
|
/** Localized heading over the gift controls (onsite `gift_area_title`, default 'FREE GIFTS'). */
|
|
4078
|
-
giftAreaTitle:
|
|
4131
|
+
giftAreaTitle: import_zod59.z.record(import_zod59.z.string(), import_zod59.z.string()).default(() => ({ en: "FREE GIFTS" })),
|
|
4079
4132
|
/** Localized gift-control labels (add/remove/heading); a tier's gift `title` beats `yourGift`. */
|
|
4080
|
-
giftLabels:
|
|
4081
|
-
addGift:
|
|
4082
|
-
remove:
|
|
4083
|
-
selectOptions:
|
|
4084
|
-
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 }))
|
|
4085
4138
|
}).default(() => ({
|
|
4086
4139
|
addGift: { ...GIFT_LABELS.addGift },
|
|
4087
4140
|
remove: { ...GIFT_LABELS.remove },
|
|
@@ -4089,38 +4142,38 @@ var CABProgressBarSection = import_zod56.z.lazy(
|
|
|
4089
4142
|
yourGift: { ...GIFT_LABELS.yourGift }
|
|
4090
4143
|
})),
|
|
4091
4144
|
/** The bar's a11y label; the merchant names it in the editor, else this default (React parity). */
|
|
4092
|
-
name:
|
|
4145
|
+
name: import_zod59.z.string().default("Order progress"),
|
|
4093
4146
|
/**
|
|
4094
4147
|
* Bar fill color. An explicit (widget-authored) value is used verbatim; when absent the server
|
|
4095
4148
|
* fills it with the live shop theme's `buttonBackground` (React `useRebuyTheme` parity). Still
|
|
4096
4149
|
* absent after that ⇒ the theme fetch failed and the client renders its platform-default bar —
|
|
4097
4150
|
* optional, not defaulted, so "merchant chose no color" stays distinguishable from any real value.
|
|
4098
4151
|
*/
|
|
4099
|
-
progressColor:
|
|
4100
|
-
sectionType:
|
|
4152
|
+
progressColor: import_zod59.z.string().optional(),
|
|
4153
|
+
sectionType: import_zod59.z.literal(SectionType.progressBar).default(SectionType.progressBar),
|
|
4101
4154
|
/**
|
|
4102
4155
|
* The bar's milestones in the merchant's CONFIGURED order — the renderer does NOT sort them (022
|
|
4103
4156
|
* O-B2: sorting by resolved threshold reversed configured milestones on out-of-order or mixed-unit
|
|
4104
4157
|
* count-vs-cents bars). Drives the fill (even slot per tier) and, for smart-cart product tiers, the
|
|
4105
4158
|
* gift add/remove. The visual tier display lives in `sections` (composable), NOT here.
|
|
4106
4159
|
*/
|
|
4107
|
-
tiers:
|
|
4160
|
+
tiers: import_zod59.z.union([import_zod59.z.array(CABProgressTier), import_zod59.z.strictObject({}).transform(() => [])]).default(() => [])
|
|
4108
4161
|
})
|
|
4109
4162
|
);
|
|
4110
4163
|
|
|
4111
4164
|
// src/schema/widgets/checkout-and-beyond/quantity.ts
|
|
4112
4165
|
var import_uuid11 = require("uuid");
|
|
4113
|
-
var
|
|
4114
|
-
var CABQuantitySection =
|
|
4166
|
+
var import_zod60 = require("zod");
|
|
4167
|
+
var CABQuantitySection = import_zod60.z.object({
|
|
4115
4168
|
...CABVariableFields,
|
|
4116
|
-
errorMessages:
|
|
4117
|
-
|
|
4118
|
-
|
|
4169
|
+
errorMessages: import_zod60.z.record(
|
|
4170
|
+
import_zod60.z.string(),
|
|
4171
|
+
import_zod60.z.object({
|
|
4119
4172
|
/** `{{step}}` is interpolated at render — the off-increment message React never gave a merchant key. */
|
|
4120
|
-
increment:
|
|
4121
|
-
max:
|
|
4122
|
-
min:
|
|
4123
|
-
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()
|
|
4124
4177
|
})
|
|
4125
4178
|
).default({
|
|
4126
4179
|
en: {
|
|
@@ -4130,18 +4183,18 @@ var CABQuantitySection = import_zod57.z.object({
|
|
|
4130
4183
|
neg: "Quantity cannot be negative"
|
|
4131
4184
|
}
|
|
4132
4185
|
}),
|
|
4133
|
-
inputType:
|
|
4134
|
-
max:
|
|
4135
|
-
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),
|
|
4136
4189
|
/** The a11y label for the quantity control; the merchant names it in the editor, else this default. */
|
|
4137
|
-
name:
|
|
4138
|
-
sectionId:
|
|
4139
|
-
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)
|
|
4140
4193
|
});
|
|
4141
4194
|
|
|
4142
4195
|
// src/schema/widgets/checkout-and-beyond/reviews.ts
|
|
4143
4196
|
var import_uuid12 = require("uuid");
|
|
4144
|
-
var
|
|
4197
|
+
var import_zod61 = require("zod");
|
|
4145
4198
|
|
|
4146
4199
|
// src/schema/widgets/checkout-and-beyond/reviewLabels.ts
|
|
4147
4200
|
var REVIEW_LABELS = {
|
|
@@ -4204,68 +4257,69 @@ var REVIEW_LABELS = {
|
|
|
4204
4257
|
};
|
|
4205
4258
|
|
|
4206
4259
|
// src/schema/widgets/checkout-and-beyond/reviews.ts
|
|
4207
|
-
var CABReviewsSection =
|
|
4260
|
+
var CABReviewsSection = import_zod61.z.object({
|
|
4208
4261
|
...CABVariableFields,
|
|
4209
|
-
color:
|
|
4262
|
+
color: import_zod61.z.string().default("#fadb14"),
|
|
4210
4263
|
/**
|
|
4211
4264
|
* Localized review-count templates (`{{reviewCount}}`), one/other plural forms; the client picks the
|
|
4212
4265
|
* form via `Intl.PluralRules`. Defaults here (schema-first) so every tree localizes without converter
|
|
4213
4266
|
* or merchant work.
|
|
4214
4267
|
*/
|
|
4215
|
-
countLabels:
|
|
4216
|
-
one:
|
|
4217
|
-
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 }))
|
|
4218
4271
|
}).default(() => ({ one: { ...REVIEW_LABELS.one }, other: { ...REVIEW_LABELS.other } })),
|
|
4219
|
-
name:
|
|
4220
|
-
sectionId:
|
|
4221
|
-
sectionType:
|
|
4222
|
-
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),
|
|
4223
4276
|
/**
|
|
4224
4277
|
* Star outline color, interpolated into a style by the renderer, so it is hex-constrained like
|
|
4225
4278
|
* `CABButtonSection.color`. The legacy source (`PostPurchaseSettings.styles.starStrokeColor`) is a free
|
|
4226
4279
|
* string: its converter must validate and fall back to this default rather than let one odd value drop
|
|
4227
4280
|
* the whole reviews section.
|
|
4228
4281
|
*/
|
|
4229
|
-
strokeColor:
|
|
4282
|
+
strokeColor: import_zod61.z.string().regex(HEX_COLOR_REGEX).default("#fadb14"),
|
|
4230
4283
|
/** Star outline width in px; `0` draws no outline. The legacy `styles.strokeWidth` is a STRING ('1') — its converter coerces. */
|
|
4231
|
-
strokeWidth:
|
|
4284
|
+
strokeWidth: import_zod61.z.number().nonnegative().default(0)
|
|
4232
4285
|
});
|
|
4233
4286
|
|
|
4234
4287
|
// src/schema/widgets/checkout-and-beyond/separator.ts
|
|
4235
4288
|
var import_uuid13 = require("uuid");
|
|
4236
|
-
var
|
|
4237
|
-
var CABSeparatorSection =
|
|
4289
|
+
var import_zod62 = require("zod");
|
|
4290
|
+
var CABSeparatorSection = import_zod62.z.object({
|
|
4238
4291
|
...CABVariableFields,
|
|
4239
|
-
sectionId:
|
|
4240
|
-
sectionType:
|
|
4292
|
+
sectionId: import_zod62.z.uuid().default(() => (0, import_uuid13.v7)()),
|
|
4293
|
+
sectionType: import_zod62.z.literal(SectionType.separator).default(SectionType.separator)
|
|
4241
4294
|
});
|
|
4242
4295
|
|
|
4243
4296
|
// src/schema/widgets/checkout-and-beyond/variants.ts
|
|
4244
4297
|
var import_compat5 = require("es-toolkit/compat");
|
|
4245
4298
|
var import_uuid14 = require("uuid");
|
|
4246
|
-
var
|
|
4247
|
-
var CABVariantsSection =
|
|
4299
|
+
var import_zod63 = require("zod");
|
|
4300
|
+
var CABVariantsSection = import_zod63.z.object({
|
|
4248
4301
|
...CABVariableFields,
|
|
4249
|
-
hideOutOfStockVariants:
|
|
4250
|
-
name:
|
|
4251
|
-
sectionId:
|
|
4252
|
-
sectionType:
|
|
4253
|
-
selector:
|
|
4254
|
-
|
|
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)
|
|
4255
4309
|
});
|
|
4256
4310
|
|
|
4257
4311
|
// src/schema/widgets/checkout-and-beyond/shared.ts
|
|
4258
|
-
var CABBorder =
|
|
4259
|
-
radius:
|
|
4260
|
-
style:
|
|
4261
|
-
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)
|
|
4262
4316
|
}).default({
|
|
4263
4317
|
radius: BorderRadius.base,
|
|
4264
4318
|
style: BorderStyle.none,
|
|
4265
4319
|
width: BorderWidth.base
|
|
4266
4320
|
});
|
|
4267
|
-
var CABSection =
|
|
4268
|
-
() =>
|
|
4321
|
+
var CABSection = import_zod64.z.lazy(
|
|
4322
|
+
() => import_zod64.z.discriminatedUnion("sectionType", [
|
|
4269
4323
|
CABBannerSection,
|
|
4270
4324
|
CABButtonSection,
|
|
4271
4325
|
CABCarouselSection,
|
|
@@ -4288,41 +4342,41 @@ var CABSection = import_zod61.z.lazy(
|
|
|
4288
4342
|
);
|
|
4289
4343
|
|
|
4290
4344
|
// src/schema/widgets/checkout-and-beyond/layout.ts
|
|
4291
|
-
var GridItem =
|
|
4292
|
-
var CABLayoutWrapping =
|
|
4293
|
-
breakAt:
|
|
4294
|
-
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()
|
|
4295
4349
|
});
|
|
4296
|
-
var CABLayoutSection =
|
|
4350
|
+
var CABLayoutSection = import_zod65.z.object({
|
|
4297
4351
|
...CABVariableFields,
|
|
4298
|
-
alignment:
|
|
4299
|
-
horizontal:
|
|
4300
|
-
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)
|
|
4301
4355
|
}).default({
|
|
4302
4356
|
horizontal: HorizontalAlignment.start,
|
|
4303
4357
|
vertical: VerticalAlignment.top
|
|
4304
4358
|
}),
|
|
4305
|
-
border:
|
|
4306
|
-
buttonField:
|
|
4307
|
-
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),
|
|
4308
4362
|
/**
|
|
4309
4363
|
* Platform chrome around the section, not a layout behavior: `callout` is a subdued box with block borders
|
|
4310
4364
|
* (the legacy post-purchase callout banner), `offer-content` the post-purchase offer's own content card.
|
|
4311
4365
|
*/
|
|
4312
|
-
frame:
|
|
4313
|
-
grid:
|
|
4314
|
-
columns:
|
|
4315
|
-
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"])
|
|
4316
4370
|
}).default({ columns: ["auto"], rows: ["auto"] }).optional(),
|
|
4317
|
-
name:
|
|
4318
|
-
padding:
|
|
4319
|
-
sectionId:
|
|
4320
|
-
sections:
|
|
4321
|
-
sectionType:
|
|
4322
|
-
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),
|
|
4323
4377
|
/** Fire-and-forget impression pixel POSTed once when the section is shown (e.g. a Monetize offer view). */
|
|
4324
|
-
viewUrl:
|
|
4325
|
-
width:
|
|
4378
|
+
viewUrl: import_zod65.z.string().optional(),
|
|
4379
|
+
width: import_zod65.z.number().default(100),
|
|
4326
4380
|
wrapping: CABLayoutWrapping.optional()
|
|
4327
4381
|
});
|
|
4328
4382
|
|
|
@@ -4344,8 +4398,8 @@ var UI_LABELS = {
|
|
|
4344
4398
|
};
|
|
4345
4399
|
|
|
4346
4400
|
// src/schema/widgets/checkout-and-beyond/root.ts
|
|
4347
|
-
var localized = (fallback) =>
|
|
4348
|
-
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({
|
|
4349
4403
|
currentPage: localized(UI_LABELS.currentPage),
|
|
4350
4404
|
guest: localized(UI_LABELS.guest),
|
|
4351
4405
|
loadingOptions: localized(UI_LABELS.loadingOptions),
|
|
@@ -4370,48 +4424,49 @@ var CABUILabels = import_zod63.z.object({
|
|
|
4370
4424
|
subscriptionOptions: { ...UI_LABELS.subscriptionOptions },
|
|
4371
4425
|
updating: { ...UI_LABELS.updating }
|
|
4372
4426
|
}));
|
|
4373
|
-
var TargetArea =
|
|
4374
|
-
fill:
|
|
4375
|
-
flip:
|
|
4376
|
-
icon:
|
|
4377
|
-
label:
|
|
4378
|
-
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()
|
|
4379
4433
|
}).default(targetAreas[EditorMode.checkoutExtension][1]);
|
|
4380
|
-
var CABTracking =
|
|
4381
|
-
enableAttribution:
|
|
4382
|
-
enableSource:
|
|
4383
|
-
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)
|
|
4384
4438
|
}).nullish().transform((value) => value ?? { enableAttribution: true, enableSource: true, enableWidget: true });
|
|
4385
|
-
var CABExperiment =
|
|
4386
|
-
elementId:
|
|
4387
|
-
experimentId:
|
|
4388
|
-
experimentType:
|
|
4389
|
-
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()
|
|
4390
4444
|
});
|
|
4391
4445
|
var CABRootSection = CABLayoutSection.extend({
|
|
4392
|
-
editorMode:
|
|
4446
|
+
editorMode: import_zod66.z.enum(editorModes).default(EditorMode.checkoutExtension),
|
|
4393
4447
|
experiment: CABExperiment.optional(),
|
|
4394
4448
|
// Same rule as CABTracking above: the v1 converters pass raw legacy `previewMode` through, so a
|
|
4395
4449
|
// `null` must fall back rather than throw the widget; malformed values still throw.
|
|
4396
|
-
previewMode:
|
|
4397
|
-
storeId:
|
|
4450
|
+
previewMode: import_zod66.z.boolean().nullish().transform((value) => value ?? false),
|
|
4451
|
+
storeId: import_zod66.z.number().nullable().default(null),
|
|
4398
4452
|
targetArea: TargetArea.nullable(),
|
|
4399
4453
|
tracking: CABTracking,
|
|
4400
|
-
type:
|
|
4454
|
+
type: import_zod66.z.enum(widgetTypes).default(WidgetType.ui_extension_content_block),
|
|
4401
4455
|
uiLabels: CABUILabels,
|
|
4402
|
-
version:
|
|
4403
|
-
widgetId:
|
|
4456
|
+
version: import_zod66.z.literal(2).default(2),
|
|
4457
|
+
widgetId: import_zod66.z.number().nullable().default(null)
|
|
4404
4458
|
});
|
|
4405
4459
|
|
|
4406
4460
|
// src/schema/postPurchaseProductView.ts
|
|
4407
|
-
var PostPurchaseProductView =
|
|
4408
|
-
|
|
4461
|
+
var PostPurchaseProductView = import_zod67.z.union([
|
|
4462
|
+
import_zod67.z.object({
|
|
4409
4463
|
changeset: PostPurchaseProductChangeset.optional(),
|
|
4464
|
+
displayPrice: PostPurchaseDisplayPrice.optional(),
|
|
4410
4465
|
groupCatalog: PostPurchaseGroupCatalog.optional(),
|
|
4411
4466
|
initialVariant: PostPurchaseVariantSelector.optional(),
|
|
4412
4467
|
planCatalog: PostPurchasePlanCatalog.nullable().optional(),
|
|
4413
4468
|
preparation: PreparedPostPurchaseProduct.extend({
|
|
4414
|
-
display: PreparedPostPurchaseProduct.shape.display.extend({ description:
|
|
4469
|
+
display: PreparedPostPurchaseProduct.shape.display.extend({ description: import_zod67.z.string().nullable() }).refine(
|
|
4415
4470
|
({ description, descriptionDocument }) => description === null === (descriptionDocument !== void 0),
|
|
4416
4471
|
"Exactly one of the plain and rich descriptions is shown"
|
|
4417
4472
|
)
|
|
@@ -4420,33 +4475,35 @@ var PostPurchaseProductView = import_zod64.z.union([
|
|
|
4420
4475
|
sections: CABRootSection,
|
|
4421
4476
|
variantCatalog: PostPurchaseVariantCatalog.optional()
|
|
4422
4477
|
}),
|
|
4423
|
-
|
|
4478
|
+
import_zod67.z.object({
|
|
4424
4479
|
groupCatalog: PostPurchaseGroupCatalog.optional(),
|
|
4425
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(),
|
|
4426
4483
|
planCatalog: PostPurchasePlanCatalog.nullable().optional(),
|
|
4427
4484
|
preparation: PostPurchasePreparation.options[1],
|
|
4428
4485
|
purchaseOptions: PostPurchaseOptions.optional(),
|
|
4429
|
-
sections:
|
|
4486
|
+
sections: import_zod67.z.null(),
|
|
4430
4487
|
variantCatalog: PostPurchaseVariantCatalog.optional()
|
|
4431
4488
|
})
|
|
4432
4489
|
]);
|
|
4433
4490
|
|
|
4434
4491
|
// src/schema/postPurchaseProductCollectionView.ts
|
|
4435
|
-
var PostPurchaseProductCollectionView =
|
|
4436
|
-
members:
|
|
4437
|
-
|
|
4492
|
+
var PostPurchaseProductCollectionView = import_zod68.z.object({
|
|
4493
|
+
members: import_zod68.z.array(
|
|
4494
|
+
import_zod68.z.object({
|
|
4438
4495
|
productId: PostPurchaseProductId,
|
|
4439
|
-
productIndex:
|
|
4496
|
+
productIndex: import_zod68.z.number().int().nonnegative(),
|
|
4440
4497
|
view: PostPurchaseProductView
|
|
4441
4498
|
})
|
|
4442
4499
|
)
|
|
4443
4500
|
});
|
|
4444
|
-
var PostPurchaseCollectionChoice =
|
|
4501
|
+
var PostPurchaseCollectionChoice = import_zod68.z.object({
|
|
4445
4502
|
choice: PostPurchaseChoice.optional(),
|
|
4446
4503
|
productId: PostPurchaseProductId,
|
|
4447
4504
|
variantId: PostPurchaseVariantSelector.shape.variantId.optional()
|
|
4448
4505
|
}).strict();
|
|
4449
|
-
var PostPurchaseExcludedProductIds =
|
|
4506
|
+
var PostPurchaseExcludedProductIds = import_zod68.z.array(PostPurchaseProductId).default([]);
|
|
4450
4507
|
var PostPurchaseMemberSelector = PostPurchaseProgressSchema.shape.members.element.pick({ productId: true }).extend({ progressRevision: PostPurchaseProgressSchema.shape.revision });
|
|
4451
4508
|
var PostPurchaseMemberPointer = PostPurchaseProgressSchema.shape.members.element.omit({ status: true }).extend({
|
|
4452
4509
|
entryRevision: PostPurchaseProgressSchema.shape.entryRevision,
|
|
@@ -4459,7 +4516,7 @@ var PostPurchaseQuantityChoice = PostPurchaseCollectionChoice.extend({ quantity:
|
|
|
4459
4516
|
var PostPurchaseQuantityPolicy = PostPurchaseSettings.shape.quantityInputs.omit({ defaultQuantity: true }).extend({
|
|
4460
4517
|
initialQuantity: quantity,
|
|
4461
4518
|
maxValue: quantity,
|
|
4462
|
-
minValue:
|
|
4519
|
+
minValue: import_zod69.z.literal(0).transform(() => 1).or(quantity)
|
|
4463
4520
|
}).refine(({ maxValue, minValue }) => minValue <= maxValue, "Quantity bounds are reversed");
|
|
4464
4521
|
|
|
4465
4522
|
// src/schema/postPurchaseGroup.ts
|
|
@@ -4468,33 +4525,33 @@ var PostPurchaseGroupChoice = PostPurchaseQuantityChoice.extend({
|
|
|
4468
4525
|
});
|
|
4469
4526
|
|
|
4470
4527
|
// src/schema/postPurchaseHealth.ts
|
|
4471
|
-
var
|
|
4528
|
+
var import_zod72 = require("zod");
|
|
4472
4529
|
|
|
4473
4530
|
// src/schema/postPurchaseHealthSchedule.ts
|
|
4474
|
-
var
|
|
4531
|
+
var import_zod71 = require("zod");
|
|
4475
4532
|
|
|
4476
4533
|
// src/schema/postPurchaseReleaseSchedule.ts
|
|
4477
|
-
var
|
|
4478
|
-
var postPurchaseTaskNameSchema = (queue, id) =>
|
|
4479
|
-
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({
|
|
4480
4537
|
deadline: PostPurchaseTimestampSchema,
|
|
4481
4538
|
orderId: PostPurchaseOrderIdSchema,
|
|
4482
4539
|
releaseOwner: ReleaseOwnerSchema,
|
|
4483
4540
|
sessionId: PostPurchaseSessionIdSchema
|
|
4484
4541
|
});
|
|
4485
|
-
var SessionReleaseScheduleResponseSchema =
|
|
4486
|
-
data:
|
|
4542
|
+
var SessionReleaseScheduleResponseSchema = import_zod70.z.object({
|
|
4543
|
+
data: import_zod70.z.discriminatedUnion("status", [
|
|
4487
4544
|
SessionReleaseScheduleRequestSchema.extend({
|
|
4488
|
-
releaseOwner:
|
|
4489
|
-
status:
|
|
4545
|
+
releaseOwner: import_zod70.z.literal("rebuy"),
|
|
4546
|
+
status: import_zod70.z.literal("queued"),
|
|
4490
4547
|
taskName: postPurchaseTaskNameSchema("post-purchase-order-hold-release", "[a-f0-9]{64}-release")
|
|
4491
4548
|
}),
|
|
4492
4549
|
SessionReleaseScheduleRequestSchema.extend({
|
|
4493
|
-
releaseOwner:
|
|
4494
|
-
status:
|
|
4550
|
+
releaseOwner: import_zod70.z.literal("shopify"),
|
|
4551
|
+
status: import_zod70.z.literal("native")
|
|
4495
4552
|
})
|
|
4496
4553
|
]),
|
|
4497
|
-
successful:
|
|
4554
|
+
successful: import_zod70.z.literal(true)
|
|
4498
4555
|
});
|
|
4499
4556
|
|
|
4500
4557
|
// src/schema/postPurchaseHealthSchedule.ts
|
|
@@ -4503,15 +4560,15 @@ var PostPurchaseHealthTaskNameSchema = postPurchaseTaskNameSchema(
|
|
|
4503
4560
|
"post-purchase-health-check",
|
|
4504
4561
|
"[a-z0-9][a-z0-9-]*--[1-9][0-9]*"
|
|
4505
4562
|
);
|
|
4506
|
-
var HealthScheduleAcknowledgementSchema =
|
|
4563
|
+
var HealthScheduleAcknowledgementSchema = import_zod71.z.strictObject({
|
|
4507
4564
|
data: HealthScheduleSchema.extend({
|
|
4508
|
-
status:
|
|
4565
|
+
status: import_zod71.z.literal("queued"),
|
|
4509
4566
|
taskName: PostPurchaseHealthTaskNameSchema
|
|
4510
4567
|
}).refine(
|
|
4511
4568
|
(data) => data.taskName.endsWith(`/tasks/${postPurchaseHealthTaskId(data)}`),
|
|
4512
4569
|
"taskName must be this order's health task"
|
|
4513
4570
|
),
|
|
4514
|
-
successful:
|
|
4571
|
+
successful: import_zod71.z.literal(true)
|
|
4515
4572
|
});
|
|
4516
4573
|
|
|
4517
4574
|
// src/schema/postPurchaseHealth.ts
|
|
@@ -4520,90 +4577,93 @@ var HealthFactSchema = HealthScheduleSchema.pick({
|
|
|
4520
4577
|
operationId: true,
|
|
4521
4578
|
removePartialOrder: true
|
|
4522
4579
|
});
|
|
4523
|
-
var HealthScheduleReceiptSchema =
|
|
4580
|
+
var HealthScheduleReceiptSchema = import_zod72.z.strictObject({
|
|
4524
4581
|
recordedAt: PostPurchaseTimestampSchema,
|
|
4525
4582
|
taskName: PostPurchaseHealthTaskNameSchema
|
|
4526
4583
|
});
|
|
4527
|
-
var StoredHealthFactSchema = HealthFactSchema.extend({
|
|
4584
|
+
var StoredHealthFactSchema = HealthFactSchema.extend({
|
|
4585
|
+
checkoutToken: HealthScheduleSchema.shape.checkoutToken.optional(),
|
|
4586
|
+
scheduleReceipt: HealthScheduleReceiptSchema.optional()
|
|
4587
|
+
});
|
|
4528
4588
|
var HealthAttemptSchema = StoredHealthFactSchema.extend({
|
|
4529
4589
|
attemptedAt: PostPurchaseTimestampSchema,
|
|
4530
|
-
attemptId:
|
|
4531
|
-
status:
|
|
4590
|
+
attemptId: import_zod72.z.uuid(),
|
|
4591
|
+
status: import_zod72.z.literal("attempted")
|
|
4532
4592
|
});
|
|
4533
4593
|
var HealthResultSchema = HealthAttemptSchema.extend({
|
|
4534
4594
|
finishedAt: PostPurchaseTimestampSchema,
|
|
4535
|
-
status:
|
|
4595
|
+
status: import_zod72.z.enum(["returned", "unknown"])
|
|
4536
4596
|
});
|
|
4537
|
-
var HealthStateSchema =
|
|
4538
|
-
StoredHealthFactSchema.extend({ status:
|
|
4597
|
+
var HealthStateSchema = import_zod72.z.union([
|
|
4598
|
+
StoredHealthFactSchema.extend({ status: import_zod72.z.literal("pending") }),
|
|
4539
4599
|
HealthAttemptSchema,
|
|
4540
4600
|
HealthResultSchema
|
|
4541
4601
|
]);
|
|
4542
4602
|
var HealthPrepareRequestSchema = DecideRequestSchema.extend({
|
|
4543
4603
|
operationId: HealthScheduleSchema.shape.operationId
|
|
4544
4604
|
}).strict();
|
|
4545
|
-
var HealthPrepareResponseSchema =
|
|
4546
|
-
var HealthClaimRequestSchema =
|
|
4605
|
+
var HealthPrepareResponseSchema = import_zod72.z.object({ data: HealthScheduleSchema, successful: import_zod72.z.literal(true) });
|
|
4606
|
+
var HealthClaimRequestSchema = import_zod72.z.strictObject({
|
|
4547
4607
|
orderId: PostPurchaseOrderIdSchema,
|
|
4548
|
-
removePartialOrder:
|
|
4608
|
+
removePartialOrder: import_zod72.z.boolean(),
|
|
4549
4609
|
shop: ShopifyDomainSchema
|
|
4550
4610
|
});
|
|
4551
4611
|
var HealthClaimFactSchema = HealthClaimRequestSchema.extend({
|
|
4552
4612
|
healthScheduledAt: HealthFactSchema.shape.healthScheduledAt
|
|
4553
4613
|
});
|
|
4554
|
-
var HealthClaimResponseSchema =
|
|
4555
|
-
data:
|
|
4556
|
-
|
|
4557
|
-
HealthClaimFactSchema.extend({ status:
|
|
4558
|
-
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") })
|
|
4559
4619
|
]),
|
|
4560
|
-
successful:
|
|
4620
|
+
successful: import_zod72.z.literal(true)
|
|
4561
4621
|
});
|
|
4562
4622
|
var HealthResultRequestSchema = HealthClaimRequestSchema.extend({
|
|
4563
4623
|
attemptId: HealthAttemptSchema.shape.attemptId,
|
|
4564
4624
|
outcome: HealthResultSchema.shape.status
|
|
4565
4625
|
});
|
|
4566
|
-
var HealthResultResponseSchema =
|
|
4626
|
+
var HealthResultResponseSchema = import_zod72.z.object({
|
|
4567
4627
|
data: HealthClaimFactSchema.extend({
|
|
4568
4628
|
finishedAt: HealthResultSchema.shape.finishedAt,
|
|
4569
4629
|
status: HealthResultSchema.shape.status
|
|
4570
4630
|
}),
|
|
4571
|
-
successful:
|
|
4631
|
+
successful: import_zod72.z.literal(true)
|
|
4572
4632
|
});
|
|
4573
4633
|
|
|
4574
4634
|
// src/schema/postPurchaseLifecycle.ts
|
|
4575
|
-
var
|
|
4576
|
-
var Presentation =
|
|
4635
|
+
var import_zod73 = require("zod");
|
|
4636
|
+
var Presentation = import_zod73.z.strictObject({
|
|
4577
4637
|
member: PostPurchaseMemberIdentity,
|
|
4578
4638
|
selectedProductId: PostPurchaseMemberIdentity.shape.productId.optional(),
|
|
4579
4639
|
variant: PostPurchaseVariantSelector
|
|
4580
4640
|
});
|
|
4581
4641
|
var LifecycleObservationRequestSchema = DecideRequestSchema.extend({
|
|
4582
4642
|
entryRevision: PostPurchaseProgressSchema.shape.entryRevision,
|
|
4583
|
-
eventType:
|
|
4643
|
+
eventType: import_zod73.z.enum(["OFFER_VIEWED", "OFFER_TIMER_EXPIRED"]),
|
|
4584
4644
|
presentation: Presentation.nullable(),
|
|
4585
4645
|
progressRevision: PostPurchaseProgressSchema.shape.revision,
|
|
4586
|
-
requestId:
|
|
4646
|
+
requestId: import_zod73.z.uuid()
|
|
4587
4647
|
}).strict().refine(
|
|
4588
4648
|
({ eventType, presentation }) => eventType !== "OFFER_VIEWED" || presentation !== null,
|
|
4589
4649
|
"Viewed observations require a presented product"
|
|
4590
4650
|
);
|
|
4591
|
-
var LifecycleObservationResponseSchema =
|
|
4592
|
-
data:
|
|
4651
|
+
var LifecycleObservationResponseSchema = import_zod73.z.object({
|
|
4652
|
+
data: import_zod73.z.strictObject({
|
|
4593
4653
|
requestId: LifecycleObservationRequestSchema.shape.requestId,
|
|
4594
|
-
status:
|
|
4654
|
+
status: import_zod73.z.union([AcceptedEventOutcomeSchema, import_zod73.z.literal("unavailable")])
|
|
4595
4655
|
}),
|
|
4596
|
-
successful:
|
|
4656
|
+
successful: import_zod73.z.literal(true)
|
|
4597
4657
|
});
|
|
4598
4658
|
|
|
4599
4659
|
// src/schema/postPurchaseOffer.ts
|
|
4600
|
-
var
|
|
4660
|
+
var import_zod75 = require("zod");
|
|
4601
4661
|
|
|
4602
4662
|
// src/schema/postPurchaseSkipTrace.ts
|
|
4603
|
-
var
|
|
4663
|
+
var import_zod74 = require("zod");
|
|
4604
4664
|
var POST_PURCHASE_SKIP_LIMIT = 32;
|
|
4605
|
-
var PostPurchaseSkipTraceSchema =
|
|
4606
|
-
|
|
4665
|
+
var PostPurchaseSkipTraceSchema = import_zod74.z.array(
|
|
4666
|
+
import_zod74.z.object({
|
|
4607
4667
|
entry: DecisionEntrySchema,
|
|
4608
4668
|
reason: PostPurchaseSkipReasonSchema
|
|
4609
4669
|
})
|
|
@@ -4611,66 +4671,66 @@ var PostPurchaseSkipTraceSchema = import_zod71.z.array(
|
|
|
4611
4671
|
|
|
4612
4672
|
// src/schema/postPurchaseOffer.ts
|
|
4613
4673
|
var OfferPreparationRequestSchema = DecideRequestSchema.strict();
|
|
4614
|
-
var OfferPreparationResponseSchema =
|
|
4615
|
-
data:
|
|
4616
|
-
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)
|
|
4617
4677
|
});
|
|
4618
4678
|
|
|
4619
4679
|
// src/schema/postPurchaseOfferEligibility.ts
|
|
4620
|
-
var
|
|
4680
|
+
var import_zod76 = require("zod");
|
|
4621
4681
|
var selection2 = PreparedPostPurchaseProduct.shape.selection;
|
|
4622
|
-
var PostPurchaseOfferSkipReason =
|
|
4623
|
-
var PostPurchaseOfferEligibilityContext =
|
|
4682
|
+
var PostPurchaseOfferSkipReason = import_zod76.z.enum(["empty", "no-eligible-subscription"]);
|
|
4683
|
+
var PostPurchaseOfferEligibilityContext = import_zod76.z.object({
|
|
4624
4684
|
excludedProductIds: PostPurchaseExcludedProductIds,
|
|
4625
|
-
originalLineItems:
|
|
4685
|
+
originalLineItems: import_zod76.z.array(selection2.pick({ productId: true, sellingPlanId: true, variantId: true }))
|
|
4626
4686
|
});
|
|
4627
|
-
var PostPurchaseOfferEligibility =
|
|
4628
|
-
|
|
4629
|
-
members:
|
|
4630
|
-
|
|
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() })
|
|
4631
4691
|
),
|
|
4632
|
-
status:
|
|
4692
|
+
status: import_zod76.z.literal("retain")
|
|
4633
4693
|
}),
|
|
4634
|
-
|
|
4635
|
-
|
|
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") })
|
|
4636
4696
|
]);
|
|
4637
4697
|
|
|
4638
4698
|
// src/schema/postPurchaseOfferPresentation.ts
|
|
4639
|
-
var
|
|
4699
|
+
var import_zod77 = require("zod");
|
|
4640
4700
|
var language2 = PostPurchaseSettings.shape.language.shape.global.unwrap().unwrap();
|
|
4641
|
-
var PostPurchaseOfferPresentation =
|
|
4701
|
+
var PostPurchaseOfferPresentation = import_zod77.z.strictObject({
|
|
4642
4702
|
labels: language2.pick({ declineAll: true, declineThisOffer: true }),
|
|
4643
4703
|
layout: PostPurchaseSettings.shape.offersLayout,
|
|
4644
4704
|
sections: CABRootSection.nullable(),
|
|
4645
4705
|
showDeclineAll: PostPurchaseSettings.shape.productOptions.shape.showDeclineAll
|
|
4646
4706
|
});
|
|
4647
4707
|
var OfferPresentationRequestSchema = DecideRequestSchema.strict();
|
|
4648
|
-
var OfferPresentationResponseSchema =
|
|
4649
|
-
data:
|
|
4708
|
+
var OfferPresentationResponseSchema = import_zod77.z.object({
|
|
4709
|
+
data: import_zod77.z.strictObject({
|
|
4650
4710
|
presentation: PostPurchaseOfferPresentation.nullable(),
|
|
4651
4711
|
progress: PostPurchaseProgressSchema.nullable(),
|
|
4652
4712
|
serverNow: PostPurchaseTimestampSchema
|
|
4653
4713
|
}),
|
|
4654
|
-
successful:
|
|
4714
|
+
successful: import_zod77.z.literal(true)
|
|
4655
4715
|
});
|
|
4656
4716
|
|
|
4657
4717
|
// src/schema/postPurchaseOrderDecision.ts
|
|
4658
|
-
var
|
|
4659
|
-
var OrderDecisionSchema =
|
|
4660
|
-
|
|
4661
|
-
|
|
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() })
|
|
4662
4722
|
]);
|
|
4663
4723
|
|
|
4664
4724
|
// src/schema/postPurchasePolicy.ts
|
|
4665
|
-
var
|
|
4666
|
-
var HoldSettingSchema =
|
|
4667
|
-
|
|
4668
|
-
|
|
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) })
|
|
4669
4729
|
]);
|
|
4670
|
-
var TimingSettingsSchema =
|
|
4730
|
+
var TimingSettingsSchema = import_zod79.z.object({ flowHold: HoldSettingSchema, shopHold: HoldSettingSchema });
|
|
4671
4731
|
var SessionPolicySchema = TimingSettingsSchema.extend({
|
|
4672
|
-
durationMinutes:
|
|
4673
|
-
source:
|
|
4732
|
+
durationMinutes: import_zod79.z.number().int().min(1).max(60).nullable(),
|
|
4733
|
+
source: import_zod79.z.enum(["shop", "flow", "native"])
|
|
4674
4734
|
}).refine(
|
|
4675
4735
|
(policy) => {
|
|
4676
4736
|
const expectedSource = policy.shopHold.enabled ? "shop" : policy.flowHold.enabled ? "flow" : "native";
|
|
@@ -4684,8 +4744,8 @@ var SessionPolicySchema = TimingSettingsSchema.extend({
|
|
|
4684
4744
|
);
|
|
4685
4745
|
|
|
4686
4746
|
// src/schema/postPurchasePreparationOptions.ts
|
|
4687
|
-
var
|
|
4688
|
-
var PostPurchasePreparationOptions =
|
|
4747
|
+
var import_zod80 = require("zod");
|
|
4748
|
+
var PostPurchasePreparationOptions = import_zod80.z.object({
|
|
4689
4749
|
choice: PostPurchaseChoice.optional(),
|
|
4690
4750
|
member: PostPurchaseMemberSelector.strict().optional(),
|
|
4691
4751
|
quantity: PreparedPostPurchaseProduct.shape.selection.shape.quantity.optional(),
|
|
@@ -4697,8 +4757,8 @@ var PostPurchasePreparationOptions = import_zod77.z.object({
|
|
|
4697
4757
|
);
|
|
4698
4758
|
|
|
4699
4759
|
// src/schema/postPurchaseProductSettings.ts
|
|
4700
|
-
var
|
|
4701
|
-
var amount =
|
|
4760
|
+
var import_zod81 = require("zod");
|
|
4761
|
+
var amount = import_zod81.z.union([import_zod81.z.number().nonnegative(), PostPurchaseAmount.transform(Number)]);
|
|
4702
4762
|
var PostPurchaseProductSettings = PostPurchaseSettings.pick({
|
|
4703
4763
|
discountedFrom: true,
|
|
4704
4764
|
language: true,
|
|
@@ -4710,22 +4770,22 @@ var PostPurchaseProductSettings = PostPurchaseSettings.pick({
|
|
|
4710
4770
|
subscriptionIsDefault: true,
|
|
4711
4771
|
upgradeToSubscription: true
|
|
4712
4772
|
}).extend({
|
|
4713
|
-
advance:
|
|
4714
|
-
blocks:
|
|
4773
|
+
advance: import_zod81.z.unknown().default({}),
|
|
4774
|
+
blocks: import_zod81.z.array(import_zod81.z.unknown()).optional(),
|
|
4715
4775
|
discount: PostPurchaseSettings.shape.discount.extend({ amount: amount.default(30) }),
|
|
4716
|
-
integrations:
|
|
4776
|
+
integrations: import_zod81.z.unknown().default({}),
|
|
4717
4777
|
shipping: PostPurchaseSettings.shape.shipping.extend({ amount: amount.default(10) }),
|
|
4718
|
-
styles:
|
|
4778
|
+
styles: import_zod81.z.unknown().default({}),
|
|
4719
4779
|
subImages: PostPurchaseSettings.shape.subImages.catch(null),
|
|
4720
|
-
subscription:
|
|
4780
|
+
subscription: import_zod81.z.unknown().default(PostPurchaseSettings.shape.subscription.parse(void 0))
|
|
4721
4781
|
});
|
|
4722
4782
|
|
|
4723
4783
|
// src/schema/postPurchaseRecovery.ts
|
|
4724
|
-
var
|
|
4784
|
+
var import_zod82 = require("zod");
|
|
4725
4785
|
var PurchaseRecoveryRequestSchema = DecideRequestSchema.strict();
|
|
4726
|
-
var PurchaseRecoveryResponseSchema =
|
|
4727
|
-
data:
|
|
4728
|
-
operation:
|
|
4786
|
+
var PurchaseRecoveryResponseSchema = import_zod82.z.object({
|
|
4787
|
+
data: import_zod82.z.object({
|
|
4788
|
+
operation: import_zod82.z.object({
|
|
4729
4789
|
observation: RecordedPurchaseObservationSchema.nullable(),
|
|
4730
4790
|
operationId: PurchaseReceiptSchema.shape.operationId,
|
|
4731
4791
|
upgrade: UpgradeProgressSchema.optional()
|
|
@@ -4735,41 +4795,41 @@ var PurchaseRecoveryResponseSchema = import_zod79.z.object({
|
|
|
4735
4795
|
}).nullable(),
|
|
4736
4796
|
progress: PostPurchaseProgressSchema.nullable().optional()
|
|
4737
4797
|
}),
|
|
4738
|
-
successful:
|
|
4798
|
+
successful: import_zod82.z.literal(true)
|
|
4739
4799
|
});
|
|
4740
4800
|
|
|
4741
4801
|
// src/schema/postPurchaseReleaseClaim.ts
|
|
4742
|
-
var
|
|
4802
|
+
var import_zod83 = require("zod");
|
|
4743
4803
|
var ReleaseClaimRequestSchema = ReleaseAuthorityRequestSchema;
|
|
4744
|
-
var ReleaseClaimResponseSchema =
|
|
4745
|
-
data:
|
|
4746
|
-
|
|
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") }),
|
|
4747
4807
|
PendingReleaseAuthoritySchema,
|
|
4748
4808
|
ReadyReleaseAuthoritySchema
|
|
4749
4809
|
]),
|
|
4750
|
-
successful:
|
|
4810
|
+
successful: import_zod83.z.literal(true)
|
|
4751
4811
|
});
|
|
4752
4812
|
|
|
4753
4813
|
// src/schema/postPurchaseSelection.ts
|
|
4754
|
-
var
|
|
4814
|
+
var import_zod84 = require("zod");
|
|
4755
4815
|
var SelectionClaimsSchema = DecideRequestSchema.extend({
|
|
4756
4816
|
appId: PostPurchaseAppIdSchema,
|
|
4757
4817
|
entry: DecisionEntrySchema,
|
|
4758
|
-
iss:
|
|
4759
|
-
purpose:
|
|
4818
|
+
iss: import_zod84.z.literal("rebuy-api"),
|
|
4819
|
+
purpose: import_zod84.z.literal("post-purchase-selection")
|
|
4760
4820
|
});
|
|
4761
4821
|
var SessionStartRequestSchema = DecideRequestSchema.extend({
|
|
4762
|
-
selectionToken:
|
|
4822
|
+
selectionToken: import_zod84.z.string().min(1).max(8192).optional()
|
|
4763
4823
|
}).strict();
|
|
4764
4824
|
|
|
4765
4825
|
// src/schema/postPurchaseSession.ts
|
|
4766
|
-
var
|
|
4826
|
+
var import_zod85 = require("zod");
|
|
4767
4827
|
var SessionIdentitySchema = DecideRequestSchema.extend({ appId: PostPurchaseAppIdSchema });
|
|
4768
|
-
var SessionOrderTimingSchema =
|
|
4828
|
+
var SessionOrderTimingSchema = import_zod85.z.object({
|
|
4769
4829
|
nativeDeadline: PostPurchaseTimestampSchema,
|
|
4770
4830
|
orderCreatedAt: PostPurchaseTimestampSchema,
|
|
4771
4831
|
orderId: PostPurchaseOrderIdSchema,
|
|
4772
|
-
timingSource:
|
|
4832
|
+
timingSource: import_zod85.z.literal("shopify-order-created-at")
|
|
4773
4833
|
});
|
|
4774
4834
|
var ReadySessionTimingSchema = SessionOrderTimingSchema.extend({
|
|
4775
4835
|
deadline: PostPurchaseTimestampSchema,
|
|
@@ -4786,33 +4846,33 @@ var ReadySessionTimingSchema = SessionOrderTimingSchema.extend({
|
|
|
4786
4846
|
message: "deadline must not exceed nativeDeadline",
|
|
4787
4847
|
path: ["deadline"]
|
|
4788
4848
|
});
|
|
4789
|
-
var SessionStartResponseSchema =
|
|
4790
|
-
data:
|
|
4791
|
-
phase:
|
|
4849
|
+
var SessionStartResponseSchema = import_zod85.z.object({
|
|
4850
|
+
data: import_zod85.z.object({
|
|
4851
|
+
phase: import_zod85.z.literal("render"),
|
|
4792
4852
|
serverNow: PostPurchaseTimestampSchema,
|
|
4793
4853
|
session: ReadySessionTimingSchema,
|
|
4794
|
-
workflowPhase:
|
|
4854
|
+
workflowPhase: import_zod85.z.literal("start")
|
|
4795
4855
|
}),
|
|
4796
|
-
successful:
|
|
4856
|
+
successful: import_zod85.z.literal(true)
|
|
4797
4857
|
});
|
|
4798
4858
|
|
|
4799
4859
|
// src/schema/postPurchaseShadow.ts
|
|
4800
|
-
var
|
|
4801
|
-
var PostPurchaseShadowSelectionSchema =
|
|
4802
|
-
|
|
4803
|
-
|
|
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") })
|
|
4804
4864
|
]);
|
|
4805
|
-
var PostPurchaseShadowReportFields =
|
|
4806
|
-
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, {
|
|
4807
4867
|
message: "differences must not contain duplicate entries"
|
|
4808
4868
|
}),
|
|
4809
4869
|
legacySelection: PostPurchaseShadowSelectionSchema,
|
|
4810
|
-
phase:
|
|
4811
|
-
sampleId:
|
|
4870
|
+
phase: import_zod86.z.literal("shouldRender"),
|
|
4871
|
+
sampleId: import_zod86.z.string(),
|
|
4812
4872
|
serverSelection: PostPurchaseShadowSelectionSchema.optional(),
|
|
4813
|
-
status:
|
|
4814
|
-
targetingFlowIds:
|
|
4815
|
-
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")
|
|
4816
4876
|
});
|
|
4817
4877
|
var PostPurchaseShadowReportSchema = PostPurchaseShadowReportFields.refine(
|
|
4818
4878
|
(report) => report.status !== "match" || report.differences.length === 0,
|
|
@@ -4825,21 +4885,10 @@ var PostPurchaseShadowReportSchema = PostPurchaseShadowReportFields.refine(
|
|
|
4825
4885
|
path: ["status"]
|
|
4826
4886
|
});
|
|
4827
4887
|
|
|
4828
|
-
// src/schema/postPurchaseSubscriptionDisplay.ts
|
|
4829
|
-
var import_zod84 = require("zod");
|
|
4830
|
-
var Minor2 = import_zod84.z.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER);
|
|
4831
|
-
var PostPurchaseSubscriptionDisplay = import_zod84.z.object({
|
|
4832
|
-
comparisonMinor: Minor2,
|
|
4833
|
-
currencyCode: import_zod84.z.string().regex(/^[A-Z]{3}$/),
|
|
4834
|
-
priceMinor: Minor2,
|
|
4835
|
-
savingMinor: Minor2,
|
|
4836
|
-
savingPercent: import_zod84.z.number().int().min(0).max(100)
|
|
4837
|
-
});
|
|
4838
|
-
|
|
4839
4888
|
// src/schema/postPurchaseSubscriptionProduct.ts
|
|
4840
|
-
var
|
|
4889
|
+
var import_zod87 = require("zod");
|
|
4841
4890
|
var PreparedPostPurchaseSubscription = PreparedPostPurchaseProduct.extend({
|
|
4842
|
-
selection: PreparedPostPurchaseProduct.shape.selection.extend({ sellingPlanId:
|
|
4891
|
+
selection: PreparedPostPurchaseProduct.shape.selection.extend({ sellingPlanId: import_zod87.z.number().int().positive() }),
|
|
4843
4892
|
terms: PreparedPostPurchaseProduct.shape.terms.extend({
|
|
4844
4893
|
subscription: PostPurchaseSubscriptionTerms
|
|
4845
4894
|
}).refine(
|
|
@@ -4852,108 +4901,108 @@ var readPostPurchaseSubscription = (prepared) => {
|
|
|
4852
4901
|
};
|
|
4853
4902
|
|
|
4854
4903
|
// src/schema/postPurchaseTransition.ts
|
|
4855
|
-
var
|
|
4904
|
+
var import_zod88 = require("zod");
|
|
4856
4905
|
var OfferTransitionRequestSchema = DecideRequestSchema.extend({
|
|
4857
4906
|
entryRevision: PostPurchaseProgressSchema.shape.entryRevision,
|
|
4858
4907
|
progressRevision: PostPurchaseProgressSchema.shape.revision
|
|
4859
4908
|
}).strict();
|
|
4860
|
-
var OfferTransitionResponseSchema =
|
|
4861
|
-
data:
|
|
4909
|
+
var OfferTransitionResponseSchema = import_zod88.z.object({
|
|
4910
|
+
data: import_zod88.z.object({
|
|
4862
4911
|
attemptedSkips: PostPurchaseSkipTraceSchema.optional(),
|
|
4863
4912
|
progress: PostPurchaseProgressSchema,
|
|
4864
|
-
status:
|
|
4913
|
+
status: import_zod88.z.enum(["advanced", "no-child", "unavailable"])
|
|
4865
4914
|
}),
|
|
4866
|
-
successful:
|
|
4915
|
+
successful: import_zod88.z.literal(true)
|
|
4867
4916
|
});
|
|
4868
4917
|
|
|
4869
4918
|
// src/schema/postPurchaseVariantDefault.ts
|
|
4870
|
-
var
|
|
4919
|
+
var import_zod89 = require("zod");
|
|
4871
4920
|
var values = PostPurchaseVariantValues.partial().extend({
|
|
4872
4921
|
option1: PostPurchaseVariantValues.shape.option1.nullish()
|
|
4873
4922
|
});
|
|
4874
4923
|
var variant = values.extend({
|
|
4875
4924
|
id: PostPurchaseVariantId,
|
|
4876
|
-
inventoryManagement:
|
|
4877
|
-
inventoryPolicy:
|
|
4878
|
-
inventoryQuantity:
|
|
4925
|
+
inventoryManagement: import_zod89.z.string().nullable(),
|
|
4926
|
+
inventoryPolicy: import_zod89.z.string(),
|
|
4927
|
+
inventoryQuantity: import_zod89.z.number()
|
|
4879
4928
|
});
|
|
4880
|
-
var options =
|
|
4881
|
-
var PostPurchaseVariantDefaultProduct =
|
|
4929
|
+
var options = import_zod89.z.array(PostPurchaseVariantOption.pick({ name: true, values: true }));
|
|
4930
|
+
var PostPurchaseVariantDefaultProduct = import_zod89.z.object({
|
|
4882
4931
|
id: PostPurchaseProductId,
|
|
4883
4932
|
options,
|
|
4884
4933
|
selectedVariant: variant.optional(),
|
|
4885
|
-
variants:
|
|
4934
|
+
variants: import_zod89.z.array(variant)
|
|
4886
4935
|
});
|
|
4887
4936
|
var PostPurchaseVariantDefaultSettings = PostPurchaseSettings.shape.productOptions.pick({
|
|
4888
4937
|
hideOutOfStockVariants: true,
|
|
4889
4938
|
matchVariant: true
|
|
4890
4939
|
});
|
|
4891
|
-
var PostPurchaseOrderAttributes =
|
|
4892
|
-
var PostPurchaseOriginalVariants =
|
|
4893
|
-
|
|
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 })
|
|
4894
4943
|
);
|
|
4895
|
-
var PostPurchaseAttributeProducts =
|
|
4896
|
-
|
|
4944
|
+
var PostPurchaseAttributeProducts = import_zod89.z.array(
|
|
4945
|
+
import_zod89.z.object({ id: PostPurchaseProductId, options, variants: import_zod89.z.array(values.extend({ id: PostPurchaseVariantId })) })
|
|
4897
4946
|
);
|
|
4898
4947
|
|
|
4899
4948
|
// src/schema/postPurchaseVariantDefaultContext.ts
|
|
4900
|
-
var
|
|
4901
|
-
var PostPurchaseVariantDefaultContext =
|
|
4902
|
-
enrichedLineItems:
|
|
4949
|
+
var import_zod90 = require("zod");
|
|
4950
|
+
var PostPurchaseVariantDefaultContext = import_zod90.z.object({
|
|
4951
|
+
enrichedLineItems: import_zod90.z.unknown().optional(),
|
|
4903
4952
|
originalVariants: PostPurchaseOriginalVariants
|
|
4904
4953
|
});
|
|
4905
4954
|
|
|
4906
4955
|
// src/schema/shopConfig.ts
|
|
4907
|
-
var
|
|
4908
|
-
var ShopConfig =
|
|
4909
|
-
activeExperiments:
|
|
4910
|
-
|
|
4911
|
-
data:
|
|
4912
|
-
|
|
4913
|
-
aliasName:
|
|
4914
|
-
cssInput:
|
|
4915
|
-
elementId:
|
|
4916
|
-
id:
|
|
4917
|
-
javascriptInput:
|
|
4918
|
-
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()
|
|
4919
4968
|
})
|
|
4920
4969
|
),
|
|
4921
|
-
id:
|
|
4922
|
-
name:
|
|
4923
|
-
pageTarget:
|
|
4924
|
-
pageTargetUrl:
|
|
4925
|
-
placeholderId:
|
|
4926
|
-
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()
|
|
4927
4976
|
})
|
|
4928
4977
|
),
|
|
4929
|
-
activePackages:
|
|
4930
|
-
|
|
4931
|
-
cancelledAt:
|
|
4932
|
-
id:
|
|
4933
|
-
installedAt:
|
|
4934
|
-
isActive:
|
|
4935
|
-
isBillable:
|
|
4936
|
-
packageId:
|
|
4937
|
-
packageName:
|
|
4938
|
-
shortName:
|
|
4939
|
-
trialDays:
|
|
4940
|
-
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()
|
|
4941
4990
|
})
|
|
4942
4991
|
),
|
|
4943
|
-
apiKey:
|
|
4944
|
-
billingVersion:
|
|
4945
|
-
cacheKey:
|
|
4946
|
-
carousel:
|
|
4947
|
-
currency:
|
|
4948
|
-
currencySymbol:
|
|
4949
|
-
domain:
|
|
4950
|
-
enabledJquery:
|
|
4951
|
-
enabledPresentmentCurrencies:
|
|
4952
|
-
hasSmartCollectionsEnabled:
|
|
4953
|
-
hasSmartSearchEnabled:
|
|
4954
|
-
id:
|
|
4955
|
-
integrations:
|
|
4956
|
-
|
|
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([
|
|
4957
5006
|
"attentive",
|
|
4958
5007
|
"judgeme",
|
|
4959
5008
|
"junip",
|
|
@@ -4966,170 +5015,170 @@ var ShopConfig = import_zod89.z.object({
|
|
|
4966
5015
|
"stamped",
|
|
4967
5016
|
"yotpo"
|
|
4968
5017
|
]),
|
|
4969
|
-
|
|
5018
|
+
import_zod91.z.union([import_zod91.z.boolean(), import_zod91.z.unknown()])
|
|
4970
5019
|
),
|
|
4971
|
-
markets:
|
|
4972
|
-
enabled:
|
|
5020
|
+
markets: import_zod91.z.object({
|
|
5021
|
+
enabled: import_zod91.z.boolean()
|
|
4973
5022
|
}),
|
|
4974
|
-
monetize:
|
|
4975
|
-
publisherKey:
|
|
5023
|
+
monetize: import_zod91.z.object({
|
|
5024
|
+
publisherKey: import_zod91.z.string().nullable()
|
|
4976
5025
|
}).nullish(),
|
|
4977
|
-
moneyFormat:
|
|
4978
|
-
myshopifyDomain:
|
|
4979
|
-
primaryLocale:
|
|
4980
|
-
productGroupsEnabled:
|
|
4981
|
-
rechargeCustomDomain:
|
|
4982
|
-
sellingPlansEnabled:
|
|
4983
|
-
shopId:
|
|
4984
|
-
shopifySellingPlansEnabled:
|
|
4985
|
-
shopName:
|
|
4986
|
-
storefrontAccessToken:
|
|
4987
|
-
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()
|
|
4988
5037
|
});
|
|
4989
5038
|
|
|
4990
5039
|
// src/schema/userConfig.ts
|
|
4991
|
-
var
|
|
4992
|
-
var UserConfig =
|
|
5040
|
+
var import_zod92 = require("zod");
|
|
5041
|
+
var UserConfig = import_zod92.z.object({
|
|
4993
5042
|
shop: ShopConfig,
|
|
4994
5043
|
/**
|
|
4995
5044
|
* `.catch(undefined)` is the safety bar: smart-cart shape drift can NEVER fail `fetchUserConfig`,
|
|
4996
5045
|
* which resolves the apiKey for every offers/monetize/analytics/gift request.
|
|
4997
5046
|
*/
|
|
4998
5047
|
smartCart: SmartCartConfig.nullish().catch(void 0),
|
|
4999
|
-
smartFlows:
|
|
5048
|
+
smartFlows: import_zod92.z.array(import_zod92.z.unknown())
|
|
5000
5049
|
});
|
|
5001
5050
|
|
|
5002
5051
|
// src/schema/widgetData.ts
|
|
5003
|
-
var
|
|
5052
|
+
var import_zod101 = require("zod");
|
|
5004
5053
|
|
|
5005
5054
|
// src/schema/widgets/abTestingPlaceholder.ts
|
|
5006
|
-
var
|
|
5007
|
-
var ABTestingPlaceholder =
|
|
5008
|
-
type:
|
|
5055
|
+
var import_zod93 = require("zod");
|
|
5056
|
+
var ABTestingPlaceholder = import_zod93.z.looseObject({
|
|
5057
|
+
type: import_zod93.z.literal("placeholder")
|
|
5009
5058
|
});
|
|
5010
5059
|
|
|
5011
5060
|
// src/schema/widgets/checkoutExtension.ts
|
|
5012
|
-
var
|
|
5013
|
-
var CheckoutExtension =
|
|
5014
|
-
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)
|
|
5015
5064
|
});
|
|
5016
5065
|
|
|
5017
5066
|
// src/schema/widgets/contentBlock.ts
|
|
5018
|
-
var
|
|
5019
|
-
var ContentBlockV1 =
|
|
5020
|
-
blockSpacing:
|
|
5021
|
-
imageBlocks:
|
|
5022
|
-
|
|
5023
|
-
|
|
5024
|
-
altText:
|
|
5025
|
-
description:
|
|
5026
|
-
id:
|
|
5027
|
-
imagePlacement:
|
|
5028
|
-
imageSize:
|
|
5029
|
-
imageUrl:
|
|
5030
|
-
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"]),
|
|
5031
5080
|
/** Inline scale only: an image caption can never be a block-level heading. */
|
|
5032
|
-
textSize:
|
|
5081
|
+
textSize: import_zod95.z.enum(inlineTextSizeNames)
|
|
5033
5082
|
})
|
|
5034
5083
|
),
|
|
5035
|
-
|
|
5084
|
+
import_zod95.z.strictObject({}).transform(() => [])
|
|
5036
5085
|
]).optional(),
|
|
5037
|
-
imageLayout:
|
|
5038
|
-
language:
|
|
5039
|
-
description:
|
|
5040
|
-
superTitle:
|
|
5041
|
-
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()
|
|
5042
5091
|
}),
|
|
5043
|
-
previewMode:
|
|
5044
|
-
type:
|
|
5045
|
-
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)
|
|
5046
5095
|
});
|
|
5047
|
-
var ContentBlock =
|
|
5096
|
+
var ContentBlock = import_zod95.z.discriminatedUnion("version", [
|
|
5048
5097
|
ContentBlockV1,
|
|
5049
5098
|
CABRootSection.extend({
|
|
5050
|
-
type:
|
|
5099
|
+
type: import_zod95.z.literal(WidgetType.ui_extension_content_block).default(WidgetType.ui_extension_content_block)
|
|
5051
5100
|
})
|
|
5052
5101
|
]);
|
|
5053
5102
|
|
|
5054
5103
|
// src/schema/widgets/giftWithPurchase.ts
|
|
5055
|
-
var
|
|
5056
|
-
var GiftWithPurchase =
|
|
5057
|
-
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)
|
|
5058
5107
|
});
|
|
5059
5108
|
|
|
5060
5109
|
// src/schema/widgets/lineItemEditor.ts
|
|
5061
|
-
var
|
|
5062
|
-
var LineItemEditorSwitchLanguageV1 =
|
|
5063
|
-
downgradeToOneTimeLabel:
|
|
5110
|
+
var import_zod97 = require("zod");
|
|
5111
|
+
var LineItemEditorSwitchLanguageV1 = import_zod97.z.object({
|
|
5112
|
+
downgradeToOneTimeLabel: import_zod97.z.string().optional(),
|
|
5064
5113
|
/** Frequency-option template (`{{frequency}}`/`{{interval}}`) for the plan select. */
|
|
5065
|
-
subscriptionOptionLabel:
|
|
5066
|
-
upgradeToSubscriptionLabel:
|
|
5067
|
-
upgradeToSubscriptionWithoutDiscountLabel:
|
|
5114
|
+
subscriptionOptionLabel: import_zod97.z.string().optional(),
|
|
5115
|
+
upgradeToSubscriptionLabel: import_zod97.z.string().optional(),
|
|
5116
|
+
upgradeToSubscriptionWithoutDiscountLabel: import_zod97.z.string().optional()
|
|
5068
5117
|
});
|
|
5069
|
-
var LineItemEditorV1 =
|
|
5118
|
+
var LineItemEditorV1 = import_zod97.z.object({
|
|
5070
5119
|
/** Legacy `getStyles` button style; the converter carries a valid kind, defaulting to `plain`. */
|
|
5071
|
-
button:
|
|
5072
|
-
previewMode:
|
|
5073
|
-
switchToSubscription:
|
|
5074
|
-
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(),
|
|
5075
5124
|
language: LineItemEditorSwitchLanguageV1.optional()
|
|
5076
5125
|
}).optional(),
|
|
5077
|
-
switchToSubscriptionEnabled:
|
|
5078
|
-
tracking:
|
|
5079
|
-
enableAttribution:
|
|
5080
|
-
enableSource:
|
|
5081
|
-
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()
|
|
5082
5131
|
}).optional(),
|
|
5083
|
-
type:
|
|
5084
|
-
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)
|
|
5085
5134
|
});
|
|
5086
|
-
var LineItemEditor =
|
|
5135
|
+
var LineItemEditor = import_zod97.z.discriminatedUnion("version", [
|
|
5087
5136
|
LineItemEditorV1,
|
|
5088
5137
|
CABRootSection.extend({
|
|
5089
|
-
type:
|
|
5138
|
+
type: import_zod97.z.literal(WidgetType.ui_extension_line_item_editor).default(WidgetType.ui_extension_line_item_editor)
|
|
5090
5139
|
})
|
|
5091
5140
|
]);
|
|
5092
5141
|
|
|
5093
5142
|
// src/schema/widgets/progressBar.ts
|
|
5094
|
-
var
|
|
5095
|
-
var ProgressBar =
|
|
5096
|
-
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)
|
|
5097
5146
|
});
|
|
5098
5147
|
|
|
5099
5148
|
// src/schema/widgets/rebuyButton.ts
|
|
5100
|
-
var
|
|
5101
|
-
var RebuyButtonV1 =
|
|
5102
|
-
type:
|
|
5103
|
-
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)
|
|
5104
5153
|
});
|
|
5105
|
-
var RebuyButton =
|
|
5154
|
+
var RebuyButton = import_zod99.z.discriminatedUnion("version", [
|
|
5106
5155
|
RebuyButtonV1,
|
|
5107
5156
|
CABRootSection.extend({
|
|
5108
|
-
type:
|
|
5157
|
+
type: import_zod99.z.literal(WidgetType.ui_extension_button).default(WidgetType.ui_extension_button)
|
|
5109
5158
|
})
|
|
5110
5159
|
]);
|
|
5111
5160
|
|
|
5112
5161
|
// src/schema/widgets/rebuyMonetize.ts
|
|
5113
|
-
var
|
|
5114
|
-
var RebuyMonetize =
|
|
5115
|
-
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)
|
|
5116
5165
|
});
|
|
5117
|
-
var RebuyMonetizeV1 =
|
|
5118
|
-
name:
|
|
5119
|
-
previewMode:
|
|
5166
|
+
var RebuyMonetizeV1 = import_zod100.z.object({
|
|
5167
|
+
name: import_zod100.z.string().nullable().optional(),
|
|
5168
|
+
previewMode: import_zod100.z.boolean().optional(),
|
|
5120
5169
|
/** Privacy Policy footer href → the marker section's `privacyPolicyUrl`. */
|
|
5121
|
-
privacyPolicyUrl:
|
|
5170
|
+
privacyPolicyUrl: import_zod100.z.string().nullable().optional(),
|
|
5122
5171
|
/** Ads-taxonomy sub-vertical id — one of the admin Monetize editor's two configurables. */
|
|
5123
|
-
subVertical:
|
|
5124
|
-
tracking:
|
|
5125
|
-
enableAttribution:
|
|
5126
|
-
enableSource:
|
|
5127
|
-
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()
|
|
5128
5177
|
}).optional(),
|
|
5129
|
-
type:
|
|
5130
|
-
version:
|
|
5178
|
+
type: import_zod100.z.literal(WidgetType.ui_extension_ad).default(WidgetType.ui_extension_ad),
|
|
5179
|
+
version: import_zod100.z.literal(1),
|
|
5131
5180
|
/** Ads-taxonomy vertical id — one of the admin Monetize editor's two configurables. */
|
|
5132
|
-
vertical:
|
|
5181
|
+
vertical: import_zod100.z.string().nullable().optional()
|
|
5133
5182
|
});
|
|
5134
5183
|
|
|
5135
5184
|
// src/schema/widgetData.ts
|
|
@@ -5143,7 +5192,7 @@ var extensionWidgetTypes = [
|
|
|
5143
5192
|
WidgetType.ui_extension_line_item_editor,
|
|
5144
5193
|
WidgetType.ui_extension_progress_bar
|
|
5145
5194
|
];
|
|
5146
|
-
var WidgetData =
|
|
5195
|
+
var WidgetData = import_zod101.z.discriminatedUnion("type", [
|
|
5147
5196
|
ABTestingPlaceholder,
|
|
5148
5197
|
CheckoutExtension,
|
|
5149
5198
|
ContentBlock,
|
|
@@ -5503,36 +5552,36 @@ var SWITCH_LABELS = {
|
|
|
5503
5552
|
};
|
|
5504
5553
|
|
|
5505
5554
|
// src/schema/widgets/post-purchase-offer/postPurchaseOffer.ts
|
|
5506
|
-
var
|
|
5555
|
+
var import_zod103 = require("zod");
|
|
5507
5556
|
|
|
5508
5557
|
// src/schema/widgets/post-purchase-offer/postPurchaseWidget.ts
|
|
5509
|
-
var
|
|
5510
|
-
var PostPurchaseWidgetLinkedFlow =
|
|
5511
|
-
id:
|
|
5512
|
-
name:
|
|
5513
|
-
});
|
|
5514
|
-
var PostPurchaseWidget =
|
|
5515
|
-
classification:
|
|
5516
|
-
createdAtTime:
|
|
5517
|
-
customEndpointName:
|
|
5518
|
-
id:
|
|
5519
|
-
lastViewed:
|
|
5520
|
-
linkedCustomEndpointId:
|
|
5521
|
-
linkedFlows:
|
|
5522
|
-
name:
|
|
5523
|
-
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(),
|
|
5524
5573
|
settings: PostPurchaseSettings
|
|
5525
5574
|
});
|
|
5526
5575
|
|
|
5527
5576
|
// src/schema/widgets/post-purchase-offer/postPurchaseOffer.ts
|
|
5528
|
-
var PostPurchaseOffer =
|
|
5529
|
-
|
|
5530
|
-
errors:
|
|
5531
|
-
message:
|
|
5532
|
-
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)
|
|
5533
5582
|
}),
|
|
5534
|
-
|
|
5535
|
-
successful:
|
|
5583
|
+
import_zod103.z.strictObject({
|
|
5584
|
+
successful: import_zod103.z.literal(true),
|
|
5536
5585
|
widget: PostPurchaseWidget
|
|
5537
5586
|
})
|
|
5538
5587
|
]);
|
|
@@ -6035,21 +6084,26 @@ var buildOfferTemplate = ({ location: location2, name } = {}) => CABRootSection.
|
|
|
6035
6084
|
type: SHOPIFY_CHECKOUT_EXTENSION
|
|
6036
6085
|
});
|
|
6037
6086
|
|
|
6038
|
-
// src/transforms/
|
|
6039
|
-
var
|
|
6040
|
-
|
|
6041
|
-
|
|
6042
|
-
|
|
6043
|
-
|
|
6044
|
-
var
|
|
6045
|
-
|
|
6046
|
-
|
|
6047
|
-
|
|
6048
|
-
|
|
6049
|
-
|
|
6050
|
-
|
|
6051
|
-
|
|
6052
|
-
|
|
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 = () => ({
|
|
6053
6107
|
content: [
|
|
6054
6108
|
{
|
|
6055
6109
|
content: [
|
|
@@ -6075,6 +6129,64 @@ var buildPriceContent = () => ({
|
|
|
6075
6129
|
],
|
|
6076
6130
|
type: "doc"
|
|
6077
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
|
+
};
|
|
6078
6190
|
var buildReviews = (settings) => {
|
|
6079
6191
|
if (!settings.integrations || !Object.values(settings.integrations).some(Boolean)) return [];
|
|
6080
6192
|
const reviews = settings.displaySettings?.reviews;
|
|
@@ -6116,29 +6228,11 @@ var buildTitle = (settings) => ({
|
|
|
6116
6228
|
},
|
|
6117
6229
|
sectionType: "text"
|
|
6118
6230
|
});
|
|
6119
|
-
var buildPrice = () => ({
|
|
6120
|
-
content: { en: buildPriceContent() },
|
|
6121
|
-
sectionType: "text"
|
|
6122
|
-
});
|
|
6123
6231
|
var HAS_VARIANT_TITLE = "hasVariantTitle";
|
|
6124
6232
|
var buildVariantTitle = (settings) => {
|
|
6125
6233
|
const show = settings.productOptions?.showVariantTitle;
|
|
6126
6234
|
if (!show || show === "hide") return [];
|
|
6127
|
-
return [
|
|
6128
|
-
{
|
|
6129
|
-
content: { en: buildStyledText("{{variantTitle}}", settings.displaySettings?.variant) },
|
|
6130
|
-
mutators: [
|
|
6131
|
-
{ effect: "set_false", variable: HAS_VARIANT_TITLE, when: { operator: "is_empty", type: "content" } },
|
|
6132
|
-
{
|
|
6133
|
-
effect: "set_true",
|
|
6134
|
-
variable: HAS_VARIANT_TITLE,
|
|
6135
|
-
when: { operator: "is_not_empty", type: "content" }
|
|
6136
|
-
}
|
|
6137
|
-
],
|
|
6138
|
-
sectionType: "text",
|
|
6139
|
-
visibility: { variable: HAS_VARIANT_TITLE, visibleWhen: true }
|
|
6140
|
-
}
|
|
6141
|
-
];
|
|
6235
|
+
return [earnedText(HAS_VARIANT_TITLE, buildStyledText("{{variantTitle}}", settings.displaySettings?.variant))];
|
|
6142
6236
|
};
|
|
6143
6237
|
var detailBlock = (sections, horizontal, hasVariantTitleLine) => ({
|
|
6144
6238
|
alignment: { horizontal: horizontal ? "start" : "center", vertical: "top" },
|
|
@@ -6167,18 +6261,7 @@ var buildDescription = (settings) => {
|
|
|
6167
6261
|
},
|
|
6168
6262
|
{
|
|
6169
6263
|
content: { en: buildStyledText("{{productDescription}}", void 0) },
|
|
6170
|
-
mutators:
|
|
6171
|
-
{
|
|
6172
|
-
effect: "set_false",
|
|
6173
|
-
variable: HAS_DESCRIPTION,
|
|
6174
|
-
when: { operator: "is_empty", type: "content" }
|
|
6175
|
-
},
|
|
6176
|
-
{
|
|
6177
|
-
effect: "set_true",
|
|
6178
|
-
variable: HAS_DESCRIPTION,
|
|
6179
|
-
when: { operator: "is_not_empty", type: "content" }
|
|
6180
|
-
}
|
|
6181
|
-
],
|
|
6264
|
+
mutators: earnedFrom(HAS_DESCRIPTION),
|
|
6182
6265
|
sectionType: "text",
|
|
6183
6266
|
visibility: { variable: SHOW_DESCRIPTION, visibleWhen: true }
|
|
6184
6267
|
}
|
|
@@ -6194,7 +6277,7 @@ var buildDescription = (settings) => {
|
|
|
6194
6277
|
var SHOW_VARIANTS = "showVariants";
|
|
6195
6278
|
var REVEAL_PENDING = "revealPending";
|
|
6196
6279
|
var revealsVariants = (settings) => settings.viewOptions?.displayActions !== false && settings.productOptions?.showVariantOptions === "default";
|
|
6197
|
-
var
|
|
6280
|
+
var contentMutator2 = (effect, variable, operator) => ({
|
|
6198
6281
|
effect,
|
|
6199
6282
|
variable,
|
|
6200
6283
|
when: { operator, type: "content" }
|
|
@@ -6208,10 +6291,10 @@ var buildVariants = (settings) => {
|
|
|
6208
6291
|
hideOutOfStockVariants: !!settings.productOptions?.hideOutOfStockVariants,
|
|
6209
6292
|
...revealsVariants(settings) && {
|
|
6210
6293
|
mutators: [
|
|
6211
|
-
|
|
6212
|
-
|
|
6213
|
-
|
|
6214
|
-
|
|
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")
|
|
6215
6298
|
]
|
|
6216
6299
|
},
|
|
6217
6300
|
...selector && { selector: VARIANT_SELECTOR[selector] },
|
|
@@ -6236,43 +6319,20 @@ var buildQuantityErrors = (quantity2) => {
|
|
|
6236
6319
|
var buildQuantity = (settings) => {
|
|
6237
6320
|
const quantity2 = settings.quantityInputs;
|
|
6238
6321
|
if (!quantity2?.enabled) return [];
|
|
6239
|
-
const
|
|
6240
|
-
const max = Math.min(Math.max(quantity2.maxValue ?? 10, 1), 100);
|
|
6241
|
-
const min = Math.min(Math.max(quantity2.minValue ?? 1, 1), max);
|
|
6322
|
+
const errors = buildQuantityErrors(quantity2);
|
|
6242
6323
|
return [
|
|
6243
|
-
{
|
|
6244
|
-
...
|
|
6245
|
-
|
|
6246
|
-
|
|
6247
|
-
|
|
6248
|
-
|
|
6249
|
-
}
|
|
6250
|
-
];
|
|
6251
|
-
};
|
|
6252
|
-
var buildSubscriptionButton = (settings) => {
|
|
6253
|
-
if (settings.productType !== "both" && settings.productType !== "subscription") return [];
|
|
6254
|
-
const language3 = settings.language;
|
|
6255
|
-
const slot = (buttonField, override) => ({
|
|
6256
|
-
buttonField,
|
|
6257
|
-
content: localizedContent(SWITCH_LABELS[buttonField], override, SWITCH_LABEL_TOKENS),
|
|
6258
|
-
sectionType: "text"
|
|
6259
|
-
});
|
|
6260
|
-
return [
|
|
6261
|
-
{
|
|
6262
|
-
action: "switchToSubscription",
|
|
6263
|
-
buttonStyle: "plain",
|
|
6264
|
-
/** A `subscription` widget offers no one-time purchase (legacy's offers checkbox renders only when `isProductTypeBoth`); suppress the downgrade so the buyer can't switch to one-time on a subscription-only offer. */
|
|
6265
|
-
...settings.productType === "subscription" && { disableDowngrade: true },
|
|
6266
|
-
sections: [
|
|
6267
|
-
slot("subscriptionOption", void 0),
|
|
6268
|
-
slot("switchToOneTimePurchase", language3?.cartSwitchToOnetime),
|
|
6269
|
-
slot("switchToSubscriptionNoDiscount", language3?.upgradeToSubscription),
|
|
6270
|
-
slot("switchToSubscriptionWithDiscount", language3?.upgradeToSubscription)
|
|
6271
|
-
],
|
|
6272
|
-
sectionType: "button"
|
|
6273
|
-
}
|
|
6324
|
+
quantitySection({
|
|
6325
|
+
...errors,
|
|
6326
|
+
inputType: quantity2.type ? QUANTITY_INPUT_TYPE[quantity2.type] : void 0,
|
|
6327
|
+
maxValue: quantity2.maxValue,
|
|
6328
|
+
minValue: quantity2.minValue
|
|
6329
|
+
})
|
|
6274
6330
|
];
|
|
6275
6331
|
};
|
|
6332
|
+
var buildSubscriptionButton = (settings) => subscriptionToggle(settings.productType, {
|
|
6333
|
+
oneTime: settings.language?.cartSwitchToOnetime,
|
|
6334
|
+
upgrade: settings.language?.upgradeToSubscription
|
|
6335
|
+
});
|
|
6276
6336
|
var BUTTON_KINDS = ["plain", "primary", "secondary"];
|
|
6277
6337
|
var buttonKind = (settings) => {
|
|
6278
6338
|
const kind = settings.button?.kind;
|
|
@@ -6318,7 +6378,7 @@ var buildOfferCard = (settings, horizontal) => {
|
|
|
6318
6378
|
const image = buildImage(settings);
|
|
6319
6379
|
const title = buildTitle(settings);
|
|
6320
6380
|
const variantTitle = buildVariantTitle(settings);
|
|
6321
|
-
const price =
|
|
6381
|
+
const price = priceText();
|
|
6322
6382
|
const description = buildDescription(settings);
|
|
6323
6383
|
const reviews = buildReviews(settings);
|
|
6324
6384
|
const variants = buildVariants(settings);
|
|
@@ -6731,28 +6791,86 @@ var postPurchaseCosts = (prepared, response, currencyCode) => {
|
|
|
6731
6791
|
});
|
|
6732
6792
|
};
|
|
6733
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
|
+
|
|
6734
6842
|
// src/pricing/postPurchaseSubscriptionDisplay.ts
|
|
6735
6843
|
var postPurchaseSubscriptionDisplay = (prepared, currencyCode) => {
|
|
6736
6844
|
const subscription = readPostPurchaseSubscription(prepared);
|
|
6737
6845
|
if (!subscription) return void 0;
|
|
6738
|
-
const
|
|
6739
|
-
const variant2 = subscription.product.variant;
|
|
6740
|
-
const regular = amountToCents2(variant2.price, decimals);
|
|
6741
|
-
const compareAt = amountToCents2(variant2.compareAtPrice, decimals);
|
|
6742
|
-
const comparisonMinor = subscription.display.discountedFrom === "compare_at_price" && compareAt > regular ? compareAt : regular;
|
|
6743
|
-
const adjustment = subscription.terms.subscription.adjustment;
|
|
6744
|
-
const reduce = (price, discount) => {
|
|
6745
|
-
const reduction = discount.type === "percentage" ? Math.round(price * discount.amount / 100) : discount.type === "fixed_amount" ? amountToCents2(discount.amount, decimals) : 0;
|
|
6746
|
-
return Math.max(0, price - reduction);
|
|
6747
|
-
};
|
|
6748
|
-
const planPrice = adjustment?.type === "price" ? amountToCents2(adjustment.amount, decimals) : adjustment ? reduce(regular, { amount: adjustment.amount, type: adjustment.type }) : regular;
|
|
6749
|
-
const priceMinor = reduce(planPrice, subscription.terms.discount);
|
|
6750
|
-
const savingMinor = Math.max(0, comparisonMinor - priceMinor);
|
|
6846
|
+
const { compareAtPrice, price } = subscription.product.variant;
|
|
6751
6847
|
return PostPurchaseSubscriptionDisplay.parse({
|
|
6752
|
-
|
|
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,
|
|
6753
6866
|
currencyCode,
|
|
6754
|
-
|
|
6755
|
-
|
|
6756
|
-
|
|
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) }
|
|
6757
6875
|
});
|
|
6758
6876
|
};
|