@rebuy/rebuy 3.66.1 → 3.67.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +812 -784
- package/dist/index.mjs +812 -784
- package/dist/schema/cabShopConfig.d.ts +5 -5
- package/dist/schema/index.d.ts +1 -0
- package/dist/schema/postPurchaseDecisionTrace.d.ts +90 -0
- package/dist/schema/postPurchaseShadow.d.ts +33 -7
- package/dist/schema/smartCart.d.ts +18 -18
- package/dist/schema/userConfig.d.ts +5 -5
- package/package.json +7 -1
package/dist/index.cjs
CHANGED
|
@@ -189,6 +189,8 @@ __export(src_exports, {
|
|
|
189
189
|
PostPurchaseChoice: () => PostPurchaseChoice,
|
|
190
190
|
PostPurchaseCollectionChoice: () => PostPurchaseCollectionChoice,
|
|
191
191
|
PostPurchaseCommonReviewRating: () => PostPurchaseCommonReviewRating,
|
|
192
|
+
PostPurchaseDecisionTimingSchema: () => PostPurchaseDecisionTimingSchema,
|
|
193
|
+
PostPurchaseDecisionTraceSchema: () => PostPurchaseDecisionTraceSchema,
|
|
192
194
|
PostPurchaseDiscount: () => PostPurchaseDiscount,
|
|
193
195
|
PostPurchaseDisplayPrice: () => PostPurchaseDisplayPrice,
|
|
194
196
|
PostPurchaseEndReasonSchema: () => PostPurchaseEndReasonSchema,
|
|
@@ -3139,19 +3141,111 @@ var ClassificationProgressSchema = import_zod30.z.union([
|
|
|
3139
3141
|
import_zod30.z.strictObject({ status: import_zod30.z.literal("unavailable") })
|
|
3140
3142
|
]).nullable();
|
|
3141
3143
|
|
|
3142
|
-
// src/schema/
|
|
3144
|
+
// src/schema/postPurchaseDecisionTrace.ts
|
|
3143
3145
|
var import_zod34 = require("zod");
|
|
3144
3146
|
|
|
3145
|
-
// src/schema/
|
|
3147
|
+
// src/schema/postPurchaseShadow.ts
|
|
3148
|
+
var import_zod33 = require("zod");
|
|
3149
|
+
|
|
3150
|
+
// src/schema/postPurchaseSkipTrace.ts
|
|
3146
3151
|
var import_zod32 = require("zod");
|
|
3147
3152
|
|
|
3148
|
-
// src/schema/
|
|
3153
|
+
// src/schema/postPurchaseEligibility.ts
|
|
3149
3154
|
var import_zod31 = require("zod");
|
|
3150
|
-
var
|
|
3155
|
+
var PostPurchaseSkipReasonSchema = import_zod31.z.enum(["empty", "no-eligible-subscription"]);
|
|
3156
|
+
|
|
3157
|
+
// src/schema/postPurchaseSkipTrace.ts
|
|
3158
|
+
var POST_PURCHASE_SKIP_LIMIT = 32;
|
|
3159
|
+
var PostPurchaseSkipTraceSchema = import_zod32.z.array(
|
|
3160
|
+
import_zod32.z.object({
|
|
3161
|
+
entry: DecisionEntrySchema,
|
|
3162
|
+
reason: PostPurchaseSkipReasonSchema
|
|
3163
|
+
})
|
|
3164
|
+
).max(POST_PURCHASE_SKIP_LIMIT);
|
|
3165
|
+
|
|
3166
|
+
// src/schema/postPurchaseShadow.ts
|
|
3167
|
+
var PostPurchaseShadowSelectionSchema = import_zod33.z.discriminatedUnion("verdict", [
|
|
3168
|
+
import_zod33.z.object({ entry: DecisionEntrySchema, verdict: import_zod33.z.literal("render") }),
|
|
3169
|
+
import_zod33.z.object({ verdict: import_zod33.z.literal("skip") })
|
|
3170
|
+
]);
|
|
3171
|
+
var PostPurchaseShadowSkipReasonSchema = import_zod33.z.enum([
|
|
3172
|
+
"destination-missing",
|
|
3173
|
+
"merchant-destination",
|
|
3174
|
+
"merchant-time",
|
|
3175
|
+
"no-active-flows",
|
|
3176
|
+
"no-eligible-flow",
|
|
3177
|
+
"prelude-timeout"
|
|
3178
|
+
]);
|
|
3179
|
+
var PostPurchaseShadowFlowOutcomesSchema = import_zod33.z.array(
|
|
3180
|
+
import_zod33.z.object({
|
|
3181
|
+
flowId: import_zod33.z.number().int().positive(),
|
|
3182
|
+
incomplete: import_zod33.z.literal(true).optional(),
|
|
3183
|
+
ms: import_zod33.z.number().int().nonnegative().optional(),
|
|
3184
|
+
outcome: import_zod33.z.enum(["eligible", "empty", "failed", "unsupported"]),
|
|
3185
|
+
unpreparableCause: import_zod33.z.enum(["contract", "members", "offer"]).optional()
|
|
3186
|
+
})
|
|
3187
|
+
).max(POST_PURCHASE_SKIP_LIMIT);
|
|
3188
|
+
var PostPurchaseShadowReportFields = import_zod33.z.object({
|
|
3189
|
+
differences: import_zod33.z.array(import_zod33.z.enum(["verdict", "entry", "targeting", "incomplete-capture", "unsupported-configuration"])).refine((differences) => new Set(differences).size === differences.length, {
|
|
3190
|
+
message: "differences must not contain duplicate entries"
|
|
3191
|
+
}),
|
|
3192
|
+
legacySelection: PostPurchaseShadowSelectionSchema,
|
|
3193
|
+
phase: import_zod33.z.literal("shouldRender"),
|
|
3194
|
+
sampleId: import_zod33.z.string(),
|
|
3195
|
+
/** Optional so rows and senders from before REB-25425 stay valid; never part of the classification. */
|
|
3196
|
+
serverFlowOutcomes: PostPurchaseShadowFlowOutcomesSchema.optional(),
|
|
3197
|
+
serverSelection: PostPurchaseShadowSelectionSchema.optional(),
|
|
3198
|
+
/**
|
|
3199
|
+
* Set by the sender when the Decider skipped, `incomplete` reports included (which carry no
|
|
3200
|
+
* `serverSelection`). Not validated against `serverSelection`, and never part of the classification.
|
|
3201
|
+
*/
|
|
3202
|
+
serverSkipReason: PostPurchaseShadowSkipReasonSchema.optional(),
|
|
3203
|
+
status: import_zod33.z.enum(["match", "diverged", "incomplete"]),
|
|
3204
|
+
targetingFlowIds: import_zod33.z.array(import_zod33.z.number().int().positive()),
|
|
3205
|
+
workflowPhase: import_zod33.z.literal("decide")
|
|
3206
|
+
});
|
|
3207
|
+
var PostPurchaseShadowReportSchema = PostPurchaseShadowReportFields.refine(
|
|
3208
|
+
(report) => report.status !== "match" || report.differences.length === 0,
|
|
3209
|
+
{ message: "status 'match' requires an empty differences array", path: ["status"] }
|
|
3210
|
+
).refine((report) => report.status !== "diverged" || report.differences.length > 0, {
|
|
3211
|
+
message: "status 'diverged' requires a non-empty differences array",
|
|
3212
|
+
path: ["status"]
|
|
3213
|
+
}).refine((report) => report.status !== "diverged" || report.serverSelection !== void 0, {
|
|
3214
|
+
message: "status 'diverged' requires a serverSelection to diverge from",
|
|
3215
|
+
path: ["status"]
|
|
3216
|
+
});
|
|
3217
|
+
|
|
3218
|
+
// src/schema/postPurchaseDecisionTrace.ts
|
|
3219
|
+
var PostPurchaseDecisionTimingSchema = import_zod34.z.object({
|
|
3220
|
+
activeFlowsMs: import_zod34.z.number().int().nonnegative().optional(),
|
|
3221
|
+
decisionMs: import_zod34.z.number().int().nonnegative(),
|
|
3222
|
+
preludeMs: import_zod34.z.number().int().nonnegative().optional(),
|
|
3223
|
+
targetingMs: import_zod34.z.number().int().nonnegative().optional()
|
|
3224
|
+
});
|
|
3225
|
+
var TraceEvidence = {
|
|
3226
|
+
flowCount: import_zod34.z.number().int().nonnegative(),
|
|
3227
|
+
sampleRate: import_zod34.z.number().gt(0).max(1),
|
|
3228
|
+
serverFlowOutcomes: PostPurchaseShadowFlowOutcomesSchema,
|
|
3229
|
+
timing: PostPurchaseDecisionTimingSchema
|
|
3230
|
+
};
|
|
3231
|
+
var PostPurchaseDecisionTraceSchema = import_zod34.z.discriminatedUnion("verdict", [
|
|
3232
|
+
import_zod34.z.object({ ...TraceEvidence, entry: DecisionEntrySchema, verdict: import_zod34.z.literal("render") }),
|
|
3233
|
+
import_zod34.z.object({ ...TraceEvidence, serverSkipReason: PostPurchaseShadowSkipReasonSchema, verdict: import_zod34.z.literal("skip") })
|
|
3234
|
+
]);
|
|
3235
|
+
|
|
3236
|
+
// src/schema/postPurchaseDecline.ts
|
|
3237
|
+
var import_zod38 = require("zod");
|
|
3238
|
+
|
|
3239
|
+
// src/schema/postPurchaseProgress.ts
|
|
3240
|
+
var import_zod36 = require("zod");
|
|
3241
|
+
|
|
3242
|
+
// src/schema/postPurchaseDeclineDelivery.ts
|
|
3243
|
+
var import_zod35 = require("zod");
|
|
3244
|
+
var AttemptSchema = import_zod35.z.strictObject({
|
|
3151
3245
|
attemptedAt: PostPurchaseTimestampSchema,
|
|
3152
|
-
status:
|
|
3246
|
+
status: import_zod35.z.enum(["attempted", "unavailable"])
|
|
3153
3247
|
});
|
|
3154
|
-
var DeclineDeliveryProgressSchema =
|
|
3248
|
+
var DeclineDeliveryProgressSchema = import_zod35.z.union([
|
|
3155
3249
|
AttemptSchema,
|
|
3156
3250
|
AttemptSchema.extend({
|
|
3157
3251
|
finishedAt: PostPurchaseTimestampSchema,
|
|
@@ -3160,42 +3254,42 @@ var DeclineDeliveryProgressSchema = import_zod31.z.union([
|
|
|
3160
3254
|
]);
|
|
3161
3255
|
|
|
3162
3256
|
// src/schema/postPurchaseProgress.ts
|
|
3163
|
-
var PostPurchaseProgressSchema =
|
|
3257
|
+
var PostPurchaseProgressSchema = import_zod36.z.object({
|
|
3164
3258
|
closedAt: PostPurchaseTimestampSchema.nullable(),
|
|
3165
3259
|
deadline: PostPurchaseTimestampSchema,
|
|
3166
3260
|
entry: DecisionEntrySchema,
|
|
3167
|
-
entryRevision:
|
|
3168
|
-
members:
|
|
3261
|
+
entryRevision: import_zod36.z.number().int().nonnegative(),
|
|
3262
|
+
members: import_zod36.z.array(
|
|
3169
3263
|
PostPurchaseMemberIdentity.extend({
|
|
3170
3264
|
declineDelivery: DeclineDeliveryProgressSchema.optional(),
|
|
3171
|
-
status:
|
|
3265
|
+
status: import_zod36.z.enum(["unhandled", "accepted", "declined"])
|
|
3172
3266
|
}).strict()
|
|
3173
3267
|
),
|
|
3174
|
-
revision:
|
|
3268
|
+
revision: import_zod36.z.number().int().nonnegative()
|
|
3175
3269
|
}).strict();
|
|
3176
3270
|
|
|
3177
3271
|
// src/schema/postPurchaseVariantCatalog.ts
|
|
3178
|
-
var
|
|
3179
|
-
var PostPurchaseVariantSelector =
|
|
3272
|
+
var import_zod37 = require("zod");
|
|
3273
|
+
var PostPurchaseVariantSelector = import_zod37.z.object({ variantId: PostPurchaseVariantId }).strict();
|
|
3180
3274
|
var PostPurchaseVariantOption = OfferProduct.shape.options.element.extend({
|
|
3181
|
-
id:
|
|
3182
|
-
position:
|
|
3275
|
+
id: import_zod37.z.number().int().positive().optional(),
|
|
3276
|
+
position: import_zod37.z.number().int().min(1).max(3)
|
|
3183
3277
|
});
|
|
3184
3278
|
var PostPurchaseVariantValues = OfferProduct.shape.variants.element.pick({
|
|
3185
3279
|
option1: true,
|
|
3186
3280
|
option2: true,
|
|
3187
3281
|
option3: true
|
|
3188
3282
|
});
|
|
3189
|
-
var PostPurchaseVariantCatalog =
|
|
3283
|
+
var PostPurchaseVariantCatalog = import_zod37.z.object({
|
|
3190
3284
|
displayMode: PostPurchaseSettings.shape.productOptions.shape.variantSelectorDisplayMode,
|
|
3191
|
-
options:
|
|
3285
|
+
options: import_zod37.z.array(PostPurchaseVariantOption),
|
|
3192
3286
|
productId: PostPurchaseProductId,
|
|
3193
3287
|
showSelectors: PostPurchaseSettings.shape.productOptions.shape.showVariantSelectors,
|
|
3194
|
-
variants:
|
|
3288
|
+
variants: import_zod37.z.array(
|
|
3195
3289
|
PostPurchaseVariantValues.partial().extend({
|
|
3196
|
-
available:
|
|
3290
|
+
available: import_zod37.z.boolean(),
|
|
3197
3291
|
id: PostPurchaseVariantId,
|
|
3198
|
-
imageId:
|
|
3292
|
+
imageId: import_zod37.z.number().int().nonnegative().nullish(),
|
|
3199
3293
|
title: OfferProduct.shape.variants.element.shape.title
|
|
3200
3294
|
})
|
|
3201
3295
|
)
|
|
@@ -3213,30 +3307,30 @@ var OfferDeclineRequestSchema = DecideRequestSchema.extend({
|
|
|
3213
3307
|
"Selected merchandise requires a variant"
|
|
3214
3308
|
);
|
|
3215
3309
|
var RecordedOfferDeclineSchema = PostPurchaseProgressSchema.shape.members.element.omit({ declineDelivery: true, status: true }).extend({ entry: DecisionEntrySchema.strict(), entryRevision: PostPurchaseProgressSchema.shape.entryRevision }).strict();
|
|
3216
|
-
var OfferDeclineResponseSchema =
|
|
3217
|
-
data:
|
|
3218
|
-
successful:
|
|
3310
|
+
var OfferDeclineResponseSchema = import_zod38.z.object({
|
|
3311
|
+
data: import_zod38.z.object({ decline: RecordedOfferDeclineSchema, progress: PostPurchaseProgressSchema }),
|
|
3312
|
+
successful: import_zod38.z.literal(true)
|
|
3219
3313
|
});
|
|
3220
3314
|
|
|
3221
3315
|
// src/schema/postPurchaseDisplayPrice.ts
|
|
3222
|
-
var
|
|
3316
|
+
var import_zod40 = require("zod");
|
|
3223
3317
|
|
|
3224
3318
|
// src/schema/postPurchaseSubscriptionDisplay.ts
|
|
3225
|
-
var
|
|
3226
|
-
var Minor2 =
|
|
3227
|
-
var PostPurchaseSubscriptionDisplay =
|
|
3319
|
+
var import_zod39 = require("zod");
|
|
3320
|
+
var Minor2 = import_zod39.z.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER);
|
|
3321
|
+
var PostPurchaseSubscriptionDisplay = import_zod39.z.object({
|
|
3228
3322
|
comparisonMinor: Minor2,
|
|
3229
|
-
currencyCode:
|
|
3323
|
+
currencyCode: import_zod39.z.string().regex(/^[A-Z]{3}$/),
|
|
3230
3324
|
priceMinor: Minor2,
|
|
3231
3325
|
savingMinor: Minor2,
|
|
3232
|
-
savingPercent:
|
|
3326
|
+
savingPercent: import_zod39.z.number().int().min(0).max(100)
|
|
3233
3327
|
});
|
|
3234
3328
|
|
|
3235
3329
|
// src/schema/postPurchaseDisplayPrice.ts
|
|
3236
3330
|
var { currencyCode: CurrencyCode, priceMinor: Minor3, savingPercent: Percent } = PostPurchaseSubscriptionDisplay.shape;
|
|
3237
|
-
var PostPurchaseDisplayPrice =
|
|
3331
|
+
var PostPurchaseDisplayPrice = import_zod40.z.object({
|
|
3238
3332
|
currencyCode: CurrencyCode,
|
|
3239
|
-
savingFormat:
|
|
3333
|
+
savingFormat: import_zod40.z.enum(["amount", "percent"]).nullable(),
|
|
3240
3334
|
savingMinor: Minor3,
|
|
3241
3335
|
savingPercent: Percent,
|
|
3242
3336
|
subscriptionUnit: PostPurchaseSubscriptionDisplay.optional(),
|
|
@@ -3253,85 +3347,81 @@ var PostPurchaseDisplayPrice = import_zod36.z.object({
|
|
|
3253
3347
|
"The subscription unit estimate restates the plan facts in the same currency"
|
|
3254
3348
|
);
|
|
3255
3349
|
|
|
3256
|
-
// src/schema/postPurchaseEligibility.ts
|
|
3257
|
-
var import_zod37 = require("zod");
|
|
3258
|
-
var PostPurchaseSkipReasonSchema = import_zod37.z.enum(["empty", "no-eligible-subscription"]);
|
|
3259
|
-
|
|
3260
3350
|
// src/schema/postPurchaseExitPolicy.ts
|
|
3261
|
-
var
|
|
3351
|
+
var import_zod41 = require("zod");
|
|
3262
3352
|
var EXIT_DELAY_MAX_MS = 60 * 60 * 1e3;
|
|
3263
|
-
var ExitPolicySchema =
|
|
3264
|
-
|
|
3265
|
-
|
|
3266
|
-
delayMs:
|
|
3267
|
-
source:
|
|
3268
|
-
status:
|
|
3353
|
+
var ExitPolicySchema = import_zod41.z.discriminatedUnion("status", [
|
|
3354
|
+
import_zod41.z.strictObject({ status: import_zod41.z.literal("unavailable") }),
|
|
3355
|
+
import_zod41.z.strictObject({
|
|
3356
|
+
delayMs: import_zod41.z.number().int().nonnegative().max(EXIT_DELAY_MAX_MS),
|
|
3357
|
+
source: import_zod41.z.enum(["admitted", "selected-flow"]),
|
|
3358
|
+
status: import_zod41.z.literal("available")
|
|
3269
3359
|
})
|
|
3270
3360
|
]);
|
|
3271
3361
|
|
|
3272
3362
|
// src/schema/postPurchaseFinish.ts
|
|
3273
|
-
var
|
|
3363
|
+
var import_zod49 = require("zod");
|
|
3274
3364
|
|
|
3275
3365
|
// src/schema/postPurchaseFollowups.ts
|
|
3276
|
-
var
|
|
3366
|
+
var import_zod46 = require("zod");
|
|
3277
3367
|
|
|
3278
3368
|
// src/schema/postPurchaseHealthProgress.ts
|
|
3279
|
-
var
|
|
3369
|
+
var import_zod43 = require("zod");
|
|
3280
3370
|
|
|
3281
3371
|
// src/schema/postPurchaseReleaseAuthority.ts
|
|
3282
|
-
var
|
|
3283
|
-
var PostPurchaseSessionIdSchema =
|
|
3284
|
-
var ReleaseOwnerSchema =
|
|
3285
|
-
var ReleaseAuthorityRequestSchema =
|
|
3372
|
+
var import_zod42 = require("zod");
|
|
3373
|
+
var PostPurchaseSessionIdSchema = import_zod42.z.string().regex(/^[a-f0-9]{64}$/);
|
|
3374
|
+
var ReleaseOwnerSchema = import_zod42.z.enum(["rebuy", "shopify"]);
|
|
3375
|
+
var ReleaseAuthorityRequestSchema = import_zod42.z.strictObject({
|
|
3286
3376
|
orderId: PostPurchaseOrderIdSchema,
|
|
3287
3377
|
shop: ShopifyDomainSchema
|
|
3288
3378
|
});
|
|
3289
|
-
var ReadyReleaseAuthoritySchema =
|
|
3379
|
+
var ReadyReleaseAuthoritySchema = import_zod42.z.object({
|
|
3290
3380
|
deadline: PostPurchaseTimestampSchema,
|
|
3291
3381
|
releaseOwner: ReleaseOwnerSchema,
|
|
3292
3382
|
sessionId: PostPurchaseSessionIdSchema,
|
|
3293
|
-
status:
|
|
3383
|
+
status: import_zod42.z.literal("ready")
|
|
3294
3384
|
});
|
|
3295
|
-
var PendingReleaseAuthoritySchema =
|
|
3296
|
-
var ReleaseAuthorityResponseSchema =
|
|
3297
|
-
data:
|
|
3298
|
-
|
|
3385
|
+
var PendingReleaseAuthoritySchema = import_zod42.z.object({ status: import_zod42.z.literal("pending") });
|
|
3386
|
+
var ReleaseAuthorityResponseSchema = import_zod42.z.object({
|
|
3387
|
+
data: import_zod42.z.discriminatedUnion("status", [
|
|
3388
|
+
import_zod42.z.object({ status: import_zod42.z.literal("unknown") }),
|
|
3299
3389
|
PendingReleaseAuthoritySchema,
|
|
3300
3390
|
ReadyReleaseAuthoritySchema
|
|
3301
3391
|
]),
|
|
3302
|
-
successful:
|
|
3392
|
+
successful: import_zod42.z.literal(true)
|
|
3303
3393
|
});
|
|
3304
3394
|
|
|
3305
3395
|
// src/schema/postPurchaseHealthProgress.ts
|
|
3306
|
-
var HealthScheduleSchema =
|
|
3396
|
+
var HealthScheduleSchema = import_zod43.z.strictObject({
|
|
3307
3397
|
checkoutToken: DecideRequestSchema.shape.checkoutToken,
|
|
3308
3398
|
healthScheduledAt: PostPurchaseTimestampSchema,
|
|
3309
3399
|
operationId: PurchaseReceiptSchema.shape.operationId.regex(/^[a-f0-9-]{36}$/),
|
|
3310
3400
|
orderId: PostPurchaseOrderIdSchema,
|
|
3311
|
-
removePartialOrder:
|
|
3401
|
+
removePartialOrder: import_zod43.z.boolean(),
|
|
3312
3402
|
sessionId: PostPurchaseSessionIdSchema,
|
|
3313
3403
|
shop: DecideRequestSchema.shape.shop
|
|
3314
3404
|
});
|
|
3315
|
-
var HealthSchedulingResponseSchema =
|
|
3316
|
-
data:
|
|
3317
|
-
callbackStatus:
|
|
3405
|
+
var HealthSchedulingResponseSchema = import_zod43.z.object({
|
|
3406
|
+
data: import_zod43.z.object({
|
|
3407
|
+
callbackStatus: import_zod43.z.enum(["pending", "attempted", "returned", "unknown"]),
|
|
3318
3408
|
facts: HealthScheduleSchema,
|
|
3319
|
-
scheduling:
|
|
3320
|
-
|
|
3321
|
-
|
|
3409
|
+
scheduling: import_zod43.z.union([
|
|
3410
|
+
import_zod43.z.strictObject({ recordedAt: PostPurchaseTimestampSchema, status: import_zod43.z.literal("verified") }),
|
|
3411
|
+
import_zod43.z.strictObject({ status: import_zod43.z.enum(["unavailable", "unverified"]) })
|
|
3322
3412
|
])
|
|
3323
3413
|
}),
|
|
3324
|
-
successful:
|
|
3414
|
+
successful: import_zod43.z.literal(true)
|
|
3325
3415
|
});
|
|
3326
3416
|
|
|
3327
3417
|
// src/schema/postPurchaseObservation.ts
|
|
3328
|
-
var
|
|
3329
|
-
var PurchaseObservationSchema =
|
|
3330
|
-
|
|
3331
|
-
changesetApplicationsRemaining:
|
|
3332
|
-
errors:
|
|
3333
|
-
|
|
3334
|
-
code:
|
|
3418
|
+
var import_zod44 = require("zod");
|
|
3419
|
+
var PurchaseObservationSchema = import_zod44.z.union([
|
|
3420
|
+
import_zod44.z.object({
|
|
3421
|
+
changesetApplicationsRemaining: import_zod44.z.number().int().nonnegative(),
|
|
3422
|
+
errors: import_zod44.z.array(
|
|
3423
|
+
import_zod44.z.object({
|
|
3424
|
+
code: import_zod44.z.enum([
|
|
3335
3425
|
"payment_required",
|
|
3336
3426
|
"insufficient_inventory",
|
|
3337
3427
|
"changeset_already_applied",
|
|
@@ -3345,40 +3435,40 @@ var PurchaseObservationSchema = import_zod41.z.union([
|
|
|
3345
3435
|
"subscription_limit_error",
|
|
3346
3436
|
"order_released_error"
|
|
3347
3437
|
]),
|
|
3348
|
-
message:
|
|
3438
|
+
message: import_zod44.z.string()
|
|
3349
3439
|
}).strict()
|
|
3350
3440
|
),
|
|
3351
|
-
status:
|
|
3441
|
+
status: import_zod44.z.enum(["processed", "partially_processed", "unprocessed"])
|
|
3352
3442
|
}).strict(),
|
|
3353
|
-
|
|
3443
|
+
import_zod44.z.object({ reason: import_zod44.z.literal("application-error"), status: import_zod44.z.literal("unknown") }).strict()
|
|
3354
3444
|
]);
|
|
3355
|
-
var RecordedPurchaseObservationSchema =
|
|
3445
|
+
var RecordedPurchaseObservationSchema = import_zod44.z.object({
|
|
3356
3446
|
observation: PurchaseObservationSchema,
|
|
3357
3447
|
recordedAt: PostPurchaseTimestampSchema
|
|
3358
3448
|
}).strict();
|
|
3359
3449
|
var PurchaseObservationRequestSchema = DecideRequestSchema.extend({
|
|
3360
3450
|
observation: PurchaseObservationSchema,
|
|
3361
|
-
operationId:
|
|
3451
|
+
operationId: import_zod44.z.uuid()
|
|
3362
3452
|
}).strict();
|
|
3363
|
-
var PurchaseObservationResponseSchema =
|
|
3364
|
-
data: RecordedPurchaseObservationSchema.extend({ operationId:
|
|
3365
|
-
successful:
|
|
3453
|
+
var PurchaseObservationResponseSchema = import_zod44.z.object({
|
|
3454
|
+
data: RecordedPurchaseObservationSchema.extend({ operationId: import_zod44.z.uuid() }),
|
|
3455
|
+
successful: import_zod44.z.literal(true)
|
|
3366
3456
|
});
|
|
3367
3457
|
|
|
3368
3458
|
// src/schema/postPurchaseSts.ts
|
|
3369
|
-
var
|
|
3370
|
-
var AttemptSchema2 =
|
|
3459
|
+
var import_zod45 = require("zod");
|
|
3460
|
+
var AttemptSchema2 = import_zod45.z.strictObject({ attemptedAt: PostPurchaseTimestampSchema, status: import_zod45.z.literal("attempted") });
|
|
3371
3461
|
var FinishedSchema = AttemptSchema2.extend({ finishedAt: PostPurchaseTimestampSchema });
|
|
3372
|
-
var StsRefundProgressSchema =
|
|
3462
|
+
var StsRefundProgressSchema = import_zod45.z.union([
|
|
3373
3463
|
AttemptSchema2,
|
|
3374
|
-
FinishedSchema.extend({ refundId:
|
|
3375
|
-
FinishedSchema.extend({ status:
|
|
3464
|
+
FinishedSchema.extend({ refundId: import_zod45.z.string().min(1), status: import_zod45.z.literal("refunded") }),
|
|
3465
|
+
FinishedSchema.extend({ status: import_zod45.z.enum(["failed", "unknown"]) })
|
|
3376
3466
|
]);
|
|
3377
|
-
var StsCompensationProgressSchema =
|
|
3467
|
+
var StsCompensationProgressSchema = import_zod45.z.union([
|
|
3378
3468
|
AttemptSchema2,
|
|
3379
|
-
FinishedSchema.extend({ status:
|
|
3469
|
+
FinishedSchema.extend({ status: import_zod45.z.enum(["removed", "failed", "unknown"]) })
|
|
3380
3470
|
]);
|
|
3381
|
-
var StsReviewReasonSchema =
|
|
3471
|
+
var StsReviewReasonSchema = import_zod45.z.enum([
|
|
3382
3472
|
"refund-unknown",
|
|
3383
3473
|
"compensation-failed",
|
|
3384
3474
|
"compensation-unknown",
|
|
@@ -3387,7 +3477,7 @@ var StsReviewReasonSchema = import_zod42.z.enum([
|
|
|
3387
3477
|
"compensation-lost",
|
|
3388
3478
|
"refund-owed"
|
|
3389
3479
|
]);
|
|
3390
|
-
var StsReviewProgressSchema =
|
|
3480
|
+
var StsReviewProgressSchema = import_zod45.z.strictObject({
|
|
3391
3481
|
markedAt: PostPurchaseTimestampSchema,
|
|
3392
3482
|
marker: AcceptedMetafieldResultSchema.shape.status,
|
|
3393
3483
|
reason: StsReviewReasonSchema
|
|
@@ -3404,7 +3494,7 @@ var judgedReason = (refund, compensation) => {
|
|
|
3404
3494
|
if (compensation?.status === "attempted") return "compensation-lost";
|
|
3405
3495
|
return compensation?.status === "removed" ? "refund-owed" : null;
|
|
3406
3496
|
};
|
|
3407
|
-
var StsProgressSchema =
|
|
3497
|
+
var StsProgressSchema = import_zod45.z.strictObject({
|
|
3408
3498
|
compensation: StsCompensationProgressSchema.nullable(),
|
|
3409
3499
|
operationId: PurchaseReceiptSchema.shape.operationId,
|
|
3410
3500
|
refund: StsRefundProgressSchema.nullable(),
|
|
@@ -3419,15 +3509,15 @@ var StsProgressSchema = import_zod42.z.strictObject({
|
|
|
3419
3509
|
}, "Review must match the unresolved outcome");
|
|
3420
3510
|
|
|
3421
3511
|
// src/schema/postPurchaseFollowups.ts
|
|
3422
|
-
var RequiredHealthSchema =
|
|
3512
|
+
var RequiredHealthSchema = import_zod46.z.union([
|
|
3423
3513
|
HealthSchedulingResponseSchema.shape.data,
|
|
3424
|
-
|
|
3514
|
+
import_zod46.z.strictObject({ status: import_zod46.z.literal("unavailable") })
|
|
3425
3515
|
]);
|
|
3426
|
-
var AcceptedFollowupsResponseSchema =
|
|
3427
|
-
data:
|
|
3428
|
-
acceptedEvent:
|
|
3516
|
+
var AcceptedFollowupsResponseSchema = import_zod46.z.object({
|
|
3517
|
+
data: import_zod46.z.object({
|
|
3518
|
+
acceptedEvent: import_zod46.z.union([
|
|
3429
3519
|
AcceptedEventResponseSchema.shape.data,
|
|
3430
|
-
|
|
3520
|
+
import_zod46.z.strictObject({ status: import_zod46.z.literal("unavailable") })
|
|
3431
3521
|
]),
|
|
3432
3522
|
acceptedMetafield: AcceptedMetafieldResultSchema,
|
|
3433
3523
|
health: RequiredHealthSchema,
|
|
@@ -3438,61 +3528,49 @@ var AcceptedFollowupsResponseSchema = import_zod43.z.object({
|
|
|
3438
3528
|
message: "STS progress belongs to its operation",
|
|
3439
3529
|
path: ["sts", "operationId"]
|
|
3440
3530
|
}),
|
|
3441
|
-
successful:
|
|
3531
|
+
successful: import_zod46.z.literal(true)
|
|
3442
3532
|
});
|
|
3443
3533
|
|
|
3444
3534
|
// src/schema/postPurchaseSessionClose.ts
|
|
3445
|
-
var
|
|
3446
|
-
var SessionClosureSchema =
|
|
3535
|
+
var import_zod47 = require("zod");
|
|
3536
|
+
var SessionClosureSchema = import_zod47.z.object({ closedAt: PostPurchaseTimestampSchema, status: import_zod47.z.literal("closed") });
|
|
3447
3537
|
var SessionCloseRequestSchema = DecideRequestSchema.strict();
|
|
3448
|
-
var SessionCloseResponseSchema =
|
|
3449
|
-
|
|
3450
|
-
// src/schema/postPurchaseTransition.ts
|
|
3451
|
-
var import_zod46 = require("zod");
|
|
3452
|
-
|
|
3453
|
-
// src/schema/postPurchaseSkipTrace.ts
|
|
3454
|
-
var import_zod45 = require("zod");
|
|
3455
|
-
var POST_PURCHASE_SKIP_LIMIT = 32;
|
|
3456
|
-
var PostPurchaseSkipTraceSchema = import_zod45.z.array(
|
|
3457
|
-
import_zod45.z.object({
|
|
3458
|
-
entry: DecisionEntrySchema,
|
|
3459
|
-
reason: PostPurchaseSkipReasonSchema
|
|
3460
|
-
})
|
|
3461
|
-
).max(POST_PURCHASE_SKIP_LIMIT);
|
|
3538
|
+
var SessionCloseResponseSchema = import_zod47.z.object({ data: SessionClosureSchema, successful: import_zod47.z.literal(true) });
|
|
3462
3539
|
|
|
3463
3540
|
// src/schema/postPurchaseTransition.ts
|
|
3541
|
+
var import_zod48 = require("zod");
|
|
3464
3542
|
var OfferTransitionRequestSchema = DecideRequestSchema.extend({
|
|
3465
3543
|
entryRevision: PostPurchaseProgressSchema.shape.entryRevision,
|
|
3466
3544
|
progressRevision: PostPurchaseProgressSchema.shape.revision
|
|
3467
3545
|
}).strict();
|
|
3468
|
-
var PostPurchaseEndReasonSchema =
|
|
3469
|
-
var TransitionBaseSchema =
|
|
3546
|
+
var PostPurchaseEndReasonSchema = import_zod48.z.enum(["no-child", "no-products", "accept-cap"]);
|
|
3547
|
+
var TransitionBaseSchema = import_zod48.z.object({
|
|
3470
3548
|
attemptedSkips: PostPurchaseSkipTraceSchema.optional(),
|
|
3471
3549
|
progress: PostPurchaseProgressSchema
|
|
3472
3550
|
});
|
|
3473
|
-
var OfferTransitionResponseSchema =
|
|
3474
|
-
data:
|
|
3475
|
-
TransitionBaseSchema.extend({ status:
|
|
3551
|
+
var OfferTransitionResponseSchema = import_zod48.z.object({
|
|
3552
|
+
data: import_zod48.z.discriminatedUnion("status", [
|
|
3553
|
+
TransitionBaseSchema.extend({ status: import_zod48.z.enum(["advanced", "unavailable"]) }),
|
|
3476
3554
|
TransitionBaseSchema.extend({
|
|
3477
3555
|
endReason: PostPurchaseEndReasonSchema.optional(),
|
|
3478
|
-
status:
|
|
3556
|
+
status: import_zod48.z.literal("no-child")
|
|
3479
3557
|
})
|
|
3480
3558
|
]),
|
|
3481
|
-
successful:
|
|
3559
|
+
successful: import_zod48.z.literal(true)
|
|
3482
3560
|
});
|
|
3483
3561
|
|
|
3484
3562
|
// src/schema/postPurchaseFinish.ts
|
|
3485
|
-
var FinishedPurchaseSchema =
|
|
3486
|
-
|
|
3487
|
-
|
|
3563
|
+
var FinishedPurchaseSchema = import_zod49.z.union([
|
|
3564
|
+
import_zod49.z.strictObject({ status: import_zod49.z.literal("none") }),
|
|
3565
|
+
import_zod49.z.strictObject({
|
|
3488
3566
|
operationId: PurchaseReceiptSchema.shape.operationId,
|
|
3489
|
-
status:
|
|
3490
|
-
|
|
3567
|
+
status: import_zod49.z.union([
|
|
3568
|
+
import_zod49.z.literal("pending"),
|
|
3491
3569
|
...PurchaseObservationSchema.options.map((option) => option.shape.status)
|
|
3492
3570
|
])
|
|
3493
3571
|
})
|
|
3494
3572
|
]);
|
|
3495
|
-
var PostPurchaseFinishReasonSchema =
|
|
3573
|
+
var PostPurchaseFinishReasonSchema = import_zod49.z.enum([
|
|
3496
3574
|
"continue",
|
|
3497
3575
|
"decline-all",
|
|
3498
3576
|
"end",
|
|
@@ -3510,27 +3588,27 @@ var SessionFinishRequestSchema = DecideRequestSchema.extend({
|
|
|
3510
3588
|
message: 'endReason is only valid with reason "end"',
|
|
3511
3589
|
path: ["endReason"]
|
|
3512
3590
|
});
|
|
3513
|
-
var SessionFinishResponseSchema =
|
|
3591
|
+
var SessionFinishResponseSchema = import_zod49.z.object({
|
|
3514
3592
|
data: SessionClosureSchema.extend({
|
|
3515
3593
|
classification: ClassificationProgressSchema,
|
|
3516
3594
|
exitPolicy: ExitPolicySchema,
|
|
3517
3595
|
health: RequiredHealthSchema.nullable(),
|
|
3518
3596
|
purchase: FinishedPurchaseSchema
|
|
3519
3597
|
}),
|
|
3520
|
-
successful:
|
|
3598
|
+
successful: import_zod49.z.literal(true)
|
|
3521
3599
|
});
|
|
3522
3600
|
|
|
3523
3601
|
// src/schema/postPurchaseQuantity.ts
|
|
3524
|
-
var
|
|
3602
|
+
var import_zod73 = require("zod");
|
|
3525
3603
|
|
|
3526
3604
|
// src/schema/postPurchaseProductCollectionView.ts
|
|
3527
|
-
var
|
|
3605
|
+
var import_zod72 = require("zod");
|
|
3528
3606
|
|
|
3529
3607
|
// src/schema/postPurchaseProductView.ts
|
|
3530
|
-
var
|
|
3608
|
+
var import_zod71 = require("zod");
|
|
3531
3609
|
|
|
3532
3610
|
// src/schema/postPurchaseGroupCatalog.ts
|
|
3533
|
-
var
|
|
3611
|
+
var import_zod50 = require("zod");
|
|
3534
3612
|
var productId = PreparedPostPurchaseProduct.shape.selection.shape.productId;
|
|
3535
3613
|
var source = PostPurchaseProductSource.shape.data.element;
|
|
3536
3614
|
var PostPurchaseGroupDescription = source.pick({ description: true, id: true, image: true, images: true, title: true }).extend({
|
|
@@ -3538,17 +3616,17 @@ var PostPurchaseGroupDescription = source.pick({ description: true, id: true, im
|
|
|
3538
3616
|
image: source.shape.image.default(null),
|
|
3539
3617
|
options: PostPurchaseVariantCatalog.shape.options.default([])
|
|
3540
3618
|
});
|
|
3541
|
-
var PostPurchaseGroupCatalog =
|
|
3619
|
+
var PostPurchaseGroupCatalog = import_zod50.z.object({
|
|
3542
3620
|
memberProductId: productId,
|
|
3543
|
-
options:
|
|
3621
|
+
options: import_zod50.z.array(import_zod50.z.object({ productId, title: import_zod50.z.string(), variantCatalog: PostPurchaseVariantCatalog }))
|
|
3544
3622
|
});
|
|
3545
|
-
var PostPurchaseGroupSelection =
|
|
3623
|
+
var PostPurchaseGroupSelection = import_zod50.z.object({
|
|
3546
3624
|
memberProductId: productId,
|
|
3547
3625
|
productId
|
|
3548
3626
|
});
|
|
3549
3627
|
|
|
3550
3628
|
// src/schema/widgets/checkout-and-beyond/root.ts
|
|
3551
|
-
var
|
|
3629
|
+
var import_zod70 = require("zod");
|
|
3552
3630
|
|
|
3553
3631
|
// src/schema/widgets/checkout-and-beyond/constants.ts
|
|
3554
3632
|
var import_es_toolkit3 = require("es-toolkit");
|
|
@@ -3603,18 +3681,18 @@ var targetAreas = {
|
|
|
3603
3681
|
|
|
3604
3682
|
// src/schema/widgets/checkout-and-beyond/layout.ts
|
|
3605
3683
|
var import_uuid15 = require("uuid");
|
|
3606
|
-
var
|
|
3684
|
+
var import_zod69 = require("zod");
|
|
3607
3685
|
|
|
3608
3686
|
// src/schema/widgets/checkout-and-beyond/shared.ts
|
|
3609
|
-
var
|
|
3687
|
+
var import_zod68 = require("zod");
|
|
3610
3688
|
|
|
3611
3689
|
// src/schema/widgets/checkout-and-beyond/banner.ts
|
|
3612
|
-
var
|
|
3613
|
-
var CABBannerSection =
|
|
3690
|
+
var import_zod51 = require("zod");
|
|
3691
|
+
var CABBannerSection = import_zod51.z.lazy(
|
|
3614
3692
|
() => CABLayoutSection.omit({ sectionType: true }).extend({
|
|
3615
|
-
buttonField:
|
|
3616
|
-
color:
|
|
3617
|
-
dismissible:
|
|
3693
|
+
buttonField: import_zod51.z.enum(buttonFields).optional(),
|
|
3694
|
+
color: import_zod51.z.enum(bannerColors).default("info"),
|
|
3695
|
+
dismissible: import_zod51.z.boolean().default(true),
|
|
3618
3696
|
/**
|
|
3619
3697
|
* The `s-banner` heading — localized content (a buyer can see a merchant-composed banner). Absent OR
|
|
3620
3698
|
* blank ⇒ no heading; the renderer emits no heading slot for `''` rather than an empty one.
|
|
@@ -3630,18 +3708,18 @@ var CABBannerSection = import_zod49.z.lazy(
|
|
|
3630
3708
|
* not a 500. Nothing emits `heading` yet; the first converter that maps merchant banner copy into it
|
|
3631
3709
|
* either strips first or teaches `normalizeTextContent` to strip this field.
|
|
3632
3710
|
*/
|
|
3633
|
-
heading:
|
|
3634
|
-
sectionType:
|
|
3711
|
+
heading: import_zod51.z.record(import_zod51.z.string(), import_zod51.z.string().refine(checkForHTML, NO_HTML)).optional(),
|
|
3712
|
+
sectionType: import_zod51.z.literal(SectionType.banner).default(SectionType.banner)
|
|
3635
3713
|
})
|
|
3636
3714
|
);
|
|
3637
3715
|
|
|
3638
3716
|
// src/schema/widgets/checkout-and-beyond/button.ts
|
|
3639
3717
|
var import_uuid5 = require("uuid");
|
|
3640
|
-
var
|
|
3718
|
+
var import_zod54 = require("zod");
|
|
3641
3719
|
|
|
3642
3720
|
// src/schema/widgets/checkout-and-beyond/image.ts
|
|
3643
3721
|
var import_uuid4 = require("uuid");
|
|
3644
|
-
var
|
|
3722
|
+
var import_zod53 = require("zod");
|
|
3645
3723
|
|
|
3646
3724
|
// src/schema/widgets/checkout-and-beyond/icons.ts
|
|
3647
3725
|
var iconNames = [
|
|
@@ -3728,24 +3806,24 @@ var iconTones = ["auto", "critical", "custom", "info", "neutral", "success", "wa
|
|
|
3728
3806
|
var IconTone = freezeEnum(iconTones);
|
|
3729
3807
|
|
|
3730
3808
|
// src/schema/widgets/checkout-and-beyond/imageThumbnails.ts
|
|
3731
|
-
var
|
|
3732
|
-
var CABImageThumbnails =
|
|
3733
|
-
limit:
|
|
3734
|
-
perLine:
|
|
3809
|
+
var import_zod52 = require("zod");
|
|
3810
|
+
var CABImageThumbnails = import_zod52.z.object({
|
|
3811
|
+
limit: import_zod52.z.number().int().min(1).default(8),
|
|
3812
|
+
perLine: import_zod52.z.number().int().min(1).max(8).default(4)
|
|
3735
3813
|
});
|
|
3736
3814
|
|
|
3737
3815
|
// src/schema/widgets/checkout-and-beyond/image.ts
|
|
3738
|
-
var CABImageSectionFields =
|
|
3816
|
+
var CABImageSectionFields = import_zod53.z.object({
|
|
3739
3817
|
...CABVariableFields,
|
|
3740
|
-
altText:
|
|
3818
|
+
altText: import_zod53.z.string().refine(checkForHTML, NO_HTML).default(""),
|
|
3741
3819
|
/**
|
|
3742
3820
|
* Image width÷height (e.g. `46` for the progress-bar fill); `null` renders at natural size. Any POSITIVE
|
|
3743
3821
|
* ratio — never limited to 1, but never `0`/negative either: a renderer dividing by it would get `Infinity`,
|
|
3744
3822
|
* and CSS `aspect-ratio` drops a negative value and silently reverts to natural size.
|
|
3745
3823
|
*/
|
|
3746
|
-
aspectRatio:
|
|
3747
|
-
border:
|
|
3748
|
-
buttonField:
|
|
3824
|
+
aspectRatio: import_zod53.z.number().positive().nullable().default(null),
|
|
3825
|
+
border: import_zod53.z.lazy(() => CABBorder),
|
|
3826
|
+
buttonField: import_zod53.z.enum(buttonFields).optional(),
|
|
3749
3827
|
/**
|
|
3750
3828
|
* `icon` renders `source` as a single `s-icon` by name (the uber-image path covers icons too), reading
|
|
3751
3829
|
* `iconSize`/`iconTone`. The other values are a harmless informational holdover from the previous
|
|
@@ -3764,30 +3842,30 @@ var CABImageSectionFields = import_zod51.z.object({
|
|
|
3764
3842
|
* behavior degraded gracefully and told us about it. The client-assembled half of the invariant was never
|
|
3765
3843
|
* the risky half.
|
|
3766
3844
|
*/
|
|
3767
|
-
category:
|
|
3845
|
+
category: import_zod53.z.enum(["gallery", "icon", "icons", "payment-methods", "secure-checkout"]).nullable().default(null),
|
|
3768
3846
|
/** `icon`-mode only: the `s-icon` `size`; `null` ⇒ the component default (`base`). Ignored by image treatments. */
|
|
3769
|
-
iconSize:
|
|
3847
|
+
iconSize: import_zod53.z.enum(iconSizes).nullable().default(null),
|
|
3770
3848
|
/** `icon`-mode only: the `s-icon` `tone`; `null` ⇒ the component default (`auto`). Ignored by image treatments. */
|
|
3771
|
-
iconTone:
|
|
3772
|
-
name:
|
|
3773
|
-
naturalHeight:
|
|
3774
|
-
naturalWidth:
|
|
3849
|
+
iconTone: import_zod53.z.enum(iconTones).nullable().default(null),
|
|
3850
|
+
name: import_zod53.z.string().optional(),
|
|
3851
|
+
naturalHeight: import_zod53.z.number().default(0),
|
|
3852
|
+
naturalWidth: import_zod53.z.number().default(0),
|
|
3775
3853
|
/**
|
|
3776
3854
|
* `contain` (the component default): dimensionless images render in s-image's 1/1 default frame, and
|
|
3777
3855
|
* `cover` would crop non-square art (payment badges lost their edges — 15993); `contain` letterboxes.
|
|
3778
3856
|
*/
|
|
3779
|
-
objectFit:
|
|
3780
|
-
sectionId:
|
|
3781
|
-
sectionType:
|
|
3857
|
+
objectFit: import_zod53.z.enum(objectFits).default(ObjectFit.contain),
|
|
3858
|
+
sectionId: import_zod53.z.uuid().default(() => (0, import_uuid4.v7)()),
|
|
3859
|
+
sectionType: import_zod53.z.literal(SectionType.image).default(SectionType.image),
|
|
3782
3860
|
/**
|
|
3783
3861
|
* An image URL or dynamic token, an empty default, or — when `category: 'icon'` — an icon NAME. Icon mode
|
|
3784
3862
|
* takes a name or `''` only, NOT a token: no renderer resolves a token to an icon today, so accepting one
|
|
3785
3863
|
* would promise a capability that doesn't exist. Widen the refine's carve-out to `DYNAMIC_TOKEN_REGEX` when a
|
|
3786
3864
|
* server-chosen tier icon actually needs it.
|
|
3787
3865
|
*/
|
|
3788
|
-
source:
|
|
3866
|
+
source: import_zod53.z.union([import_zod53.z.url(), import_zod53.z.literal(""), import_zod53.z.string().regex(DYNAMIC_TOKEN_REGEX), import_zod53.z.enum(iconNames)]).default(""),
|
|
3789
3867
|
thumbnails: CABImageThumbnails.optional(),
|
|
3790
|
-
width:
|
|
3868
|
+
width: import_zod53.z.number().default(100)
|
|
3791
3869
|
});
|
|
3792
3870
|
var iconNameSet = new Set(iconNames);
|
|
3793
3871
|
var isIconName = (source2) => iconNameSet.has(source2);
|
|
@@ -3807,42 +3885,42 @@ var CABImageSection = CABImageSectionFields.superRefine(({ category, source: sou
|
|
|
3807
3885
|
});
|
|
3808
3886
|
|
|
3809
3887
|
// src/schema/widgets/checkout-and-beyond/button.ts
|
|
3810
|
-
var CABButtonContent =
|
|
3811
|
-
() =>
|
|
3888
|
+
var CABButtonContent = import_zod54.z.lazy(
|
|
3889
|
+
() => import_zod54.z.discriminatedUnion("sectionType", [CABImageSection, CABLayoutSection, CABTextSection])
|
|
3812
3890
|
);
|
|
3813
|
-
var CABButtonSection =
|
|
3891
|
+
var CABButtonSection = import_zod54.z.object({
|
|
3814
3892
|
...CABVariableFields,
|
|
3815
|
-
action:
|
|
3816
|
-
buttonStyle:
|
|
3817
|
-
custom:
|
|
3818
|
-
color:
|
|
3819
|
-
height:
|
|
3820
|
-
width:
|
|
3893
|
+
action: import_zod54.z.union([import_zod54.z.literal(""), import_zod54.z.enum(buttonActions)]).default(""),
|
|
3894
|
+
buttonStyle: import_zod54.z.enum(buttonStyles).default(ButtonStyle.primary),
|
|
3895
|
+
custom: import_zod54.z.object({
|
|
3896
|
+
color: import_zod54.z.string().regex(HEX_COLOR_REGEX).default("#005bd3"),
|
|
3897
|
+
height: import_zod54.z.number().default(52),
|
|
3898
|
+
width: import_zod54.z.number().default(300)
|
|
3821
3899
|
}).default({
|
|
3822
3900
|
color: "#005bd3",
|
|
3823
3901
|
height: 52,
|
|
3824
3902
|
width: 300
|
|
3825
3903
|
}),
|
|
3826
|
-
disableDowngrade:
|
|
3904
|
+
disableDowngrade: import_zod54.z.boolean().default(false),
|
|
3827
3905
|
/**
|
|
3828
3906
|
* What labels a `switchToSubscription` button's frequency options. `planName` shows the selling plan's
|
|
3829
3907
|
* own name (legacy post-purchase, L115) and falls back to the `subscriptionOption` template for a plan
|
|
3830
3908
|
* without one; absent or `template` is the template alone (the checkout card). Optional and additive
|
|
3831
3909
|
* (REB-24846); an unknown value reads as absent.
|
|
3832
3910
|
*/
|
|
3833
|
-
frequencyLabel:
|
|
3834
|
-
name:
|
|
3835
|
-
optionId:
|
|
3836
|
-
popover:
|
|
3837
|
-
alignment:
|
|
3838
|
-
position:
|
|
3911
|
+
frequencyLabel: import_zod54.z.enum(["planName", "template"]).optional().catch(void 0),
|
|
3912
|
+
name: import_zod54.z.string().optional(),
|
|
3913
|
+
optionId: import_zod54.z.number().optional(),
|
|
3914
|
+
popover: import_zod54.z.object({
|
|
3915
|
+
alignment: import_zod54.z.enum(textAlignments).default(TextAlignment.center),
|
|
3916
|
+
position: import_zod54.z.enum(popoverPositions).default(PopoverPosition.blockStart)
|
|
3839
3917
|
}).optional().default(() => ({
|
|
3840
3918
|
alignment: TextAlignment.center,
|
|
3841
3919
|
position: PopoverPosition.blockStart
|
|
3842
3920
|
})),
|
|
3843
|
-
sectionId:
|
|
3844
|
-
sections:
|
|
3845
|
-
sectionType:
|
|
3921
|
+
sectionId: import_zod54.z.uuid().default(() => (0, import_uuid5.v7)()),
|
|
3922
|
+
sections: import_zod54.z.union([import_zod54.z.array(CABButtonContent), import_zod54.z.strictObject({}).transform(() => [])]).default(() => []),
|
|
3923
|
+
sectionType: import_zod54.z.literal(SectionType.button).default(SectionType.button),
|
|
3846
3924
|
/**
|
|
3847
3925
|
* The smart-cart tier this button acts on (`addGift`/`removeGift`): scopes the click to one tier's gift. The
|
|
3848
3926
|
* client resolves the tier's gift (productId) from the progress-bar context by this `tierId` — the button node
|
|
@@ -3857,96 +3935,96 @@ var CABButtonSection = import_zod52.z.object({
|
|
|
3857
3935
|
* lookup finds no tier and the click resolves to nothing. Safe to bound — the field is new, so there are no
|
|
3858
3936
|
* stored payloads to grandfather, and the producer is client code, not a merchant form.
|
|
3859
3937
|
*/
|
|
3860
|
-
tier:
|
|
3938
|
+
tier: import_zod54.z.object({ tierId: import_zod54.z.string().min(1) }).optional(),
|
|
3861
3939
|
/** Fire-and-forget pixel POSTed when the button is clicked (e.g. a Monetize decline). */
|
|
3862
|
-
trackingUrl:
|
|
3940
|
+
trackingUrl: import_zod54.z.string().optional(),
|
|
3863
3941
|
/**
|
|
3864
3942
|
* Secondary effects applied to in-scope variables on click, alongside (never instead of) the primary
|
|
3865
3943
|
* `action` — an `addToOrder` button can also flip a variable. Applied in array order.
|
|
3866
3944
|
*/
|
|
3867
|
-
variableEffects:
|
|
3945
|
+
variableEffects: import_zod54.z.array(CABVariableEffect).optional()
|
|
3868
3946
|
});
|
|
3869
3947
|
|
|
3870
3948
|
// src/schema/widgets/checkout-and-beyond/carousel.ts
|
|
3871
|
-
var
|
|
3949
|
+
var import_zod59 = require("zod");
|
|
3872
3950
|
|
|
3873
3951
|
// src/schema/widgets/checkout-and-beyond/offers.ts
|
|
3874
|
-
var
|
|
3952
|
+
var import_zod58 = require("zod");
|
|
3875
3953
|
|
|
3876
3954
|
// src/schema/widgets/checkout-and-beyond/dataSource.ts
|
|
3877
3955
|
var import_uuid6 = require("uuid");
|
|
3878
|
-
var
|
|
3879
|
-
var CABDiscount =
|
|
3880
|
-
amount:
|
|
3881
|
-
discountedBy:
|
|
3882
|
-
discountedFrom:
|
|
3883
|
-
type:
|
|
3884
|
-
});
|
|
3885
|
-
var CABIntegrations =
|
|
3886
|
-
judgeme:
|
|
3887
|
-
junip:
|
|
3888
|
-
klaviyo:
|
|
3889
|
-
loox:
|
|
3890
|
-
okendo:
|
|
3891
|
-
opinew:
|
|
3892
|
-
reviewsio:
|
|
3893
|
-
stamped:
|
|
3894
|
-
yotpo:
|
|
3895
|
-
});
|
|
3896
|
-
var CABVariantLabels =
|
|
3897
|
-
variantOption:
|
|
3898
|
-
variantOptions:
|
|
3899
|
-
});
|
|
3900
|
-
var CABDataSourceSection =
|
|
3901
|
-
dataSourceId:
|
|
3902
|
-
dataSourcePath:
|
|
3956
|
+
var import_zod55 = require("zod");
|
|
3957
|
+
var CABDiscount = import_zod55.z.object({
|
|
3958
|
+
amount: import_zod55.z.union([import_zod55.z.number(), import_zod55.z.string()]).catch(0),
|
|
3959
|
+
discountedBy: import_zod55.z.string().optional(),
|
|
3960
|
+
discountedFrom: import_zod55.z.enum(discountSources).optional().catch(void 0),
|
|
3961
|
+
type: import_zod55.z.enum(discountTypes).catch("none")
|
|
3962
|
+
});
|
|
3963
|
+
var CABIntegrations = import_zod55.z.object({
|
|
3964
|
+
judgeme: import_zod55.z.boolean().default(false),
|
|
3965
|
+
junip: import_zod55.z.boolean().default(false),
|
|
3966
|
+
klaviyo: import_zod55.z.boolean().default(false),
|
|
3967
|
+
loox: import_zod55.z.boolean().default(false),
|
|
3968
|
+
okendo: import_zod55.z.boolean().default(false),
|
|
3969
|
+
opinew: import_zod55.z.boolean().default(false),
|
|
3970
|
+
reviewsio: import_zod55.z.boolean().default(false),
|
|
3971
|
+
stamped: import_zod55.z.boolean().default(false),
|
|
3972
|
+
yotpo: import_zod55.z.boolean().default(false)
|
|
3973
|
+
});
|
|
3974
|
+
var CABVariantLabels = import_zod55.z.object({
|
|
3975
|
+
variantOption: import_zod55.z.string().optional().catch(void 0),
|
|
3976
|
+
variantOptions: import_zod55.z.string().optional().catch(void 0)
|
|
3977
|
+
});
|
|
3978
|
+
var CABDataSourceSection = import_zod55.z.object({
|
|
3979
|
+
dataSourceId: import_zod55.z.number().nullable().default(null),
|
|
3980
|
+
dataSourcePath: import_zod55.z.string().default(DEFAULT_ENDPOINTS[0].value),
|
|
3903
3981
|
discount: CABDiscount.optional(),
|
|
3904
3982
|
integrations: CABIntegrations.optional(),
|
|
3905
|
-
limit:
|
|
3906
|
-
matchVariant:
|
|
3907
|
-
matchVariantOutOfStock:
|
|
3908
|
-
name:
|
|
3909
|
-
productType:
|
|
3910
|
-
sectionId:
|
|
3911
|
-
sectionType:
|
|
3983
|
+
limit: import_zod55.z.number().default(1),
|
|
3984
|
+
matchVariant: import_zod55.z.boolean().default(false),
|
|
3985
|
+
matchVariantOutOfStock: import_zod55.z.boolean().default(false),
|
|
3986
|
+
name: import_zod55.z.string().default(DEFAULT_ENDPOINTS[0].label),
|
|
3987
|
+
productType: import_zod55.z.enum(productTypes).optional(),
|
|
3988
|
+
sectionId: import_zod55.z.uuid().default(() => (0, import_uuid6.v7)()),
|
|
3989
|
+
sectionType: import_zod55.z.literal(SectionType.dataSource).default(SectionType.dataSource),
|
|
3912
3990
|
/** Default subscribe-vs-one-time for `productType: both` (legacy `subscription_is_default`). */
|
|
3913
|
-
subscriptionIsDefault:
|
|
3914
|
-
treatAsGwp:
|
|
3991
|
+
subscriptionIsDefault: import_zod55.z.boolean().default(false),
|
|
3992
|
+
treatAsGwp: import_zod55.z.boolean().default(false),
|
|
3915
3993
|
variantLabels: CABVariantLabels.optional().catch(void 0)
|
|
3916
3994
|
});
|
|
3917
3995
|
|
|
3918
3996
|
// src/schema/widgets/checkout-and-beyond/products.ts
|
|
3919
3997
|
var import_uuid8 = require("uuid");
|
|
3920
|
-
var
|
|
3998
|
+
var import_zod57 = require("zod");
|
|
3921
3999
|
|
|
3922
4000
|
// src/schema/widgets/checkout-and-beyond/product.ts
|
|
3923
4001
|
var import_uuid7 = require("uuid");
|
|
3924
|
-
var
|
|
3925
|
-
var CABVariantContent =
|
|
3926
|
-
() =>
|
|
4002
|
+
var import_zod56 = require("zod");
|
|
4003
|
+
var CABVariantContent = import_zod56.z.lazy(
|
|
4004
|
+
() => import_zod56.z.discriminatedUnion("sectionType", [CABButtonSection, CABTextSection])
|
|
3927
4005
|
);
|
|
3928
|
-
var CABProductSection =
|
|
4006
|
+
var CABProductSection = import_zod56.z.object({
|
|
3929
4007
|
...CABVariableFields,
|
|
3930
|
-
name:
|
|
3931
|
-
productId:
|
|
3932
|
-
sectionId:
|
|
3933
|
-
sections:
|
|
3934
|
-
sectionType:
|
|
3935
|
-
selectors:
|
|
3936
|
-
variantMode:
|
|
4008
|
+
name: import_zod56.z.string().optional(),
|
|
4009
|
+
productId: import_zod56.z.number().nullable().default(null),
|
|
4010
|
+
sectionId: import_zod56.z.uuid().default(() => (0, import_uuid7.v7)()),
|
|
4011
|
+
sections: import_zod56.z.union([import_zod56.z.array(CABVariantContent), import_zod56.z.strictObject({}).transform(() => [])]).default(() => []),
|
|
4012
|
+
sectionType: import_zod56.z.literal(SectionType.product).default(SectionType.product),
|
|
4013
|
+
selectors: import_zod56.z.record(import_zod56.z.string(), import_zod56.z.enum(variantSelectors).default(VariantSelector.menu)).default(() => ({})),
|
|
4014
|
+
variantMode: import_zod56.z.enum(variantModes).default(VariantMode.multiple)
|
|
3937
4015
|
});
|
|
3938
4016
|
|
|
3939
4017
|
// src/schema/widgets/checkout-and-beyond/products.ts
|
|
3940
|
-
var CABProductsSection =
|
|
4018
|
+
var CABProductsSection = import_zod57.z.object({
|
|
3941
4019
|
...CABVariableFields,
|
|
3942
|
-
name:
|
|
3943
|
-
sectionId:
|
|
3944
|
-
sections:
|
|
3945
|
-
sectionType:
|
|
4020
|
+
name: import_zod57.z.string().optional(),
|
|
4021
|
+
sectionId: import_zod57.z.uuid().default(() => (0, import_uuid8.v7)()),
|
|
4022
|
+
sections: import_zod57.z.union([import_zod57.z.array(import_zod57.z.lazy(() => CABProductSection)), import_zod57.z.strictObject({}).transform(() => [])]).default(() => []),
|
|
4023
|
+
sectionType: import_zod57.z.literal(SectionType.products).default(SectionType.products)
|
|
3946
4024
|
});
|
|
3947
4025
|
|
|
3948
4026
|
// src/schema/widgets/checkout-and-beyond/offers.ts
|
|
3949
|
-
var CABOffersSection =
|
|
4027
|
+
var CABOffersSection = import_zod58.z.lazy(
|
|
3950
4028
|
() => CABLayoutSection.omit({ sections: true, sectionType: true }).extend({
|
|
3951
4029
|
/**
|
|
3952
4030
|
* A rule between consecutive cards in the vertical list — legacy checkout-offers' `<Divider />`,
|
|
@@ -3954,8 +4032,8 @@ var CABOffersSection = import_zod56.z.lazy(
|
|
|
3954
4032
|
* run of products). Optional, not defaulted: only the v1 converter sets it (REB-24265); a
|
|
3955
4033
|
* hand-built tree keeps React CAB's dividerless rendering.
|
|
3956
4034
|
*/
|
|
3957
|
-
divider:
|
|
3958
|
-
sections:
|
|
4035
|
+
divider: import_zod58.z.boolean().optional(),
|
|
4036
|
+
sections: import_zod58.z.union([import_zod58.z.array(import_zod58.z.lazy(() => CABSection)), import_zod58.z.strictObject({}).transform(() => [])]).default(() => [
|
|
3959
4037
|
CABBannerSection.parse({
|
|
3960
4038
|
buttonField: "undoAddToOrder",
|
|
3961
4039
|
color: "success",
|
|
@@ -3969,77 +4047,77 @@ var CABOffersSection = import_zod56.z.lazy(
|
|
|
3969
4047
|
CABDataSourceSection.parse({}),
|
|
3970
4048
|
CABProductsSection.parse({})
|
|
3971
4049
|
]),
|
|
3972
|
-
sectionType:
|
|
4050
|
+
sectionType: import_zod58.z.literal(SectionType.offers).default(SectionType.offers)
|
|
3973
4051
|
})
|
|
3974
4052
|
);
|
|
3975
4053
|
|
|
3976
4054
|
// src/schema/widgets/checkout-and-beyond/carousel.ts
|
|
3977
|
-
var CABCarouselSection =
|
|
4055
|
+
var CABCarouselSection = import_zod59.z.lazy(
|
|
3978
4056
|
() => CABLayoutSection.omit({ sections: true, sectionType: true }).extend({
|
|
3979
|
-
autoAdvanceInterval:
|
|
3980
|
-
itemsAtOnce:
|
|
4057
|
+
autoAdvanceInterval: import_zod59.z.number().default(0),
|
|
4058
|
+
itemsAtOnce: import_zod59.z.number().min(1).default(1),
|
|
3981
4059
|
/** Card arrangement for the offers child (`horizontal` = side-by-side) — NOT the carousel's own `direction`. */
|
|
3982
|
-
offersDirection:
|
|
3983
|
-
sections:
|
|
3984
|
-
sectionType:
|
|
4060
|
+
offersDirection: import_zod59.z.enum(offersDirections).default("vertical"),
|
|
4061
|
+
sections: import_zod59.z.union([import_zod59.z.array(import_zod59.z.lazy(() => CABSection)), import_zod59.z.strictObject({}).transform(() => [])]).default(() => [CABOffersSection.parse({})]),
|
|
4062
|
+
sectionType: import_zod59.z.literal(SectionType.carousel).default(SectionType.carousel)
|
|
3985
4063
|
})
|
|
3986
4064
|
);
|
|
3987
4065
|
|
|
3988
4066
|
// src/schema/widgets/checkout-and-beyond/cartLine.ts
|
|
3989
|
-
var
|
|
3990
|
-
var CABCartLineSection =
|
|
4067
|
+
var import_zod60 = require("zod");
|
|
4068
|
+
var CABCartLineSection = import_zod60.z.lazy(
|
|
3991
4069
|
() => CABLayoutSection.omit({ sections: true, sectionType: true }).extend({
|
|
3992
|
-
sections:
|
|
3993
|
-
sectionType:
|
|
4070
|
+
sections: import_zod60.z.union([import_zod60.z.array(import_zod60.z.lazy(() => CABSection)), import_zod60.z.strictObject({}).transform(() => [])]).default(() => [CABButtonSection.parse({ action: ButtonAction.switchToSubscription })]),
|
|
4071
|
+
sectionType: import_zod60.z.literal(SectionType.cartLine).default(SectionType.cartLine)
|
|
3994
4072
|
})
|
|
3995
4073
|
);
|
|
3996
4074
|
|
|
3997
4075
|
// src/schema/widgets/checkout-and-beyond/discount.ts
|
|
3998
4076
|
var import_uuid9 = require("uuid");
|
|
3999
|
-
var
|
|
4000
|
-
var CABDiscountSection =
|
|
4077
|
+
var import_zod61 = require("zod");
|
|
4078
|
+
var CABDiscountSection = import_zod61.z.object({
|
|
4001
4079
|
...CABVariableFields,
|
|
4002
|
-
amount:
|
|
4003
|
-
discountedBy:
|
|
4004
|
-
discountedFrom:
|
|
4005
|
-
message:
|
|
4006
|
-
name:
|
|
4007
|
-
quantity:
|
|
4008
|
-
sectionId:
|
|
4009
|
-
sectionType:
|
|
4010
|
-
type:
|
|
4080
|
+
amount: import_zod61.z.union([import_zod61.z.number(), import_zod61.z.string()]).catch(0),
|
|
4081
|
+
discountedBy: import_zod61.z.string().optional(),
|
|
4082
|
+
discountedFrom: import_zod61.z.enum(discountSources).optional().catch(void 0),
|
|
4083
|
+
message: import_zod61.z.string().optional(),
|
|
4084
|
+
name: import_zod61.z.string().optional(),
|
|
4085
|
+
quantity: import_zod61.z.number().default(1),
|
|
4086
|
+
sectionId: import_zod61.z.uuid().default(() => (0, import_uuid9.v7)()),
|
|
4087
|
+
sectionType: import_zod61.z.literal(SectionType.discount).default(SectionType.discount),
|
|
4088
|
+
type: import_zod61.z.enum(discountTypes).catch("none")
|
|
4011
4089
|
});
|
|
4012
4090
|
|
|
4013
4091
|
// src/schema/widgets/checkout-and-beyond/monetize.ts
|
|
4014
4092
|
var import_uuid10 = require("uuid");
|
|
4015
|
-
var
|
|
4016
|
-
var CABMonetizeAds =
|
|
4017
|
-
requestId:
|
|
4093
|
+
var import_zod62 = require("zod");
|
|
4094
|
+
var CABMonetizeAds = import_zod62.z.object({
|
|
4095
|
+
requestId: import_zod62.z.string().optional(),
|
|
4018
4096
|
/** Defaulted here, never in the beacon: absence of information is `ads` itself being absent. */
|
|
4019
|
-
testing:
|
|
4097
|
+
testing: import_zod62.z.boolean().default(false)
|
|
4020
4098
|
});
|
|
4021
|
-
var CABMonetizeSection =
|
|
4099
|
+
var CABMonetizeSection = import_zod62.z.object({
|
|
4022
4100
|
...CABVariableFields,
|
|
4023
4101
|
ads: CABMonetizeAds.optional(),
|
|
4024
|
-
name:
|
|
4102
|
+
name: import_zod62.z.string().optional(),
|
|
4025
4103
|
/**
|
|
4026
4104
|
* Server-hydrated offer cards (inline hydration): when `/cab/sections` was asked with a `monetize`
|
|
4027
4105
|
* context block, the composed cards ride the marker itself — `[]` means "hydrated, no fill" (render
|
|
4028
4106
|
* nothing, skip the fetch); ABSENT means "not hydrated" (the client fetches via `/cab/monetize`).
|
|
4029
4107
|
*/
|
|
4030
|
-
offers:
|
|
4108
|
+
offers: import_zod62.z.array(import_zod62.z.lazy(() => CABSection)).optional(),
|
|
4031
4109
|
/** 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. */
|
|
4032
|
-
privacyPolicyUrl:
|
|
4033
|
-
sectionId:
|
|
4034
|
-
sectionType:
|
|
4110
|
+
privacyPolicyUrl: import_zod62.z.string().optional(),
|
|
4111
|
+
sectionId: import_zod62.z.uuid().default(() => (0, import_uuid10.v7)()),
|
|
4112
|
+
sectionType: import_zod62.z.literal(SectionType.monetize).default(SectionType.monetize),
|
|
4035
4113
|
/** Ads-taxonomy sub-vertical id (the widget's `sub_vertical` setting); paired with `vertical`. */
|
|
4036
|
-
subVertical:
|
|
4114
|
+
subVertical: import_zod62.z.string().optional(),
|
|
4037
4115
|
/** Ads-taxonomy vertical id (the widget's `vertical` setting) — with `subVertical`, the admin Monetize editor's two configurables. */
|
|
4038
|
-
vertical:
|
|
4116
|
+
vertical: import_zod62.z.string().optional()
|
|
4039
4117
|
});
|
|
4040
4118
|
|
|
4041
4119
|
// src/schema/widgets/checkout-and-beyond/progressBar.ts
|
|
4042
|
-
var
|
|
4120
|
+
var import_zod63 = require("zod");
|
|
4043
4121
|
|
|
4044
4122
|
// src/schema/widgets/checkout-and-beyond/giftLabels.ts
|
|
4045
4123
|
var GIFT_LABELS = {
|
|
@@ -4158,44 +4236,44 @@ var GIFT_LABELS = {
|
|
|
4158
4236
|
};
|
|
4159
4237
|
|
|
4160
4238
|
// src/schema/widgets/checkout-and-beyond/progressBar.ts
|
|
4161
|
-
var CABProgressTierExclusion =
|
|
4162
|
-
collectionIds:
|
|
4239
|
+
var CABProgressTierExclusion = import_zod63.z.object({
|
|
4240
|
+
collectionIds: import_zod63.z.array(import_zod63.z.number().int().positive()).default(() => []),
|
|
4163
4241
|
/**
|
|
4164
4242
|
* `products` rules: each excluded product with ITS OWN variants, mirroring the bar-level
|
|
4165
4243
|
* excluded products. An empty `variantIds` means "the whole product", which is how the admin
|
|
4166
4244
|
* picker stores a whole-product selection, and a populated one means those variants.
|
|
4167
4245
|
*/
|
|
4168
|
-
products:
|
|
4169
|
-
|
|
4170
|
-
productId:
|
|
4171
|
-
variantIds:
|
|
4246
|
+
products: import_zod63.z.array(
|
|
4247
|
+
import_zod63.z.object({
|
|
4248
|
+
productId: import_zod63.z.number().int().positive(),
|
|
4249
|
+
variantIds: import_zod63.z.array(import_zod63.z.number().int().positive()).default(() => [])
|
|
4172
4250
|
})
|
|
4173
4251
|
).default(() => []),
|
|
4174
|
-
tags:
|
|
4175
|
-
type:
|
|
4252
|
+
tags: import_zod63.z.array(import_zod63.z.string().min(1)).default(() => []),
|
|
4253
|
+
type: import_zod63.z.enum(progressTierExclusionTypes)
|
|
4176
4254
|
});
|
|
4177
|
-
var CABProgressTier =
|
|
4255
|
+
var CABProgressTier = import_zod63.z.object({
|
|
4178
4256
|
/**
|
|
4179
4257
|
* Order-discount tiers only (onsite `discount`): the reward the order-discount Function applies at
|
|
4180
4258
|
* cart time, carried so the client can resolve the `{{discountAmount}}` token in this tier's copy.
|
|
4181
4259
|
* `fixedAmount`: shop-currency CENTS (FX-scaled by the client, like {@link CABProgressTier.threshold});
|
|
4182
4260
|
* `percentage`: the whole-percent number rendered raw (`{n}%`). Absent on non-discount tiers.
|
|
4183
4261
|
*/
|
|
4184
|
-
discount:
|
|
4262
|
+
discount: import_zod63.z.object({ amount: import_zod63.z.number().nonnegative(), type: import_zod63.z.enum(["fixedAmount", "percentage"]) }).optional(),
|
|
4185
4263
|
/**
|
|
4186
4264
|
* Per-tier exclusion rules (onsite `exclusions` when `exclusions_enabled`): lines they match don't count
|
|
4187
4265
|
* toward this tier. Empty (the default, and the converter's output for a disabled or ruleless tier) means
|
|
4188
4266
|
* the tier measures the plain bar-level adjusted progress. Consumers read ONLY the list named by the rule's
|
|
4189
4267
|
* `type` — the converter leaves the other two at `[]`, so a populated off-type list never reaches the tree.
|
|
4190
4268
|
*/
|
|
4191
|
-
exclusions:
|
|
4269
|
+
exclusions: import_zod63.z.array(CABProgressTierExclusion).default(() => []),
|
|
4192
4270
|
/**
|
|
4193
4271
|
* Smart-cart product (gift) tiers only (onsite `filter_oos_variants`): when set, the client drops this
|
|
4194
4272
|
* tier entirely once its gift has NO in-stock eligible variant — the milestone, fill slot and gift
|
|
4195
4273
|
* controls all disappear, mirroring onsite removing the tier from `bar.tiers` before it renders. Absent
|
|
4196
4274
|
* on shipping/discount/decorative tiers and left off by default (the tier renders regardless of stock).
|
|
4197
4275
|
*/
|
|
4198
|
-
filterOosVariants:
|
|
4276
|
+
filterOosVariants: import_zod63.z.boolean().default(false),
|
|
4199
4277
|
/**
|
|
4200
4278
|
* Smart-cart product (gift) tiers only: the reward unlocked at this tier. The client enriches
|
|
4201
4279
|
* `productId`/`variantIds` to live variants (availability, price) and adds the chosen one to the cart
|
|
@@ -4203,10 +4281,10 @@ var CABProgressTier = import_zod61.z.object({
|
|
|
4203
4281
|
* tiers and on tiers with no configured product. Cart add/remove is a later stage; carried here so the
|
|
4204
4282
|
* tree is complete.
|
|
4205
4283
|
*/
|
|
4206
|
-
gift:
|
|
4207
|
-
productId:
|
|
4208
|
-
title:
|
|
4209
|
-
variantIds:
|
|
4284
|
+
gift: import_zod63.z.object({
|
|
4285
|
+
productId: import_zod63.z.number().int().positive(),
|
|
4286
|
+
title: import_zod63.z.string().optional(),
|
|
4287
|
+
variantIds: import_zod63.z.array(import_zod63.z.number().int().positive()).default(() => [])
|
|
4210
4288
|
}).optional(),
|
|
4211
4289
|
/**
|
|
4212
4290
|
* The step-row icon's square size in PIXELS (onsite `product_tier_element_size`, an admin px string the
|
|
@@ -4226,7 +4304,7 @@ var CABProgressTier = import_zod61.z.object({
|
|
|
4226
4304
|
* renderer never spells a fallback), which also makes a tree authored before this field render at
|
|
4227
4305
|
* React's size rather than the old hardcoded 20.
|
|
4228
4306
|
*/
|
|
4229
|
-
iconSizePx:
|
|
4307
|
+
iconSizePx: import_zod63.z.number().int().min(1).max(64).default(18),
|
|
4230
4308
|
/**
|
|
4231
4309
|
* The step-row label at this tier's slot (onsite `getTierLabel`): the merchant custom label, else the
|
|
4232
4310
|
* type default — 'Free Shipping' or '{n}% Discount'. A PRODUCT tier gets NO converter label: its name is
|
|
@@ -4236,35 +4314,35 @@ var CABProgressTier = import_zod61.z.object({
|
|
|
4236
4314
|
* turns a blank label into an absent key, and a client-authored blank means the same thing — the renderer
|
|
4237
4315
|
* emits no caption slot rather than an empty one). Plain text — a compact icon+label.
|
|
4238
4316
|
*/
|
|
4239
|
-
label:
|
|
4317
|
+
label: import_zod63.z.record(import_zod63.z.string(), import_zod63.z.string()).optional(),
|
|
4240
4318
|
/**
|
|
4241
4319
|
* Smart-cart product (gift) tiers only (onsite `product_tier_image`): show the gift's product image in
|
|
4242
4320
|
* the step-row slot instead of the generic bag icon. The converter can't supply the image URL (config
|
|
4243
4321
|
* carries only product IDs), so the client resolves it (authoritative Shopify featured image, React
|
|
4244
4322
|
* parity) and falls back to the bag icon when the flag is off or no image resolves. Default false.
|
|
4245
4323
|
*/
|
|
4246
|
-
productTierImage:
|
|
4324
|
+
productTierImage: import_zod63.z.boolean().default(false),
|
|
4247
4325
|
/**
|
|
4248
4326
|
* The tier's goal, measured per `unit`. `currency` (default): SHOP-currency cents — the canonical
|
|
4249
4327
|
* fallback: when the buyer's presentment currency has no entry in `thresholds`, the client
|
|
4250
4328
|
* multiplies this by the live FX rate (converter maps the v1 `unlock_price`, e.g. `75` → `7500`).
|
|
4251
4329
|
* `item`: a raw item count — no cents, no FX, no `thresholds` overrides.
|
|
4252
4330
|
*/
|
|
4253
|
-
threshold:
|
|
4331
|
+
threshold: import_zod63.z.number().int().nonnegative(),
|
|
4254
4332
|
/**
|
|
4255
4333
|
* Per-presentment-currency goal overrides — lowercased ISO currency code → cents (e.g. `{ cad: 9900 }`).
|
|
4256
4334
|
* When the buyer's currency has an entry, the client uses it verbatim INSTEAD of FX-converting
|
|
4257
4335
|
* `threshold`, so merchants show intentional, clean per-market amounts (Shopify Markets) rather than a
|
|
4258
4336
|
* converted base. Defaults to `{}` — no overrides means always fall back to `threshold`.
|
|
4259
4337
|
*/
|
|
4260
|
-
thresholds:
|
|
4338
|
+
thresholds: import_zod63.z.record(import_zod63.z.string(), import_zod63.z.number().int().nonnegative()).default(() => ({})),
|
|
4261
4339
|
/**
|
|
4262
4340
|
* Smart-cart tier identifier, mirrored onto the gift cart line's `_tier` attribute so the client can
|
|
4263
4341
|
* match an in-cart gift back to its tier (add on reach, remove on downgrade/decline). Absent on the
|
|
4264
4342
|
* shipping bar (single unlabeled tier, no gift).
|
|
4265
4343
|
*/
|
|
4266
|
-
tierId:
|
|
4267
|
-
tierType:
|
|
4344
|
+
tierId: import_zod63.z.string().optional(),
|
|
4345
|
+
tierType: import_zod63.z.enum(progressTierTypes).default(ProgressTierType.shipping),
|
|
4268
4346
|
/**
|
|
4269
4347
|
* What this tier's progress is measured in — PER TIER (onsite's `unlock_condition_type` model, NOT
|
|
4270
4348
|
* the React port's bar-level `tiers[0]` shortcut). `currency` compares money cents against the
|
|
@@ -4275,9 +4353,9 @@ var CABProgressTier = import_zod61.z.object({
|
|
|
4275
4353
|
* count carries no injected noun (no English `item`/`items` inflection on localized copy); merchant
|
|
4276
4354
|
* template text supplies grammatically-neutral wording around the token.
|
|
4277
4355
|
*/
|
|
4278
|
-
unit:
|
|
4356
|
+
unit: import_zod63.z.enum(progressTierUnits).default(ProgressTierUnit.currency)
|
|
4279
4357
|
});
|
|
4280
|
-
var CABProgressBarSection =
|
|
4358
|
+
var CABProgressBarSection = import_zod63.z.lazy(
|
|
4281
4359
|
() => CABLayoutSection.omit({ sectionType: true }).extend({
|
|
4282
4360
|
/**
|
|
4283
4361
|
* The onsite bar id (smart-cart TPB bars only). The client mirrors it to the cart's `_barId` attribute
|
|
@@ -4286,35 +4364,35 @@ var CABProgressBarSection = import_zod61.z.lazy(
|
|
|
4286
4364
|
* checkout reaches the extension without it, so the client writes it or the tier gift's 100% discount
|
|
4287
4365
|
* (and any tier order discount) never applies. Absent on the v1 shipping bar (no gift tiers, no id).
|
|
4288
4366
|
*/
|
|
4289
|
-
barId:
|
|
4367
|
+
barId: import_zod63.z.string().optional(),
|
|
4290
4368
|
/** Empty = shown everywhere; otherwise uppercase ISO country codes. */
|
|
4291
|
-
countryCodes:
|
|
4369
|
+
countryCodes: import_zod63.z.array(import_zod63.z.string().transform((code) => code.trim().toUpperCase())).default(() => []),
|
|
4292
4370
|
/**
|
|
4293
4371
|
* Uppercase ISO codes where a higher-precedence geo bar applies, so this (default, non-geo) bar is
|
|
4294
4372
|
* hidden there — replicates React `getbar`'s geo-match-over-default precedence. Empty = never excluded.
|
|
4295
4373
|
*/
|
|
4296
|
-
excludeCountryCodes:
|
|
4374
|
+
excludeCountryCodes: import_zod63.z.array(import_zod63.z.string().transform((code) => code.trim().toUpperCase())).default(() => []),
|
|
4297
4375
|
/**
|
|
4298
4376
|
* Measure progress against the PRE-discount subtotal (onsite `exclude_discount_in_subtotal`, and
|
|
4299
4377
|
* forced on for bars with a discount tier so its own reward can't un-reach the tier). The client
|
|
4300
4378
|
* adds the cart's discount allocations back to the live subtotal.
|
|
4301
4379
|
*/
|
|
4302
|
-
excludeDiscountInSubtotal:
|
|
4380
|
+
excludeDiscountInSubtotal: import_zod63.z.boolean().default(false),
|
|
4303
4381
|
/** Variant ids the client subtracts from the adjusted subtotal (React `bar.excluded_products`). */
|
|
4304
|
-
excludedVariantIds:
|
|
4382
|
+
excludedVariantIds: import_zod63.z.array(import_zod63.z.number().int().positive()).default(() => []),
|
|
4305
4383
|
/**
|
|
4306
4384
|
* When the cart holds a subscription item, treat the bar as reached regardless of subtotal (React
|
|
4307
4385
|
* `free_shipping_on_subscription(s)`). `freeShippingOnAll` is already a zero-threshold tier instead.
|
|
4308
4386
|
*/
|
|
4309
|
-
freeShippingOnSubscription:
|
|
4387
|
+
freeShippingOnSubscription: import_zod63.z.boolean().default(false),
|
|
4310
4388
|
/** Localized heading over the gift controls (onsite `gift_area_title`, default 'FREE GIFTS'). */
|
|
4311
|
-
giftAreaTitle:
|
|
4389
|
+
giftAreaTitle: import_zod63.z.record(import_zod63.z.string(), import_zod63.z.string()).default(() => ({ en: "FREE GIFTS" })),
|
|
4312
4390
|
/** Localized gift-control labels (add/remove/heading); a tier's gift `title` beats `yourGift`. */
|
|
4313
|
-
giftLabels:
|
|
4314
|
-
addGift:
|
|
4315
|
-
remove:
|
|
4316
|
-
selectOptions:
|
|
4317
|
-
yourGift:
|
|
4391
|
+
giftLabels: import_zod63.z.object({
|
|
4392
|
+
addGift: import_zod63.z.record(import_zod63.z.string(), import_zod63.z.string()).default(() => ({ ...GIFT_LABELS.addGift })),
|
|
4393
|
+
remove: import_zod63.z.record(import_zod63.z.string(), import_zod63.z.string()).default(() => ({ ...GIFT_LABELS.remove })),
|
|
4394
|
+
selectOptions: import_zod63.z.record(import_zod63.z.string(), import_zod63.z.string()).default(() => ({ ...GIFT_LABELS.selectOptions })),
|
|
4395
|
+
yourGift: import_zod63.z.record(import_zod63.z.string(), import_zod63.z.string()).default(() => ({ ...GIFT_LABELS.yourGift }))
|
|
4318
4396
|
}).default(() => ({
|
|
4319
4397
|
addGift: { ...GIFT_LABELS.addGift },
|
|
4320
4398
|
remove: { ...GIFT_LABELS.remove },
|
|
@@ -4322,38 +4400,38 @@ var CABProgressBarSection = import_zod61.z.lazy(
|
|
|
4322
4400
|
yourGift: { ...GIFT_LABELS.yourGift }
|
|
4323
4401
|
})),
|
|
4324
4402
|
/** The bar's a11y label; the merchant names it in the editor, else this default (React parity). */
|
|
4325
|
-
name:
|
|
4403
|
+
name: import_zod63.z.string().default("Order progress"),
|
|
4326
4404
|
/**
|
|
4327
4405
|
* Bar fill color. An explicit (widget-authored) value is used verbatim; when absent the server
|
|
4328
4406
|
* fills it with the live shop theme's `buttonBackground` (React `useRebuyTheme` parity). Still
|
|
4329
4407
|
* absent after that ⇒ the theme fetch failed and the client renders its platform-default bar —
|
|
4330
4408
|
* optional, not defaulted, so "merchant chose no color" stays distinguishable from any real value.
|
|
4331
4409
|
*/
|
|
4332
|
-
progressColor:
|
|
4333
|
-
sectionType:
|
|
4410
|
+
progressColor: import_zod63.z.string().optional(),
|
|
4411
|
+
sectionType: import_zod63.z.literal(SectionType.progressBar).default(SectionType.progressBar),
|
|
4334
4412
|
/**
|
|
4335
4413
|
* The bar's milestones in the merchant's CONFIGURED order — the renderer does NOT sort them (022
|
|
4336
4414
|
* O-B2: sorting by resolved threshold reversed configured milestones on out-of-order or mixed-unit
|
|
4337
4415
|
* count-vs-cents bars). Drives the fill (even slot per tier) and, for smart-cart product tiers, the
|
|
4338
4416
|
* gift add/remove. The visual tier display lives in `sections` (composable), NOT here.
|
|
4339
4417
|
*/
|
|
4340
|
-
tiers:
|
|
4418
|
+
tiers: import_zod63.z.union([import_zod63.z.array(CABProgressTier), import_zod63.z.strictObject({}).transform(() => [])]).default(() => [])
|
|
4341
4419
|
})
|
|
4342
4420
|
);
|
|
4343
4421
|
|
|
4344
4422
|
// src/schema/widgets/checkout-and-beyond/quantity.ts
|
|
4345
4423
|
var import_uuid11 = require("uuid");
|
|
4346
|
-
var
|
|
4347
|
-
var CABQuantitySection =
|
|
4424
|
+
var import_zod64 = require("zod");
|
|
4425
|
+
var CABQuantitySection = import_zod64.z.object({
|
|
4348
4426
|
...CABVariableFields,
|
|
4349
|
-
errorMessages:
|
|
4350
|
-
|
|
4351
|
-
|
|
4427
|
+
errorMessages: import_zod64.z.record(
|
|
4428
|
+
import_zod64.z.string(),
|
|
4429
|
+
import_zod64.z.object({
|
|
4352
4430
|
/** `{{step}}` is interpolated at render — the off-increment message React never gave a merchant key. */
|
|
4353
|
-
increment:
|
|
4354
|
-
max:
|
|
4355
|
-
min:
|
|
4356
|
-
neg:
|
|
4431
|
+
increment: import_zod64.z.string().optional(),
|
|
4432
|
+
max: import_zod64.z.string().optional(),
|
|
4433
|
+
min: import_zod64.z.string().optional(),
|
|
4434
|
+
neg: import_zod64.z.string().optional()
|
|
4357
4435
|
})
|
|
4358
4436
|
).default({
|
|
4359
4437
|
en: {
|
|
@@ -4363,18 +4441,18 @@ var CABQuantitySection = import_zod62.z.object({
|
|
|
4363
4441
|
neg: "Quantity cannot be negative"
|
|
4364
4442
|
}
|
|
4365
4443
|
}),
|
|
4366
|
-
inputType:
|
|
4367
|
-
max:
|
|
4368
|
-
min:
|
|
4444
|
+
inputType: import_zod64.z.enum(quantityInputs).default(QuantityInput.select),
|
|
4445
|
+
max: import_zod64.z.number().min(1).max(100).default(10),
|
|
4446
|
+
min: import_zod64.z.number().min(1).default(1),
|
|
4369
4447
|
/** The a11y label for the quantity control; the merchant names it in the editor, else this default. */
|
|
4370
|
-
name:
|
|
4371
|
-
sectionId:
|
|
4372
|
-
sectionType:
|
|
4448
|
+
name: import_zod64.z.string().default("Quantity"),
|
|
4449
|
+
sectionId: import_zod64.z.uuid().default(() => (0, import_uuid11.v7)()),
|
|
4450
|
+
sectionType: import_zod64.z.literal(SectionType.quantity).default(SectionType.quantity)
|
|
4373
4451
|
});
|
|
4374
4452
|
|
|
4375
4453
|
// src/schema/widgets/checkout-and-beyond/reviews.ts
|
|
4376
4454
|
var import_uuid12 = require("uuid");
|
|
4377
|
-
var
|
|
4455
|
+
var import_zod65 = require("zod");
|
|
4378
4456
|
|
|
4379
4457
|
// src/schema/widgets/checkout-and-beyond/reviewLabels.ts
|
|
4380
4458
|
var REVIEW_LABELS = {
|
|
@@ -4437,49 +4515,49 @@ var REVIEW_LABELS = {
|
|
|
4437
4515
|
};
|
|
4438
4516
|
|
|
4439
4517
|
// src/schema/widgets/checkout-and-beyond/reviews.ts
|
|
4440
|
-
var CABReviewsSection =
|
|
4518
|
+
var CABReviewsSection = import_zod65.z.object({
|
|
4441
4519
|
...CABVariableFields,
|
|
4442
|
-
color:
|
|
4520
|
+
color: import_zod65.z.string().default("#fadb14"),
|
|
4443
4521
|
/**
|
|
4444
4522
|
* Localized review-count templates (`{{reviewCount}}`), one/other plural forms; the client picks the
|
|
4445
4523
|
* form via `Intl.PluralRules`. Defaults here (schema-first) so every tree localizes without converter
|
|
4446
4524
|
* or merchant work.
|
|
4447
4525
|
*/
|
|
4448
|
-
countLabels:
|
|
4449
|
-
one:
|
|
4450
|
-
other:
|
|
4526
|
+
countLabels: import_zod65.z.object({
|
|
4527
|
+
one: import_zod65.z.record(import_zod65.z.string(), import_zod65.z.string()).default(() => ({ ...REVIEW_LABELS.one })),
|
|
4528
|
+
other: import_zod65.z.record(import_zod65.z.string(), import_zod65.z.string()).default(() => ({ ...REVIEW_LABELS.other }))
|
|
4451
4529
|
}).default(() => ({ one: { ...REVIEW_LABELS.one }, other: { ...REVIEW_LABELS.other } })),
|
|
4452
|
-
name:
|
|
4453
|
-
sectionId:
|
|
4454
|
-
sectionType:
|
|
4455
|
-
size:
|
|
4530
|
+
name: import_zod65.z.string().optional(),
|
|
4531
|
+
sectionId: import_zod65.z.uuid().default(() => (0, import_uuid12.v7)()),
|
|
4532
|
+
sectionType: import_zod65.z.literal(SectionType.reviews).default(SectionType.reviews),
|
|
4533
|
+
size: import_zod65.z.enum(reviewsSizes).default(ReviewsSize.default),
|
|
4456
4534
|
/**
|
|
4457
4535
|
* Star outline color, interpolated into a style by the renderer, so it is hex-constrained like
|
|
4458
4536
|
* `CABButtonSection.color`. The legacy source (`PostPurchaseSettings.styles.starStrokeColor`) is a free
|
|
4459
4537
|
* string: its converter must validate and fall back to this default rather than let one odd value drop
|
|
4460
4538
|
* the whole reviews section.
|
|
4461
4539
|
*/
|
|
4462
|
-
strokeColor:
|
|
4540
|
+
strokeColor: import_zod65.z.string().regex(HEX_COLOR_REGEX).default("#fadb14"),
|
|
4463
4541
|
/** Star outline width in px; `0` draws no outline. The legacy `styles.strokeWidth` is a STRING ('1') — its converter coerces. */
|
|
4464
|
-
strokeWidth:
|
|
4542
|
+
strokeWidth: import_zod65.z.number().nonnegative().default(0)
|
|
4465
4543
|
});
|
|
4466
4544
|
|
|
4467
4545
|
// src/schema/widgets/checkout-and-beyond/separator.ts
|
|
4468
4546
|
var import_uuid13 = require("uuid");
|
|
4469
|
-
var
|
|
4470
|
-
var CABSeparatorSection =
|
|
4547
|
+
var import_zod66 = require("zod");
|
|
4548
|
+
var CABSeparatorSection = import_zod66.z.object({
|
|
4471
4549
|
...CABVariableFields,
|
|
4472
|
-
sectionId:
|
|
4473
|
-
sectionType:
|
|
4550
|
+
sectionId: import_zod66.z.uuid().default(() => (0, import_uuid13.v7)()),
|
|
4551
|
+
sectionType: import_zod66.z.literal(SectionType.separator).default(SectionType.separator)
|
|
4474
4552
|
});
|
|
4475
4553
|
|
|
4476
4554
|
// src/schema/widgets/checkout-and-beyond/variants.ts
|
|
4477
4555
|
var import_compat5 = require("es-toolkit/compat");
|
|
4478
4556
|
var import_uuid14 = require("uuid");
|
|
4479
|
-
var
|
|
4480
|
-
var CABVariantsSection =
|
|
4557
|
+
var import_zod67 = require("zod");
|
|
4558
|
+
var CABVariantsSection = import_zod67.z.object({
|
|
4481
4559
|
...CABVariableFields,
|
|
4482
|
-
hideOutOfStockVariants:
|
|
4560
|
+
hideOutOfStockVariants: import_zod67.z.boolean().default(false),
|
|
4483
4561
|
/**
|
|
4484
4562
|
* The menu's own label per buyer locale (`selectLanguage`), for the whole-variant (`single`) and the
|
|
4485
4563
|
* product-group menus; `multiple` labels each option's menu by its name. Optional and additive
|
|
@@ -4490,30 +4568,30 @@ var CABVariantsSection = import_zod65.z.object({
|
|
|
4490
4568
|
* `selectLanguage` returning `''` — which a renderer's `??` fallback would show as an empty menu label.
|
|
4491
4569
|
* A label left with no entries reads as absent.
|
|
4492
4570
|
*/
|
|
4493
|
-
label:
|
|
4571
|
+
label: import_zod67.z.record(import_zod67.z.string(), import_zod67.z.string()).transform((label) => {
|
|
4494
4572
|
const filled = (0, import_compat5.pickBy)(label, (value) => value.trim() !== "");
|
|
4495
4573
|
return (0, import_compat5.isEmpty)(filled) ? void 0 : filled;
|
|
4496
4574
|
}).optional().catch(void 0),
|
|
4497
|
-
name:
|
|
4498
|
-
sectionId:
|
|
4499
|
-
sectionType:
|
|
4500
|
-
selector:
|
|
4575
|
+
name: import_zod67.z.string().optional(),
|
|
4576
|
+
sectionId: import_zod67.z.uuid().default(() => (0, import_uuid14.v7)()),
|
|
4577
|
+
sectionType: import_zod67.z.literal(SectionType.variants).default(SectionType.variants),
|
|
4578
|
+
selector: import_zod67.z.enum((0, import_compat5.slice)(variantSelectors, 0, 3)).default(VariantSelector.menu),
|
|
4501
4579
|
/** `productGroup` is additive (REB-24817): a renderer without group support must render nothing for it. */
|
|
4502
|
-
variantMode:
|
|
4580
|
+
variantMode: import_zod67.z.enum(variantsModes).default(VariantsMode.multiple)
|
|
4503
4581
|
});
|
|
4504
4582
|
|
|
4505
4583
|
// src/schema/widgets/checkout-and-beyond/shared.ts
|
|
4506
|
-
var CABBorder =
|
|
4507
|
-
radius:
|
|
4508
|
-
style:
|
|
4509
|
-
width:
|
|
4584
|
+
var CABBorder = import_zod68.z.object({
|
|
4585
|
+
radius: import_zod68.z.enum(borderRadii).default(BorderRadius.base),
|
|
4586
|
+
style: import_zod68.z.enum(borderStyles).default(BorderStyle.none),
|
|
4587
|
+
width: import_zod68.z.enum(borderWidths).default(BorderWidth.base)
|
|
4510
4588
|
}).default({
|
|
4511
4589
|
radius: BorderRadius.base,
|
|
4512
4590
|
style: BorderStyle.none,
|
|
4513
4591
|
width: BorderWidth.base
|
|
4514
4592
|
});
|
|
4515
|
-
var CABSection =
|
|
4516
|
-
() =>
|
|
4593
|
+
var CABSection = import_zod68.z.lazy(
|
|
4594
|
+
() => import_zod68.z.discriminatedUnion("sectionType", [
|
|
4517
4595
|
CABBannerSection,
|
|
4518
4596
|
CABButtonSection,
|
|
4519
4597
|
CABCarouselSection,
|
|
@@ -4536,43 +4614,43 @@ var CABSection = import_zod66.z.lazy(
|
|
|
4536
4614
|
);
|
|
4537
4615
|
|
|
4538
4616
|
// src/schema/widgets/checkout-and-beyond/layout.ts
|
|
4539
|
-
var GridItem =
|
|
4540
|
-
var CABLayoutWrapping =
|
|
4541
|
-
breakAt:
|
|
4542
|
-
maxPerLine:
|
|
4617
|
+
var GridItem = import_zod69.z.union([import_zod69.z.literal("auto"), import_zod69.z.literal("fill"), import_zod69.z.string().regex(/^\d+%$/), import_zod69.z.number()]);
|
|
4618
|
+
var CABLayoutWrapping = import_zod69.z.object({
|
|
4619
|
+
breakAt: import_zod69.z.number().positive(),
|
|
4620
|
+
maxPerLine: import_zod69.z.number().int().positive()
|
|
4543
4621
|
});
|
|
4544
|
-
var CABLayoutSection =
|
|
4622
|
+
var CABLayoutSection = import_zod69.z.object({
|
|
4545
4623
|
...CABVariableFields,
|
|
4546
|
-
alignment:
|
|
4547
|
-
horizontal:
|
|
4548
|
-
vertical:
|
|
4624
|
+
alignment: import_zod69.z.object({
|
|
4625
|
+
horizontal: import_zod69.z.enum(horizontalAlignments).default(HorizontalAlignment.start),
|
|
4626
|
+
vertical: import_zod69.z.enum(verticalAlignments).default(VerticalAlignment.top)
|
|
4549
4627
|
}).default({
|
|
4550
4628
|
horizontal: HorizontalAlignment.start,
|
|
4551
4629
|
vertical: VerticalAlignment.top
|
|
4552
4630
|
}),
|
|
4553
|
-
border:
|
|
4554
|
-
buttonField:
|
|
4555
|
-
direction:
|
|
4631
|
+
border: import_zod69.z.lazy(() => CABBorder),
|
|
4632
|
+
buttonField: import_zod69.z.enum(buttonFields).optional(),
|
|
4633
|
+
direction: import_zod69.z.enum(directions).default(Direction.rows),
|
|
4556
4634
|
/**
|
|
4557
4635
|
* Platform chrome around the section, not a layout behavior: `callout` is a subdued box with block borders
|
|
4558
4636
|
* (the legacy post-purchase callout banner), `offer-content` the post-purchase offer's own content column
|
|
4559
4637
|
* (legacy `ComponentSectionLayout`), which the converter puts around the text, image and image-with-text
|
|
4560
4638
|
* blocks. The offers section is never framed: the renderers place it in that column themselves.
|
|
4561
4639
|
*/
|
|
4562
|
-
frame:
|
|
4563
|
-
grid:
|
|
4564
|
-
columns:
|
|
4565
|
-
rows:
|
|
4640
|
+
frame: import_zod69.z.enum(layoutFrames).optional(),
|
|
4641
|
+
grid: import_zod69.z.object({
|
|
4642
|
+
columns: import_zod69.z.union([import_zod69.z.array(GridItem), import_zod69.z.undefined()]).default(() => ["auto"]),
|
|
4643
|
+
rows: import_zod69.z.union([import_zod69.z.array(GridItem), import_zod69.z.undefined()]).default(() => ["auto"])
|
|
4566
4644
|
}).default({ columns: ["auto"], rows: ["auto"] }).optional(),
|
|
4567
|
-
name:
|
|
4568
|
-
padding:
|
|
4569
|
-
sectionId:
|
|
4570
|
-
sections:
|
|
4571
|
-
sectionType:
|
|
4572
|
-
spacing:
|
|
4645
|
+
name: import_zod69.z.string().optional(),
|
|
4646
|
+
padding: import_zod69.z.enum(spacings).default(Spacing.none),
|
|
4647
|
+
sectionId: import_zod69.z.uuid().default(() => (0, import_uuid15.v7)()),
|
|
4648
|
+
sections: import_zod69.z.union([import_zod69.z.array(import_zod69.z.lazy(() => CABSection)), import_zod69.z.strictObject({}).transform(() => [])]).default(() => []),
|
|
4649
|
+
sectionType: import_zod69.z.literal(SectionType.layout).default(SectionType.layout),
|
|
4650
|
+
spacing: import_zod69.z.enum(spacings).default(Spacing.base),
|
|
4573
4651
|
/** Fire-and-forget impression pixel POSTed once when the section is shown (e.g. a Monetize offer view). */
|
|
4574
|
-
viewUrl:
|
|
4575
|
-
width:
|
|
4652
|
+
viewUrl: import_zod69.z.string().optional(),
|
|
4653
|
+
width: import_zod69.z.number().default(100),
|
|
4576
4654
|
wrapping: CABLayoutWrapping.optional()
|
|
4577
4655
|
});
|
|
4578
4656
|
|
|
@@ -4594,8 +4672,8 @@ var UI_LABELS = {
|
|
|
4594
4672
|
};
|
|
4595
4673
|
|
|
4596
4674
|
// src/schema/widgets/checkout-and-beyond/root.ts
|
|
4597
|
-
var localized = (fallback) =>
|
|
4598
|
-
var CABUILabels =
|
|
4675
|
+
var localized = (fallback) => import_zod70.z.record(import_zod70.z.string(), import_zod70.z.string()).default(() => ({ ...fallback })).transform((labels) => Object.keys(labels).length > 0 ? labels : { ...fallback });
|
|
4676
|
+
var CABUILabels = import_zod70.z.object({
|
|
4599
4677
|
currentPage: localized(UI_LABELS.currentPage),
|
|
4600
4678
|
guest: localized(UI_LABELS.guest),
|
|
4601
4679
|
loadingOptions: localized(UI_LABELS.loadingOptions),
|
|
@@ -4620,50 +4698,50 @@ var CABUILabels = import_zod68.z.object({
|
|
|
4620
4698
|
subscriptionOptions: { ...UI_LABELS.subscriptionOptions },
|
|
4621
4699
|
updating: { ...UI_LABELS.updating }
|
|
4622
4700
|
}));
|
|
4623
|
-
var TargetArea =
|
|
4624
|
-
fill:
|
|
4625
|
-
flip:
|
|
4626
|
-
icon:
|
|
4627
|
-
label:
|
|
4628
|
-
width:
|
|
4701
|
+
var TargetArea = import_zod70.z.object({
|
|
4702
|
+
fill: import_zod70.z.boolean().optional(),
|
|
4703
|
+
flip: import_zod70.z.enum(["both", "horizontal", "vertical"]).optional(),
|
|
4704
|
+
icon: import_zod70.z.string(),
|
|
4705
|
+
label: import_zod70.z.string(),
|
|
4706
|
+
width: import_zod70.z.string()
|
|
4629
4707
|
}).default(targetAreas[EditorMode.checkoutExtension][1]);
|
|
4630
|
-
var CABTracking =
|
|
4631
|
-
enableAttribution:
|
|
4632
|
-
enableSource:
|
|
4633
|
-
enableWidget:
|
|
4708
|
+
var CABTracking = import_zod70.z.object({
|
|
4709
|
+
enableAttribution: import_zod70.z.boolean().nullish().transform((value) => value ?? true),
|
|
4710
|
+
enableSource: import_zod70.z.boolean().nullish().transform((value) => value ?? true),
|
|
4711
|
+
enableWidget: import_zod70.z.boolean().nullish().transform((value) => value ?? true)
|
|
4634
4712
|
}).nullish().transform((value) => value ?? { enableAttribution: true, enableSource: true, enableWidget: true });
|
|
4635
|
-
var CABExperiment =
|
|
4636
|
-
elementId:
|
|
4637
|
-
experimentId:
|
|
4638
|
-
experimentType:
|
|
4639
|
-
selectedId:
|
|
4713
|
+
var CABExperiment = import_zod70.z.object({
|
|
4714
|
+
elementId: import_zod70.z.number(),
|
|
4715
|
+
experimentId: import_zod70.z.number(),
|
|
4716
|
+
experimentType: import_zod70.z.string(),
|
|
4717
|
+
selectedId: import_zod70.z.number()
|
|
4640
4718
|
});
|
|
4641
4719
|
var CABRootSection = CABLayoutSection.extend({
|
|
4642
|
-
editorMode:
|
|
4720
|
+
editorMode: import_zod70.z.enum(editorModes).default(EditorMode.checkoutExtension),
|
|
4643
4721
|
experiment: CABExperiment.optional(),
|
|
4644
4722
|
// Same rule as CABTracking above: the v1 converters pass raw legacy `previewMode` through, so a
|
|
4645
4723
|
// `null` must fall back rather than throw the widget; malformed values still throw.
|
|
4646
|
-
previewMode:
|
|
4647
|
-
storeId:
|
|
4724
|
+
previewMode: import_zod70.z.boolean().nullish().transform((value) => value ?? false),
|
|
4725
|
+
storeId: import_zod70.z.number().nullable().default(null),
|
|
4648
4726
|
targetArea: TargetArea.nullable(),
|
|
4649
4727
|
tracking: CABTracking,
|
|
4650
|
-
type:
|
|
4728
|
+
type: import_zod70.z.enum(widgetTypes).default(WidgetType.ui_extension_content_block),
|
|
4651
4729
|
uiLabels: CABUILabels,
|
|
4652
|
-
version:
|
|
4653
|
-
widgetId:
|
|
4730
|
+
version: import_zod70.z.literal(2).default(2),
|
|
4731
|
+
widgetId: import_zod70.z.number().nullable().default(null)
|
|
4654
4732
|
});
|
|
4655
4733
|
|
|
4656
4734
|
// src/schema/postPurchaseProductView.ts
|
|
4657
|
-
var StsMarker =
|
|
4658
|
-
var PostPurchaseProductView =
|
|
4659
|
-
|
|
4735
|
+
var StsMarker = import_zod71.z.literal(true).optional();
|
|
4736
|
+
var PostPurchaseProductView = import_zod71.z.union([
|
|
4737
|
+
import_zod71.z.object({
|
|
4660
4738
|
changeset: PostPurchaseProductChangeset.optional(),
|
|
4661
4739
|
displayPrice: PostPurchaseDisplayPrice.optional(),
|
|
4662
4740
|
groupCatalog: PostPurchaseGroupCatalog.optional(),
|
|
4663
4741
|
initialVariant: PostPurchaseVariantSelector.optional(),
|
|
4664
4742
|
planCatalog: PostPurchasePlanCatalog.nullable().optional(),
|
|
4665
4743
|
preparation: PreparedPostPurchaseProduct.extend({
|
|
4666
|
-
display: PreparedPostPurchaseProduct.shape.display.extend({ description:
|
|
4744
|
+
display: PreparedPostPurchaseProduct.shape.display.extend({ description: import_zod71.z.string().nullable() }).refine(
|
|
4667
4745
|
({ description, descriptionDocument }) => description === null === (descriptionDocument !== void 0),
|
|
4668
4746
|
"Exactly one of the plain and rich descriptions is shown"
|
|
4669
4747
|
)
|
|
@@ -4673,7 +4751,7 @@ var PostPurchaseProductView = import_zod69.z.union([
|
|
|
4673
4751
|
sts: StsMarker,
|
|
4674
4752
|
variantCatalog: PostPurchaseVariantCatalog.optional()
|
|
4675
4753
|
}),
|
|
4676
|
-
|
|
4754
|
+
import_zod71.z.object({
|
|
4677
4755
|
groupCatalog: PostPurchaseGroupCatalog.optional(),
|
|
4678
4756
|
initialVariant: PostPurchaseVariantSelector.optional(),
|
|
4679
4757
|
/** The localized unavailable copy, for the choices still offered beneath an unprepared product. */
|
|
@@ -4689,21 +4767,21 @@ var PostPurchaseProductView = import_zod69.z.union([
|
|
|
4689
4767
|
]);
|
|
4690
4768
|
|
|
4691
4769
|
// src/schema/postPurchaseProductCollectionView.ts
|
|
4692
|
-
var PostPurchaseProductCollectionView =
|
|
4693
|
-
members:
|
|
4694
|
-
|
|
4770
|
+
var PostPurchaseProductCollectionView = import_zod72.z.object({
|
|
4771
|
+
members: import_zod72.z.array(
|
|
4772
|
+
import_zod72.z.object({
|
|
4695
4773
|
productId: PostPurchaseProductId,
|
|
4696
|
-
productIndex:
|
|
4774
|
+
productIndex: import_zod72.z.number().int().nonnegative(),
|
|
4697
4775
|
view: PostPurchaseProductView
|
|
4698
4776
|
})
|
|
4699
4777
|
)
|
|
4700
4778
|
});
|
|
4701
|
-
var PostPurchaseCollectionChoice =
|
|
4779
|
+
var PostPurchaseCollectionChoice = import_zod72.z.object({
|
|
4702
4780
|
choice: PostPurchaseChoice.optional(),
|
|
4703
4781
|
productId: PostPurchaseProductId,
|
|
4704
4782
|
variantId: PostPurchaseVariantSelector.shape.variantId.optional()
|
|
4705
4783
|
}).strict();
|
|
4706
|
-
var PostPurchaseExcludedProductIds =
|
|
4784
|
+
var PostPurchaseExcludedProductIds = import_zod72.z.array(PostPurchaseProductId).default([]);
|
|
4707
4785
|
var PostPurchaseMemberSelector = PostPurchaseProgressSchema.shape.members.element.pick({ productId: true }).extend({ progressRevision: PostPurchaseProgressSchema.shape.revision });
|
|
4708
4786
|
var PostPurchaseMemberPointer = PostPurchaseProgressSchema.shape.members.element.omit({ status: true }).extend({
|
|
4709
4787
|
entryRevision: PostPurchaseProgressSchema.shape.entryRevision,
|
|
@@ -4716,7 +4794,7 @@ var PostPurchaseQuantityChoice = PostPurchaseCollectionChoice.extend({ quantity:
|
|
|
4716
4794
|
var PostPurchaseQuantityPolicy = PostPurchaseSettings.shape.quantityInputs.omit({ defaultQuantity: true }).extend({
|
|
4717
4795
|
initialQuantity: quantity,
|
|
4718
4796
|
maxValue: quantity,
|
|
4719
|
-
minValue:
|
|
4797
|
+
minValue: import_zod73.z.literal(0).transform(() => 1).or(quantity)
|
|
4720
4798
|
}).refine(({ maxValue, minValue }) => minValue <= maxValue, "Quantity bounds are reversed");
|
|
4721
4799
|
|
|
4722
4800
|
// src/schema/postPurchaseGroup.ts
|
|
@@ -4725,33 +4803,33 @@ var PostPurchaseGroupChoice = PostPurchaseQuantityChoice.extend({
|
|
|
4725
4803
|
});
|
|
4726
4804
|
|
|
4727
4805
|
// src/schema/postPurchaseHealth.ts
|
|
4728
|
-
var
|
|
4806
|
+
var import_zod76 = require("zod");
|
|
4729
4807
|
|
|
4730
4808
|
// src/schema/postPurchaseHealthSchedule.ts
|
|
4731
|
-
var
|
|
4809
|
+
var import_zod75 = require("zod");
|
|
4732
4810
|
|
|
4733
4811
|
// src/schema/postPurchaseReleaseSchedule.ts
|
|
4734
|
-
var
|
|
4735
|
-
var postPurchaseTaskNameSchema = (queue, id) =>
|
|
4736
|
-
var SessionReleaseScheduleRequestSchema =
|
|
4812
|
+
var import_zod74 = require("zod");
|
|
4813
|
+
var postPurchaseTaskNameSchema = (queue, id) => import_zod74.z.string().regex(new RegExp(`^projects/[a-zA-Z0-9.:-]+/locations/us-central1/queues/${queue}/tasks/${id}$`));
|
|
4814
|
+
var SessionReleaseScheduleRequestSchema = import_zod74.z.strictObject({
|
|
4737
4815
|
deadline: PostPurchaseTimestampSchema,
|
|
4738
4816
|
orderId: PostPurchaseOrderIdSchema,
|
|
4739
4817
|
releaseOwner: ReleaseOwnerSchema,
|
|
4740
4818
|
sessionId: PostPurchaseSessionIdSchema
|
|
4741
4819
|
});
|
|
4742
|
-
var SessionReleaseScheduleResponseSchema =
|
|
4743
|
-
data:
|
|
4820
|
+
var SessionReleaseScheduleResponseSchema = import_zod74.z.object({
|
|
4821
|
+
data: import_zod74.z.discriminatedUnion("status", [
|
|
4744
4822
|
SessionReleaseScheduleRequestSchema.extend({
|
|
4745
|
-
releaseOwner:
|
|
4746
|
-
status:
|
|
4823
|
+
releaseOwner: import_zod74.z.literal("rebuy"),
|
|
4824
|
+
status: import_zod74.z.literal("queued"),
|
|
4747
4825
|
taskName: postPurchaseTaskNameSchema("post-purchase-order-hold-release", "[a-f0-9]{64}-release")
|
|
4748
4826
|
}),
|
|
4749
4827
|
SessionReleaseScheduleRequestSchema.extend({
|
|
4750
|
-
releaseOwner:
|
|
4751
|
-
status:
|
|
4828
|
+
releaseOwner: import_zod74.z.literal("shopify"),
|
|
4829
|
+
status: import_zod74.z.literal("native")
|
|
4752
4830
|
})
|
|
4753
4831
|
]),
|
|
4754
|
-
successful:
|
|
4832
|
+
successful: import_zod74.z.literal(true)
|
|
4755
4833
|
});
|
|
4756
4834
|
|
|
4757
4835
|
// src/schema/postPurchaseHealthSchedule.ts
|
|
@@ -4760,15 +4838,15 @@ var PostPurchaseHealthTaskNameSchema = postPurchaseTaskNameSchema(
|
|
|
4760
4838
|
"post-purchase-health-check",
|
|
4761
4839
|
"[a-z0-9][a-z0-9-]*--[1-9][0-9]*"
|
|
4762
4840
|
);
|
|
4763
|
-
var HealthScheduleAcknowledgementSchema =
|
|
4841
|
+
var HealthScheduleAcknowledgementSchema = import_zod75.z.strictObject({
|
|
4764
4842
|
data: HealthScheduleSchema.extend({
|
|
4765
|
-
status:
|
|
4843
|
+
status: import_zod75.z.literal("queued"),
|
|
4766
4844
|
taskName: PostPurchaseHealthTaskNameSchema
|
|
4767
4845
|
}).refine(
|
|
4768
4846
|
(data) => data.taskName.endsWith(`/tasks/${postPurchaseHealthTaskId(data)}`),
|
|
4769
4847
|
"taskName must be this order's health task"
|
|
4770
4848
|
),
|
|
4771
|
-
successful:
|
|
4849
|
+
successful: import_zod75.z.literal(true)
|
|
4772
4850
|
});
|
|
4773
4851
|
|
|
4774
4852
|
// src/schema/postPurchaseHealth.ts
|
|
@@ -4777,7 +4855,7 @@ var HealthFactSchema = HealthScheduleSchema.pick({
|
|
|
4777
4855
|
operationId: true,
|
|
4778
4856
|
removePartialOrder: true
|
|
4779
4857
|
});
|
|
4780
|
-
var HealthScheduleReceiptSchema =
|
|
4858
|
+
var HealthScheduleReceiptSchema = import_zod76.z.strictObject({
|
|
4781
4859
|
recordedAt: PostPurchaseTimestampSchema,
|
|
4782
4860
|
taskName: PostPurchaseHealthTaskNameSchema
|
|
4783
4861
|
});
|
|
@@ -4787,52 +4865,52 @@ var StoredHealthFactSchema = HealthFactSchema.extend({
|
|
|
4787
4865
|
});
|
|
4788
4866
|
var HealthAttemptSchema = StoredHealthFactSchema.extend({
|
|
4789
4867
|
attemptedAt: PostPurchaseTimestampSchema,
|
|
4790
|
-
attemptId:
|
|
4791
|
-
status:
|
|
4868
|
+
attemptId: import_zod76.z.uuid(),
|
|
4869
|
+
status: import_zod76.z.literal("attempted")
|
|
4792
4870
|
});
|
|
4793
4871
|
var HealthResultSchema = HealthAttemptSchema.extend({
|
|
4794
4872
|
finishedAt: PostPurchaseTimestampSchema,
|
|
4795
|
-
status:
|
|
4873
|
+
status: import_zod76.z.enum(["returned", "unknown"])
|
|
4796
4874
|
});
|
|
4797
|
-
var HealthStateSchema =
|
|
4798
|
-
StoredHealthFactSchema.extend({ status:
|
|
4875
|
+
var HealthStateSchema = import_zod76.z.union([
|
|
4876
|
+
StoredHealthFactSchema.extend({ status: import_zod76.z.literal("pending") }),
|
|
4799
4877
|
HealthAttemptSchema,
|
|
4800
4878
|
HealthResultSchema
|
|
4801
4879
|
]);
|
|
4802
4880
|
var HealthPrepareRequestSchema = DecideRequestSchema.extend({
|
|
4803
4881
|
operationId: HealthScheduleSchema.shape.operationId
|
|
4804
4882
|
}).strict();
|
|
4805
|
-
var HealthPrepareResponseSchema =
|
|
4806
|
-
var HealthClaimRequestSchema =
|
|
4883
|
+
var HealthPrepareResponseSchema = import_zod76.z.object({ data: HealthScheduleSchema, successful: import_zod76.z.literal(true) });
|
|
4884
|
+
var HealthClaimRequestSchema = import_zod76.z.strictObject({
|
|
4807
4885
|
orderId: PostPurchaseOrderIdSchema,
|
|
4808
|
-
removePartialOrder:
|
|
4886
|
+
removePartialOrder: import_zod76.z.boolean(),
|
|
4809
4887
|
shop: ShopifyDomainSchema
|
|
4810
4888
|
});
|
|
4811
4889
|
var HealthClaimFactSchema = HealthClaimRequestSchema.extend({
|
|
4812
4890
|
healthScheduledAt: HealthFactSchema.shape.healthScheduledAt
|
|
4813
4891
|
});
|
|
4814
|
-
var HealthClaimResponseSchema =
|
|
4815
|
-
data:
|
|
4816
|
-
|
|
4817
|
-
HealthClaimFactSchema.extend({ status:
|
|
4818
|
-
HealthClaimFactSchema.extend({ attemptId: HealthAttemptSchema.shape.attemptId, status:
|
|
4892
|
+
var HealthClaimResponseSchema = import_zod76.z.object({
|
|
4893
|
+
data: import_zod76.z.union([
|
|
4894
|
+
import_zod76.z.strictObject({ status: import_zod76.z.literal("missing") }),
|
|
4895
|
+
HealthClaimFactSchema.extend({ status: import_zod76.z.enum(["pending", "attempted", "returned", "unknown"]) }),
|
|
4896
|
+
HealthClaimFactSchema.extend({ attemptId: HealthAttemptSchema.shape.attemptId, status: import_zod76.z.literal("claimed") })
|
|
4819
4897
|
]),
|
|
4820
|
-
successful:
|
|
4898
|
+
successful: import_zod76.z.literal(true)
|
|
4821
4899
|
});
|
|
4822
4900
|
var HealthResultRequestSchema = HealthClaimRequestSchema.extend({
|
|
4823
4901
|
attemptId: HealthAttemptSchema.shape.attemptId,
|
|
4824
4902
|
outcome: HealthResultSchema.shape.status
|
|
4825
4903
|
});
|
|
4826
|
-
var HealthResultResponseSchema =
|
|
4904
|
+
var HealthResultResponseSchema = import_zod76.z.object({
|
|
4827
4905
|
data: HealthClaimFactSchema.extend({
|
|
4828
4906
|
finishedAt: HealthResultSchema.shape.finishedAt,
|
|
4829
4907
|
status: HealthResultSchema.shape.status
|
|
4830
4908
|
}),
|
|
4831
|
-
successful:
|
|
4909
|
+
successful: import_zod76.z.literal(true)
|
|
4832
4910
|
});
|
|
4833
4911
|
|
|
4834
4912
|
// src/schema/postPurchaseLedger.ts
|
|
4835
|
-
var
|
|
4913
|
+
var import_zod77 = require("zod");
|
|
4836
4914
|
var CLIENT_LEDGER_MAX_EVENTS = 16;
|
|
4837
4915
|
var CLIENT_LEDGER_TYPES = [
|
|
4838
4916
|
"decision.verdict",
|
|
@@ -4842,125 +4920,125 @@ var CLIENT_LEDGER_TYPES = [
|
|
|
4842
4920
|
"render.gate",
|
|
4843
4921
|
"shouldRender.selectedFlow"
|
|
4844
4922
|
];
|
|
4845
|
-
var ClientLedgerPayloadValueSchema =
|
|
4846
|
-
var ClientLedgerEventSchema =
|
|
4923
|
+
var ClientLedgerPayloadValueSchema = import_zod77.z.union([import_zod77.z.string().max(256), import_zod77.z.number().finite(), import_zod77.z.boolean()]);
|
|
4924
|
+
var ClientLedgerEventSchema = import_zod77.z.strictObject({
|
|
4847
4925
|
/** The client's diagnostic id for one Shopify context; `(instance, seq)` names a row. */
|
|
4848
|
-
instance:
|
|
4849
|
-
payload:
|
|
4850
|
-
phase:
|
|
4926
|
+
instance: import_zod77.z.string().regex(/^[A-Za-z0-9_-]{1,64}$/),
|
|
4927
|
+
payload: import_zod77.z.record(import_zod77.z.string().regex(/^[A-Za-z][A-Za-z0-9_.()]{0,63}$/), ClientLedgerPayloadValueSchema).refine((payload) => Object.keys(payload).length <= 24, "At most 24 payload members"),
|
|
4928
|
+
phase: import_zod77.z.enum(["render", "shouldRender"]),
|
|
4851
4929
|
/** `-1` is the dev-store runtime probe's row (cab-post-purchase `dev-store/runtimeProbe.ts`). */
|
|
4852
|
-
seq:
|
|
4930
|
+
seq: import_zod77.z.number().int().min(-1).max(1e5),
|
|
4853
4931
|
/** The client's clock when it observed the row, as the legacy client rows carry it. */
|
|
4854
|
-
ts:
|
|
4855
|
-
type:
|
|
4932
|
+
ts: import_zod77.z.iso.datetime(),
|
|
4933
|
+
type: import_zod77.z.enum(CLIENT_LEDGER_TYPES)
|
|
4856
4934
|
});
|
|
4857
|
-
var ClientLedgerRequestSchema =
|
|
4858
|
-
events:
|
|
4935
|
+
var ClientLedgerRequestSchema = import_zod77.z.object({
|
|
4936
|
+
events: import_zod77.z.array(ClientLedgerEventSchema).min(1).max(CLIENT_LEDGER_MAX_EVENTS)
|
|
4859
4937
|
});
|
|
4860
4938
|
|
|
4861
4939
|
// src/schema/postPurchaseLifecycle.ts
|
|
4862
|
-
var
|
|
4863
|
-
var Presentation =
|
|
4940
|
+
var import_zod78 = require("zod");
|
|
4941
|
+
var Presentation = import_zod78.z.strictObject({
|
|
4864
4942
|
member: PostPurchaseMemberIdentity,
|
|
4865
4943
|
selectedProductId: PostPurchaseMemberIdentity.shape.productId.optional(),
|
|
4866
4944
|
variant: PostPurchaseVariantSelector
|
|
4867
4945
|
});
|
|
4868
4946
|
var LifecycleObservationRequestSchema = DecideRequestSchema.extend({
|
|
4869
4947
|
entryRevision: PostPurchaseProgressSchema.shape.entryRevision,
|
|
4870
|
-
eventType:
|
|
4948
|
+
eventType: import_zod78.z.enum(["OFFER_VIEWED", "OFFER_TIMER_EXPIRED"]),
|
|
4871
4949
|
presentation: Presentation.nullable(),
|
|
4872
4950
|
progressRevision: PostPurchaseProgressSchema.shape.revision,
|
|
4873
|
-
requestId:
|
|
4951
|
+
requestId: import_zod78.z.uuid()
|
|
4874
4952
|
}).strict().refine(
|
|
4875
4953
|
({ eventType, presentation }) => eventType !== "OFFER_VIEWED" || presentation !== null,
|
|
4876
4954
|
"Viewed observations require a presented product"
|
|
4877
4955
|
);
|
|
4878
|
-
var LifecycleObservationResponseSchema =
|
|
4879
|
-
data:
|
|
4956
|
+
var LifecycleObservationResponseSchema = import_zod78.z.object({
|
|
4957
|
+
data: import_zod78.z.strictObject({
|
|
4880
4958
|
requestId: LifecycleObservationRequestSchema.shape.requestId,
|
|
4881
|
-
status:
|
|
4959
|
+
status: import_zod78.z.union([AcceptedEventOutcomeSchema, import_zod78.z.literal("unavailable")])
|
|
4882
4960
|
}),
|
|
4883
|
-
successful:
|
|
4961
|
+
successful: import_zod78.z.literal(true)
|
|
4884
4962
|
});
|
|
4885
4963
|
|
|
4886
4964
|
// src/schema/postPurchaseOffer.ts
|
|
4887
|
-
var
|
|
4965
|
+
var import_zod79 = require("zod");
|
|
4888
4966
|
var OfferPreparationRequestSchema = DecideRequestSchema.strict();
|
|
4889
|
-
var OfferPreparationResponseSchema =
|
|
4890
|
-
data:
|
|
4891
|
-
successful:
|
|
4967
|
+
var OfferPreparationResponseSchema = import_zod79.z.object({
|
|
4968
|
+
data: import_zod79.z.object({ attemptedSkips: PostPurchaseSkipTraceSchema.optional(), progress: PostPurchaseProgressSchema }),
|
|
4969
|
+
successful: import_zod79.z.literal(true)
|
|
4892
4970
|
});
|
|
4893
4971
|
|
|
4894
4972
|
// src/schema/postPurchaseOfferEligibility.ts
|
|
4895
|
-
var
|
|
4973
|
+
var import_zod80 = require("zod");
|
|
4896
4974
|
var selection2 = PreparedPostPurchaseProduct.shape.selection;
|
|
4897
|
-
var PostPurchaseOfferSkipReason =
|
|
4898
|
-
var PostPurchaseOfferUnavailableReason =
|
|
4975
|
+
var PostPurchaseOfferSkipReason = import_zod80.z.enum(["empty", "no-eligible-subscription"]);
|
|
4976
|
+
var PostPurchaseOfferUnavailableReason = import_zod80.z.enum([
|
|
4899
4977
|
"catalog-unreadable",
|
|
4900
4978
|
"context-unreadable",
|
|
4901
4979
|
"eligible-sts",
|
|
4902
4980
|
"settings-unreadable"
|
|
4903
4981
|
]);
|
|
4904
|
-
var PostPurchaseOfferEligibilityContext =
|
|
4982
|
+
var PostPurchaseOfferEligibilityContext = import_zod80.z.object({
|
|
4905
4983
|
excludedProductIds: PostPurchaseExcludedProductIds,
|
|
4906
|
-
originalLineItems:
|
|
4984
|
+
originalLineItems: import_zod80.z.array(selection2.pick({ productId: true, sellingPlanId: true, variantId: true }))
|
|
4907
4985
|
});
|
|
4908
|
-
var PostPurchaseStsOptions =
|
|
4909
|
-
var PostPurchaseStsContext =
|
|
4910
|
-
originalLineItems:
|
|
4986
|
+
var PostPurchaseStsOptions = import_zod80.z.object({ sts: import_zod80.z.boolean().optional() }).strict();
|
|
4987
|
+
var PostPurchaseStsContext = import_zod80.z.object({
|
|
4988
|
+
originalLineItems: import_zod80.z.array(
|
|
4911
4989
|
selection2.pick({ productId: true, quantity: true, sellingPlanId: true, variantId: true })
|
|
4912
4990
|
)
|
|
4913
4991
|
});
|
|
4914
|
-
var PostPurchaseOfferEligibility =
|
|
4915
|
-
|
|
4916
|
-
members:
|
|
4917
|
-
|
|
4992
|
+
var PostPurchaseOfferEligibility = import_zod80.z.discriminatedUnion("status", [
|
|
4993
|
+
import_zod80.z.object({
|
|
4994
|
+
members: import_zod80.z.array(
|
|
4995
|
+
import_zod80.z.object({ productId: selection2.shape.productId, productIndex: import_zod80.z.number().int().nonnegative() })
|
|
4918
4996
|
),
|
|
4919
4997
|
/** Present only with STS on: each member switches one original one-time line to subscription. */
|
|
4920
|
-
mode:
|
|
4921
|
-
status:
|
|
4998
|
+
mode: import_zod80.z.literal("sts").optional(),
|
|
4999
|
+
status: import_zod80.z.literal("retain")
|
|
4922
5000
|
}),
|
|
4923
|
-
|
|
5001
|
+
import_zod80.z.object({ reason: PostPurchaseOfferSkipReason, status: import_zod80.z.literal("skip") }),
|
|
4924
5002
|
/** The classifier always names a reason; it stays optional so a reasonless answer from before still parses. */
|
|
4925
|
-
|
|
5003
|
+
import_zod80.z.object({ reason: PostPurchaseOfferUnavailableReason.optional(), status: import_zod80.z.literal("unavailable") })
|
|
4926
5004
|
]);
|
|
4927
5005
|
|
|
4928
5006
|
// src/schema/postPurchaseOfferPresentation.ts
|
|
4929
|
-
var
|
|
5007
|
+
var import_zod81 = require("zod");
|
|
4930
5008
|
var language2 = PostPurchaseSettings.shape.language.shape.global.unwrap().unwrap();
|
|
4931
|
-
var PostPurchaseOfferPresentation =
|
|
5009
|
+
var PostPurchaseOfferPresentation = import_zod81.z.strictObject({
|
|
4932
5010
|
labels: language2.pick({ declineAll: true, declineThisOffer: true }),
|
|
4933
5011
|
layout: PostPurchaseSettings.shape.offersLayout,
|
|
4934
5012
|
sections: CABRootSection.nullable(),
|
|
4935
5013
|
showDeclineAll: PostPurchaseSettings.shape.productOptions.shape.showDeclineAll
|
|
4936
5014
|
});
|
|
4937
5015
|
var OfferPresentationRequestSchema = DecideRequestSchema.strict();
|
|
4938
|
-
var OfferPresentationResponseSchema =
|
|
4939
|
-
data:
|
|
5016
|
+
var OfferPresentationResponseSchema = import_zod81.z.object({
|
|
5017
|
+
data: import_zod81.z.strictObject({
|
|
4940
5018
|
presentation: PostPurchaseOfferPresentation.nullable(),
|
|
4941
5019
|
progress: PostPurchaseProgressSchema.nullable(),
|
|
4942
5020
|
serverNow: PostPurchaseTimestampSchema
|
|
4943
5021
|
}),
|
|
4944
|
-
successful:
|
|
5022
|
+
successful: import_zod81.z.literal(true)
|
|
4945
5023
|
});
|
|
4946
5024
|
|
|
4947
5025
|
// src/schema/postPurchaseOrderDecision.ts
|
|
4948
|
-
var
|
|
4949
|
-
var OrderDecisionSchema =
|
|
4950
|
-
|
|
4951
|
-
|
|
5026
|
+
var import_zod82 = require("zod");
|
|
5027
|
+
var OrderDecisionSchema = import_zod82.z.discriminatedUnion("owner", [
|
|
5028
|
+
import_zod82.z.object({ owner: import_zod82.z.literal("session"), sessionId: PostPurchaseSessionIdSchema }),
|
|
5029
|
+
import_zod82.z.object({ owner: import_zod82.z.literal("release"), sessionId: import_zod82.z.null() })
|
|
4952
5030
|
]);
|
|
4953
5031
|
|
|
4954
5032
|
// src/schema/postPurchasePolicy.ts
|
|
4955
|
-
var
|
|
4956
|
-
var HoldSettingSchema =
|
|
4957
|
-
|
|
4958
|
-
|
|
5033
|
+
var import_zod83 = require("zod");
|
|
5034
|
+
var HoldSettingSchema = import_zod83.z.discriminatedUnion("enabled", [
|
|
5035
|
+
import_zod83.z.object({ durationMinutes: import_zod83.z.number().int().min(1).max(60), enabled: import_zod83.z.literal(true) }),
|
|
5036
|
+
import_zod83.z.object({ durationMinutes: import_zod83.z.null(), enabled: import_zod83.z.literal(false) })
|
|
4959
5037
|
]);
|
|
4960
|
-
var TimingSettingsSchema =
|
|
5038
|
+
var TimingSettingsSchema = import_zod83.z.object({ flowHold: HoldSettingSchema, shopHold: HoldSettingSchema });
|
|
4961
5039
|
var SessionPolicySchema = TimingSettingsSchema.extend({
|
|
4962
|
-
durationMinutes:
|
|
4963
|
-
source:
|
|
5040
|
+
durationMinutes: import_zod83.z.number().int().min(1).max(60).nullable(),
|
|
5041
|
+
source: import_zod83.z.enum(["shop", "flow", "native"])
|
|
4964
5042
|
}).refine(
|
|
4965
5043
|
(policy) => {
|
|
4966
5044
|
const expectedSource = policy.shopHold.enabled ? "shop" : policy.flowHold.enabled ? "flow" : "native";
|
|
@@ -4974,8 +5052,8 @@ var SessionPolicySchema = TimingSettingsSchema.extend({
|
|
|
4974
5052
|
);
|
|
4975
5053
|
|
|
4976
5054
|
// src/schema/postPurchasePreparationOptions.ts
|
|
4977
|
-
var
|
|
4978
|
-
var PostPurchasePreparationOptions =
|
|
5055
|
+
var import_zod84 = require("zod");
|
|
5056
|
+
var PostPurchasePreparationOptions = import_zod84.z.object({
|
|
4979
5057
|
choice: PostPurchaseChoice.optional(),
|
|
4980
5058
|
member: PostPurchaseMemberSelector.strict().optional(),
|
|
4981
5059
|
quantity: PreparedPostPurchaseProduct.shape.selection.shape.quantity.optional(),
|
|
@@ -4987,8 +5065,8 @@ var PostPurchasePreparationOptions = import_zod82.z.object({
|
|
|
4987
5065
|
);
|
|
4988
5066
|
|
|
4989
5067
|
// src/schema/postPurchaseProductSettings.ts
|
|
4990
|
-
var
|
|
4991
|
-
var amount =
|
|
5068
|
+
var import_zod85 = require("zod");
|
|
5069
|
+
var amount = import_zod85.z.union([import_zod85.z.number().nonnegative(), PostPurchaseAmount.transform(Number)]);
|
|
4992
5070
|
var PostPurchaseProductSettings = PostPurchaseSettings.pick({
|
|
4993
5071
|
discountedFrom: true,
|
|
4994
5072
|
language: true,
|
|
@@ -5000,32 +5078,32 @@ var PostPurchaseProductSettings = PostPurchaseSettings.pick({
|
|
|
5000
5078
|
subscriptionIsDefault: true,
|
|
5001
5079
|
upgradeToSubscription: true
|
|
5002
5080
|
}).extend({
|
|
5003
|
-
advance:
|
|
5004
|
-
blocks:
|
|
5081
|
+
advance: import_zod85.z.unknown().default({}),
|
|
5082
|
+
blocks: import_zod85.z.array(import_zod85.z.unknown()).optional(),
|
|
5005
5083
|
discount: PostPurchaseSettings.shape.discount.extend({ amount: amount.default(30) }),
|
|
5006
|
-
integrations:
|
|
5084
|
+
integrations: import_zod85.z.unknown().default({}),
|
|
5007
5085
|
shipping: PostPurchaseSettings.shape.shipping.extend({ amount: amount.default(10) }),
|
|
5008
|
-
styles:
|
|
5086
|
+
styles: import_zod85.z.unknown().default({}),
|
|
5009
5087
|
subImages: PostPurchaseSettings.shape.subImages.catch(null),
|
|
5010
|
-
subscription:
|
|
5088
|
+
subscription: import_zod85.z.unknown().default(PostPurchaseSettings.shape.subscription.parse(void 0))
|
|
5011
5089
|
});
|
|
5012
5090
|
|
|
5013
5091
|
// src/schema/postPurchaseRecovery.ts
|
|
5014
|
-
var
|
|
5015
|
-
var RecoveredFollowupsSchema =
|
|
5016
|
-
acceptedEvent:
|
|
5017
|
-
acceptedMetafield:
|
|
5092
|
+
var import_zod86 = require("zod");
|
|
5093
|
+
var RecoveredFollowupsSchema = import_zod86.z.strictObject({
|
|
5094
|
+
acceptedEvent: import_zod86.z.union([AcceptedEventAttemptProgressSchema, AcceptedEventResultProgressSchema]).nullable(),
|
|
5095
|
+
acceptedMetafield: import_zod86.z.union([AcceptedMetafieldOutcomeSchema, import_zod86.z.literal("attempted")]).nullable()
|
|
5018
5096
|
});
|
|
5019
5097
|
var PurchaseRecoveryRequestSchema = DecideRequestSchema.strict();
|
|
5020
|
-
var PurchaseRecoveryResponseSchema =
|
|
5021
|
-
data:
|
|
5098
|
+
var PurchaseRecoveryResponseSchema = import_zod86.z.object({
|
|
5099
|
+
data: import_zod86.z.object({
|
|
5022
5100
|
/**
|
|
5023
5101
|
* Strict, so rebuy-api (which validates its own reply against this schema) can never emit a field the
|
|
5024
5102
|
* contract does not name. cab-post-purchase reads recovery with hand guards that ignore extra keys, so
|
|
5025
5103
|
* the strictness never reaches it: release rebuy-api (the pin bump) first, then the client that reads a
|
|
5026
5104
|
* field added here.
|
|
5027
5105
|
*/
|
|
5028
|
-
operation:
|
|
5106
|
+
operation: import_zod86.z.object({
|
|
5029
5107
|
/** Absent from a rebuy-api that predates it. */
|
|
5030
5108
|
followups: RecoveredFollowupsSchema.optional(),
|
|
5031
5109
|
observation: RecordedPurchaseObservationSchema.nullable(),
|
|
@@ -5048,41 +5126,41 @@ var PurchaseRecoveryResponseSchema = import_zod84.z.object({
|
|
|
5048
5126
|
).nullable(),
|
|
5049
5127
|
progress: PostPurchaseProgressSchema.nullable().optional()
|
|
5050
5128
|
}),
|
|
5051
|
-
successful:
|
|
5129
|
+
successful: import_zod86.z.literal(true)
|
|
5052
5130
|
});
|
|
5053
5131
|
|
|
5054
5132
|
// src/schema/postPurchaseReleaseClaim.ts
|
|
5055
|
-
var
|
|
5133
|
+
var import_zod87 = require("zod");
|
|
5056
5134
|
var ReleaseClaimRequestSchema = ReleaseAuthorityRequestSchema;
|
|
5057
|
-
var ReleaseClaimResponseSchema =
|
|
5058
|
-
data:
|
|
5059
|
-
|
|
5135
|
+
var ReleaseClaimResponseSchema = import_zod87.z.object({
|
|
5136
|
+
data: import_zod87.z.discriminatedUnion("status", [
|
|
5137
|
+
import_zod87.z.object({ status: import_zod87.z.literal("release-permitted") }),
|
|
5060
5138
|
PendingReleaseAuthoritySchema,
|
|
5061
5139
|
ReadyReleaseAuthoritySchema
|
|
5062
5140
|
]),
|
|
5063
|
-
successful:
|
|
5141
|
+
successful: import_zod87.z.literal(true)
|
|
5064
5142
|
});
|
|
5065
5143
|
|
|
5066
5144
|
// src/schema/postPurchaseSelection.ts
|
|
5067
|
-
var
|
|
5145
|
+
var import_zod88 = require("zod");
|
|
5068
5146
|
var SelectionClaimsSchema = DecideRequestSchema.extend({
|
|
5069
5147
|
appId: PostPurchaseAppIdSchema,
|
|
5070
5148
|
entry: DecisionEntrySchema,
|
|
5071
|
-
iss:
|
|
5072
|
-
purpose:
|
|
5149
|
+
iss: import_zod88.z.literal("rebuy-api"),
|
|
5150
|
+
purpose: import_zod88.z.literal("post-purchase-selection")
|
|
5073
5151
|
});
|
|
5074
5152
|
var SessionStartRequestSchema = DecideRequestSchema.extend({
|
|
5075
|
-
selectionToken:
|
|
5153
|
+
selectionToken: import_zod88.z.string().min(1).max(8192).optional()
|
|
5076
5154
|
}).strict();
|
|
5077
5155
|
|
|
5078
5156
|
// src/schema/postPurchaseSession.ts
|
|
5079
|
-
var
|
|
5157
|
+
var import_zod89 = require("zod");
|
|
5080
5158
|
var SessionIdentitySchema = DecideRequestSchema.extend({ appId: PostPurchaseAppIdSchema });
|
|
5081
|
-
var SessionOrderTimingSchema =
|
|
5159
|
+
var SessionOrderTimingSchema = import_zod89.z.object({
|
|
5082
5160
|
nativeDeadline: PostPurchaseTimestampSchema,
|
|
5083
5161
|
orderCreatedAt: PostPurchaseTimestampSchema,
|
|
5084
5162
|
orderId: PostPurchaseOrderIdSchema,
|
|
5085
|
-
timingSource:
|
|
5163
|
+
timingSource: import_zod89.z.literal("shopify-order-created-at")
|
|
5086
5164
|
});
|
|
5087
5165
|
var ReadySessionTimingSchema = SessionOrderTimingSchema.extend({
|
|
5088
5166
|
deadline: PostPurchaseTimestampSchema,
|
|
@@ -5099,76 +5177,26 @@ var ReadySessionTimingSchema = SessionOrderTimingSchema.extend({
|
|
|
5099
5177
|
message: "deadline must not exceed nativeDeadline",
|
|
5100
5178
|
path: ["deadline"]
|
|
5101
5179
|
});
|
|
5102
|
-
var SessionStartResponseSchema =
|
|
5103
|
-
data:
|
|
5104
|
-
phase:
|
|
5180
|
+
var SessionStartResponseSchema = import_zod89.z.object({
|
|
5181
|
+
data: import_zod89.z.object({
|
|
5182
|
+
phase: import_zod89.z.literal("render"),
|
|
5105
5183
|
serverNow: PostPurchaseTimestampSchema,
|
|
5106
5184
|
session: ReadySessionTimingSchema,
|
|
5107
|
-
workflowPhase:
|
|
5185
|
+
workflowPhase: import_zod89.z.literal("start")
|
|
5108
5186
|
}),
|
|
5109
|
-
successful:
|
|
5187
|
+
successful: import_zod89.z.literal(true)
|
|
5110
5188
|
});
|
|
5111
|
-
var PostPurchaseOrderPendingSchema =
|
|
5112
|
-
errors:
|
|
5113
|
-
message:
|
|
5114
|
-
reason:
|
|
5115
|
-
successful:
|
|
5116
|
-
});
|
|
5117
|
-
|
|
5118
|
-
// src/schema/postPurchaseShadow.ts
|
|
5119
|
-
var import_zod88 = require("zod");
|
|
5120
|
-
var PostPurchaseShadowSelectionSchema = import_zod88.z.discriminatedUnion("verdict", [
|
|
5121
|
-
import_zod88.z.object({ entry: DecisionEntrySchema, verdict: import_zod88.z.literal("render") }),
|
|
5122
|
-
import_zod88.z.object({ verdict: import_zod88.z.literal("skip") })
|
|
5123
|
-
]);
|
|
5124
|
-
var PostPurchaseShadowSkipReasonSchema = import_zod88.z.enum([
|
|
5125
|
-
"destination-missing",
|
|
5126
|
-
"merchant-destination",
|
|
5127
|
-
"merchant-time",
|
|
5128
|
-
"no-active-flows",
|
|
5129
|
-
"no-eligible-flow",
|
|
5130
|
-
"prelude-timeout"
|
|
5131
|
-
]);
|
|
5132
|
-
var PostPurchaseShadowFlowOutcomesSchema = import_zod88.z.array(
|
|
5133
|
-
import_zod88.z.object({
|
|
5134
|
-
flowId: import_zod88.z.number().int().positive(),
|
|
5135
|
-
outcome: import_zod88.z.enum(["eligible", "empty", "failed", "unsupported"])
|
|
5136
|
-
})
|
|
5137
|
-
).max(POST_PURCHASE_SKIP_LIMIT);
|
|
5138
|
-
var PostPurchaseShadowReportFields = import_zod88.z.object({
|
|
5139
|
-
differences: import_zod88.z.array(import_zod88.z.enum(["verdict", "entry", "targeting", "incomplete-capture", "unsupported-configuration"])).refine((differences) => new Set(differences).size === differences.length, {
|
|
5140
|
-
message: "differences must not contain duplicate entries"
|
|
5141
|
-
}),
|
|
5142
|
-
legacySelection: PostPurchaseShadowSelectionSchema,
|
|
5143
|
-
phase: import_zod88.z.literal("shouldRender"),
|
|
5144
|
-
sampleId: import_zod88.z.string(),
|
|
5145
|
-
/** Optional so rows and senders from before REB-25425 stay valid; never part of the classification. */
|
|
5146
|
-
serverFlowOutcomes: PostPurchaseShadowFlowOutcomesSchema.optional(),
|
|
5147
|
-
serverSelection: PostPurchaseShadowSelectionSchema.optional(),
|
|
5148
|
-
/**
|
|
5149
|
-
* Set by the sender when the Decider skipped, `incomplete` reports included (which carry no
|
|
5150
|
-
* `serverSelection`). Not validated against `serverSelection`, and never part of the classification.
|
|
5151
|
-
*/
|
|
5152
|
-
serverSkipReason: PostPurchaseShadowSkipReasonSchema.optional(),
|
|
5153
|
-
status: import_zod88.z.enum(["match", "diverged", "incomplete"]),
|
|
5154
|
-
targetingFlowIds: import_zod88.z.array(import_zod88.z.number().int().positive()),
|
|
5155
|
-
workflowPhase: import_zod88.z.literal("decide")
|
|
5156
|
-
});
|
|
5157
|
-
var PostPurchaseShadowReportSchema = PostPurchaseShadowReportFields.refine(
|
|
5158
|
-
(report) => report.status !== "match" || report.differences.length === 0,
|
|
5159
|
-
{ message: "status 'match' requires an empty differences array", path: ["status"] }
|
|
5160
|
-
).refine((report) => report.status !== "diverged" || report.differences.length > 0, {
|
|
5161
|
-
message: "status 'diverged' requires a non-empty differences array",
|
|
5162
|
-
path: ["status"]
|
|
5163
|
-
}).refine((report) => report.status !== "diverged" || report.serverSelection !== void 0, {
|
|
5164
|
-
message: "status 'diverged' requires a serverSelection to diverge from",
|
|
5165
|
-
path: ["status"]
|
|
5189
|
+
var PostPurchaseOrderPendingSchema = import_zod89.z.object({
|
|
5190
|
+
errors: import_zod89.z.array(import_zod89.z.object({ message: import_zod89.z.string() })),
|
|
5191
|
+
message: import_zod89.z.string(),
|
|
5192
|
+
reason: import_zod89.z.literal("order-pending"),
|
|
5193
|
+
successful: import_zod89.z.literal(false)
|
|
5166
5194
|
});
|
|
5167
5195
|
|
|
5168
5196
|
// src/schema/postPurchaseSubscriptionProduct.ts
|
|
5169
|
-
var
|
|
5197
|
+
var import_zod90 = require("zod");
|
|
5170
5198
|
var PreparedPostPurchaseSubscription = PreparedPostPurchaseProduct.extend({
|
|
5171
|
-
selection: PreparedPostPurchaseProduct.shape.selection.extend({ sellingPlanId:
|
|
5199
|
+
selection: PreparedPostPurchaseProduct.shape.selection.extend({ sellingPlanId: import_zod90.z.number().int().positive() }),
|
|
5172
5200
|
terms: PreparedPostPurchaseProduct.shape.terms.extend({
|
|
5173
5201
|
subscription: PostPurchaseSubscriptionTerms
|
|
5174
5202
|
}).refine(
|
|
@@ -5182,93 +5210,93 @@ var readPostPurchaseSubscription = (prepared) => {
|
|
|
5182
5210
|
};
|
|
5183
5211
|
|
|
5184
5212
|
// src/schema/postPurchaseVariantDefault.ts
|
|
5185
|
-
var
|
|
5213
|
+
var import_zod91 = require("zod");
|
|
5186
5214
|
var values = PostPurchaseVariantValues.partial().extend({
|
|
5187
5215
|
option1: PostPurchaseVariantValues.shape.option1.nullish()
|
|
5188
5216
|
});
|
|
5189
5217
|
var variant = values.extend({
|
|
5190
5218
|
id: PostPurchaseVariantId,
|
|
5191
|
-
inventoryManagement:
|
|
5192
|
-
inventoryPolicy:
|
|
5193
|
-
inventoryQuantity:
|
|
5219
|
+
inventoryManagement: import_zod91.z.string().nullable(),
|
|
5220
|
+
inventoryPolicy: import_zod91.z.string(),
|
|
5221
|
+
inventoryQuantity: import_zod91.z.number()
|
|
5194
5222
|
});
|
|
5195
|
-
var options =
|
|
5196
|
-
var PostPurchaseVariantDefaultProduct =
|
|
5223
|
+
var options = import_zod91.z.array(PostPurchaseVariantOption.pick({ name: true, values: true }));
|
|
5224
|
+
var PostPurchaseVariantDefaultProduct = import_zod91.z.object({
|
|
5197
5225
|
id: PostPurchaseProductId,
|
|
5198
5226
|
options,
|
|
5199
5227
|
selectedVariant: variant.optional(),
|
|
5200
|
-
variants:
|
|
5228
|
+
variants: import_zod91.z.array(variant)
|
|
5201
5229
|
});
|
|
5202
5230
|
var PostPurchaseVariantDefaultSettings = PostPurchaseSettings.shape.productOptions.pick({
|
|
5203
5231
|
hideOutOfStockVariants: true,
|
|
5204
5232
|
matchVariant: true
|
|
5205
5233
|
});
|
|
5206
|
-
var PostPurchaseOrderAttributes =
|
|
5207
|
-
var PostPurchaseOriginalVariants =
|
|
5208
|
-
|
|
5234
|
+
var PostPurchaseOrderAttributes = import_zod91.z.record(import_zod91.z.string(), import_zod91.z.array(import_zod91.z.string())).default({});
|
|
5235
|
+
var PostPurchaseOriginalVariants = import_zod91.z.array(
|
|
5236
|
+
import_zod91.z.object({ productId: PostPurchaseProductId, variantId: PostPurchaseVariantId })
|
|
5209
5237
|
);
|
|
5210
|
-
var PostPurchaseAttributeProducts =
|
|
5211
|
-
|
|
5238
|
+
var PostPurchaseAttributeProducts = import_zod91.z.array(
|
|
5239
|
+
import_zod91.z.object({ id: PostPurchaseProductId, options, variants: import_zod91.z.array(values.extend({ id: PostPurchaseVariantId })) })
|
|
5212
5240
|
);
|
|
5213
5241
|
|
|
5214
5242
|
// src/schema/postPurchaseVariantDefaultContext.ts
|
|
5215
|
-
var
|
|
5216
|
-
var PostPurchaseVariantDefaultContext =
|
|
5217
|
-
enrichedLineItems:
|
|
5243
|
+
var import_zod92 = require("zod");
|
|
5244
|
+
var PostPurchaseVariantDefaultContext = import_zod92.z.object({
|
|
5245
|
+
enrichedLineItems: import_zod92.z.unknown().optional(),
|
|
5218
5246
|
originalVariants: PostPurchaseOriginalVariants
|
|
5219
5247
|
});
|
|
5220
5248
|
|
|
5221
5249
|
// src/schema/shopConfig.ts
|
|
5222
|
-
var
|
|
5223
|
-
var ShopConfig =
|
|
5224
|
-
activeExperiments:
|
|
5225
|
-
|
|
5226
|
-
data:
|
|
5227
|
-
|
|
5228
|
-
aliasName:
|
|
5229
|
-
cssInput:
|
|
5230
|
-
elementId:
|
|
5231
|
-
id:
|
|
5232
|
-
javascriptInput:
|
|
5233
|
-
traffic:
|
|
5250
|
+
var import_zod93 = require("zod");
|
|
5251
|
+
var ShopConfig = import_zod93.z.object({
|
|
5252
|
+
activeExperiments: import_zod93.z.array(
|
|
5253
|
+
import_zod93.z.object({
|
|
5254
|
+
data: import_zod93.z.array(
|
|
5255
|
+
import_zod93.z.object({
|
|
5256
|
+
aliasName: import_zod93.z.string(),
|
|
5257
|
+
cssInput: import_zod93.z.string().nullish(),
|
|
5258
|
+
elementId: import_zod93.z.coerce.number(),
|
|
5259
|
+
id: import_zod93.z.coerce.number(),
|
|
5260
|
+
javascriptInput: import_zod93.z.string().nullish(),
|
|
5261
|
+
traffic: import_zod93.z.coerce.number()
|
|
5234
5262
|
})
|
|
5235
5263
|
),
|
|
5236
|
-
id:
|
|
5237
|
-
name:
|
|
5238
|
-
pageTarget:
|
|
5239
|
-
pageTargetUrl:
|
|
5240
|
-
placeholderId:
|
|
5241
|
-
type:
|
|
5264
|
+
id: import_zod93.z.coerce.number(),
|
|
5265
|
+
name: import_zod93.z.string(),
|
|
5266
|
+
pageTarget: import_zod93.z.string().nullable(),
|
|
5267
|
+
pageTargetUrl: import_zod93.z.string().nullable(),
|
|
5268
|
+
placeholderId: import_zod93.z.coerce.number().nullable(),
|
|
5269
|
+
type: import_zod93.z.string()
|
|
5242
5270
|
})
|
|
5243
5271
|
),
|
|
5244
|
-
activePackages:
|
|
5245
|
-
|
|
5246
|
-
cancelledAt:
|
|
5247
|
-
id:
|
|
5248
|
-
installedAt:
|
|
5249
|
-
isActive:
|
|
5250
|
-
isBillable:
|
|
5251
|
-
packageId:
|
|
5252
|
-
packageName:
|
|
5253
|
-
shortName:
|
|
5254
|
-
trialDays:
|
|
5255
|
-
uninstalledAt:
|
|
5272
|
+
activePackages: import_zod93.z.array(
|
|
5273
|
+
import_zod93.z.object({
|
|
5274
|
+
cancelledAt: import_zod93.z.string().nullable(),
|
|
5275
|
+
id: import_zod93.z.number(),
|
|
5276
|
+
installedAt: import_zod93.z.string().nullable(),
|
|
5277
|
+
isActive: import_zod93.z.boolean(),
|
|
5278
|
+
isBillable: import_zod93.z.boolean(),
|
|
5279
|
+
packageId: import_zod93.z.number(),
|
|
5280
|
+
packageName: import_zod93.z.string(),
|
|
5281
|
+
shortName: import_zod93.z.string(),
|
|
5282
|
+
trialDays: import_zod93.z.number(),
|
|
5283
|
+
uninstalledAt: import_zod93.z.string().nullable()
|
|
5256
5284
|
})
|
|
5257
5285
|
),
|
|
5258
|
-
apiKey:
|
|
5259
|
-
billingVersion:
|
|
5260
|
-
cacheKey:
|
|
5261
|
-
carousel:
|
|
5262
|
-
currency:
|
|
5263
|
-
currencySymbol:
|
|
5264
|
-
domain:
|
|
5265
|
-
enabledJquery:
|
|
5266
|
-
enabledPresentmentCurrencies:
|
|
5267
|
-
hasSmartCollectionsEnabled:
|
|
5268
|
-
hasSmartSearchEnabled:
|
|
5269
|
-
id:
|
|
5270
|
-
integrations:
|
|
5271
|
-
|
|
5286
|
+
apiKey: import_zod93.z.string(),
|
|
5287
|
+
billingVersion: import_zod93.z.string().nullable(),
|
|
5288
|
+
cacheKey: import_zod93.z.coerce.number(),
|
|
5289
|
+
carousel: import_zod93.z.enum(["flickity", "splide"]),
|
|
5290
|
+
currency: import_zod93.z.string(),
|
|
5291
|
+
currencySymbol: import_zod93.z.string(),
|
|
5292
|
+
domain: import_zod93.z.string(),
|
|
5293
|
+
enabledJquery: import_zod93.z.boolean(),
|
|
5294
|
+
enabledPresentmentCurrencies: import_zod93.z.array(import_zod93.z.string()),
|
|
5295
|
+
hasSmartCollectionsEnabled: import_zod93.z.boolean(),
|
|
5296
|
+
hasSmartSearchEnabled: import_zod93.z.boolean(),
|
|
5297
|
+
id: import_zod93.z.coerce.number(),
|
|
5298
|
+
integrations: import_zod93.z.record(
|
|
5299
|
+
import_zod93.z.enum([
|
|
5272
5300
|
"attentive",
|
|
5273
5301
|
"judgeme",
|
|
5274
5302
|
"junip",
|
|
@@ -5281,30 +5309,30 @@ var ShopConfig = import_zod92.z.object({
|
|
|
5281
5309
|
"stamped",
|
|
5282
5310
|
"yotpo"
|
|
5283
5311
|
]),
|
|
5284
|
-
|
|
5312
|
+
import_zod93.z.union([import_zod93.z.boolean(), import_zod93.z.unknown()])
|
|
5285
5313
|
),
|
|
5286
|
-
markets:
|
|
5287
|
-
enabled:
|
|
5314
|
+
markets: import_zod93.z.object({
|
|
5315
|
+
enabled: import_zod93.z.boolean()
|
|
5288
5316
|
}),
|
|
5289
|
-
monetize:
|
|
5290
|
-
publisherKey:
|
|
5317
|
+
monetize: import_zod93.z.object({
|
|
5318
|
+
publisherKey: import_zod93.z.string().nullable()
|
|
5291
5319
|
}).nullish(),
|
|
5292
|
-
moneyFormat:
|
|
5293
|
-
myshopifyDomain:
|
|
5294
|
-
primaryLocale:
|
|
5295
|
-
productGroupsEnabled:
|
|
5296
|
-
rechargeCustomDomain:
|
|
5297
|
-
sellingPlansEnabled:
|
|
5298
|
-
shopId:
|
|
5299
|
-
shopifySellingPlansEnabled:
|
|
5300
|
-
shopName:
|
|
5301
|
-
storefrontAccessToken:
|
|
5302
|
-
useRebuyIcons:
|
|
5320
|
+
moneyFormat: import_zod93.z.string(),
|
|
5321
|
+
myshopifyDomain: import_zod93.z.string(),
|
|
5322
|
+
primaryLocale: import_zod93.z.string(),
|
|
5323
|
+
productGroupsEnabled: import_zod93.z.enum(["no", "yes"]).transform((value) => value === "yes"),
|
|
5324
|
+
rechargeCustomDomain: import_zod93.z.string().nullable(),
|
|
5325
|
+
sellingPlansEnabled: import_zod93.z.boolean(),
|
|
5326
|
+
shopId: import_zod93.z.number(),
|
|
5327
|
+
shopifySellingPlansEnabled: import_zod93.z.boolean(),
|
|
5328
|
+
shopName: import_zod93.z.string(),
|
|
5329
|
+
storefrontAccessToken: import_zod93.z.string().nullable(),
|
|
5330
|
+
useRebuyIcons: import_zod93.z.boolean()
|
|
5303
5331
|
});
|
|
5304
5332
|
|
|
5305
5333
|
// src/schema/userConfig.ts
|
|
5306
|
-
var
|
|
5307
|
-
var UserConfig =
|
|
5334
|
+
var import_zod94 = require("zod");
|
|
5335
|
+
var UserConfig = import_zod94.z.object({
|
|
5308
5336
|
shop: ShopConfig,
|
|
5309
5337
|
/**
|
|
5310
5338
|
* Parsed like `CabUserConfig.smartCart`: the engine's `false` reads as `null` ({@link EngineSmartCart}), a
|
|
@@ -5315,140 +5343,140 @@ var UserConfig = import_zod93.z.object({
|
|
|
5315
5343
|
* exported from `./schema`, so a consumer could not tell it apart from an empty config anyway.
|
|
5316
5344
|
*/
|
|
5317
5345
|
smartCart: EngineSmartCart.catch(void 0),
|
|
5318
|
-
smartFlows:
|
|
5346
|
+
smartFlows: import_zod94.z.array(import_zod94.z.unknown())
|
|
5319
5347
|
});
|
|
5320
5348
|
|
|
5321
5349
|
// src/schema/widgetData.ts
|
|
5322
|
-
var
|
|
5350
|
+
var import_zod103 = require("zod");
|
|
5323
5351
|
|
|
5324
5352
|
// src/schema/widgets/abTestingPlaceholder.ts
|
|
5325
|
-
var
|
|
5326
|
-
var ABTestingPlaceholder =
|
|
5327
|
-
type:
|
|
5353
|
+
var import_zod95 = require("zod");
|
|
5354
|
+
var ABTestingPlaceholder = import_zod95.z.looseObject({
|
|
5355
|
+
type: import_zod95.z.literal("placeholder")
|
|
5328
5356
|
});
|
|
5329
5357
|
|
|
5330
5358
|
// src/schema/widgets/checkoutExtension.ts
|
|
5331
|
-
var
|
|
5332
|
-
var CheckoutExtension =
|
|
5333
|
-
type:
|
|
5359
|
+
var import_zod96 = require("zod");
|
|
5360
|
+
var CheckoutExtension = import_zod96.z.looseObject({
|
|
5361
|
+
type: import_zod96.z.literal(WidgetType.shopify_checkout_extension).default(WidgetType.shopify_checkout_extension)
|
|
5334
5362
|
});
|
|
5335
5363
|
|
|
5336
5364
|
// src/schema/widgets/contentBlock.ts
|
|
5337
|
-
var
|
|
5338
|
-
var ContentBlockV1 =
|
|
5339
|
-
blockSpacing:
|
|
5340
|
-
imageBlocks:
|
|
5341
|
-
|
|
5342
|
-
|
|
5343
|
-
altText:
|
|
5344
|
-
description:
|
|
5345
|
-
id:
|
|
5346
|
-
imagePlacement:
|
|
5347
|
-
imageSize:
|
|
5348
|
-
imageUrl:
|
|
5349
|
-
textAlignment:
|
|
5365
|
+
var import_zod97 = require("zod");
|
|
5366
|
+
var ContentBlockV1 = import_zod97.z.object({
|
|
5367
|
+
blockSpacing: import_zod97.z.enum(spacings).optional(),
|
|
5368
|
+
imageBlocks: import_zod97.z.union([
|
|
5369
|
+
import_zod97.z.array(
|
|
5370
|
+
import_zod97.z.object({
|
|
5371
|
+
altText: import_zod97.z.string().nullable(),
|
|
5372
|
+
description: import_zod97.z.string().nullable(),
|
|
5373
|
+
id: import_zod97.z.uuid(),
|
|
5374
|
+
imagePlacement: import_zod97.z.enum(["top", "right", "bottom", "left"]),
|
|
5375
|
+
imageSize: import_zod97.z.number(),
|
|
5376
|
+
imageUrl: import_zod97.z.url(),
|
|
5377
|
+
textAlignment: import_zod97.z.enum(["left", "center", "right"]),
|
|
5350
5378
|
/** Inline scale only: an image caption can never be a block-level heading. */
|
|
5351
|
-
textSize:
|
|
5379
|
+
textSize: import_zod97.z.enum(inlineTextSizeNames)
|
|
5352
5380
|
})
|
|
5353
5381
|
),
|
|
5354
|
-
|
|
5382
|
+
import_zod97.z.strictObject({}).transform(() => [])
|
|
5355
5383
|
]).optional(),
|
|
5356
|
-
imageLayout:
|
|
5357
|
-
language:
|
|
5358
|
-
description:
|
|
5359
|
-
superTitle:
|
|
5360
|
-
title:
|
|
5384
|
+
imageLayout: import_zod97.z.enum(["row", "column"]).optional(),
|
|
5385
|
+
language: import_zod97.z.object({
|
|
5386
|
+
description: import_zod97.z.string(),
|
|
5387
|
+
superTitle: import_zod97.z.string(),
|
|
5388
|
+
title: import_zod97.z.string()
|
|
5361
5389
|
}),
|
|
5362
|
-
previewMode:
|
|
5363
|
-
type:
|
|
5364
|
-
version:
|
|
5390
|
+
previewMode: import_zod97.z.boolean(),
|
|
5391
|
+
type: import_zod97.z.literal(WidgetType.ui_extension_content_block).default(WidgetType.ui_extension_content_block),
|
|
5392
|
+
version: import_zod97.z.literal(1)
|
|
5365
5393
|
});
|
|
5366
|
-
var ContentBlock =
|
|
5394
|
+
var ContentBlock = import_zod97.z.discriminatedUnion("version", [
|
|
5367
5395
|
ContentBlockV1,
|
|
5368
5396
|
CABRootSection.extend({
|
|
5369
|
-
type:
|
|
5397
|
+
type: import_zod97.z.literal(WidgetType.ui_extension_content_block).default(WidgetType.ui_extension_content_block)
|
|
5370
5398
|
})
|
|
5371
5399
|
]);
|
|
5372
5400
|
|
|
5373
5401
|
// src/schema/widgets/giftWithPurchase.ts
|
|
5374
|
-
var
|
|
5375
|
-
var GiftWithPurchase =
|
|
5376
|
-
type:
|
|
5402
|
+
var import_zod98 = require("zod");
|
|
5403
|
+
var GiftWithPurchase = import_zod98.z.looseObject({
|
|
5404
|
+
type: import_zod98.z.literal(WidgetType.gift_with_purchase).default(WidgetType.gift_with_purchase)
|
|
5377
5405
|
});
|
|
5378
5406
|
|
|
5379
5407
|
// src/schema/widgets/lineItemEditor.ts
|
|
5380
|
-
var
|
|
5381
|
-
var LineItemEditorSwitchLanguageV1 =
|
|
5382
|
-
downgradeToOneTimeLabel:
|
|
5408
|
+
var import_zod99 = require("zod");
|
|
5409
|
+
var LineItemEditorSwitchLanguageV1 = import_zod99.z.object({
|
|
5410
|
+
downgradeToOneTimeLabel: import_zod99.z.string().optional(),
|
|
5383
5411
|
/** Frequency-option template (`{{frequency}}`/`{{interval}}`) for the plan select. */
|
|
5384
|
-
subscriptionOptionLabel:
|
|
5385
|
-
upgradeToSubscriptionLabel:
|
|
5386
|
-
upgradeToSubscriptionWithoutDiscountLabel:
|
|
5412
|
+
subscriptionOptionLabel: import_zod99.z.string().optional(),
|
|
5413
|
+
upgradeToSubscriptionLabel: import_zod99.z.string().optional(),
|
|
5414
|
+
upgradeToSubscriptionWithoutDiscountLabel: import_zod99.z.string().optional()
|
|
5387
5415
|
});
|
|
5388
|
-
var LineItemEditorV1 =
|
|
5416
|
+
var LineItemEditorV1 = import_zod99.z.object({
|
|
5389
5417
|
/** Legacy `getStyles` button style; the converter carries a valid kind, defaulting to `plain`. */
|
|
5390
|
-
button:
|
|
5391
|
-
previewMode:
|
|
5392
|
-
switchToSubscription:
|
|
5393
|
-
disableDowngrade:
|
|
5418
|
+
button: import_zod99.z.object({ kind: import_zod99.z.enum(["plain", "primary", "secondary"]).optional() }).optional(),
|
|
5419
|
+
previewMode: import_zod99.z.boolean().optional(),
|
|
5420
|
+
switchToSubscription: import_zod99.z.object({
|
|
5421
|
+
disableDowngrade: import_zod99.z.boolean().optional(),
|
|
5394
5422
|
language: LineItemEditorSwitchLanguageV1.optional()
|
|
5395
5423
|
}).optional(),
|
|
5396
|
-
switchToSubscriptionEnabled:
|
|
5397
|
-
tracking:
|
|
5398
|
-
enableAttribution:
|
|
5399
|
-
enableSource:
|
|
5400
|
-
enableWidget:
|
|
5424
|
+
switchToSubscriptionEnabled: import_zod99.z.boolean().optional(),
|
|
5425
|
+
tracking: import_zod99.z.object({
|
|
5426
|
+
enableAttribution: import_zod99.z.boolean().optional(),
|
|
5427
|
+
enableSource: import_zod99.z.boolean().optional(),
|
|
5428
|
+
enableWidget: import_zod99.z.boolean().optional()
|
|
5401
5429
|
}).optional(),
|
|
5402
|
-
type:
|
|
5403
|
-
version:
|
|
5430
|
+
type: import_zod99.z.literal(WidgetType.ui_extension_line_item_editor).default(WidgetType.ui_extension_line_item_editor),
|
|
5431
|
+
version: import_zod99.z.literal(1)
|
|
5404
5432
|
});
|
|
5405
|
-
var LineItemEditor =
|
|
5433
|
+
var LineItemEditor = import_zod99.z.discriminatedUnion("version", [
|
|
5406
5434
|
LineItemEditorV1,
|
|
5407
5435
|
CABRootSection.extend({
|
|
5408
|
-
type:
|
|
5436
|
+
type: import_zod99.z.literal(WidgetType.ui_extension_line_item_editor).default(WidgetType.ui_extension_line_item_editor)
|
|
5409
5437
|
})
|
|
5410
5438
|
]);
|
|
5411
5439
|
|
|
5412
5440
|
// src/schema/widgets/progressBar.ts
|
|
5413
|
-
var
|
|
5414
|
-
var ProgressBar =
|
|
5415
|
-
type:
|
|
5441
|
+
var import_zod100 = require("zod");
|
|
5442
|
+
var ProgressBar = import_zod100.z.looseObject({
|
|
5443
|
+
type: import_zod100.z.literal(WidgetType.ui_extension_progress_bar).default(WidgetType.ui_extension_progress_bar)
|
|
5416
5444
|
});
|
|
5417
5445
|
|
|
5418
5446
|
// src/schema/widgets/rebuyButton.ts
|
|
5419
|
-
var
|
|
5420
|
-
var RebuyButtonV1 =
|
|
5421
|
-
type:
|
|
5422
|
-
version:
|
|
5447
|
+
var import_zod101 = require("zod");
|
|
5448
|
+
var RebuyButtonV1 = import_zod101.z.looseObject({
|
|
5449
|
+
type: import_zod101.z.literal(WidgetType.ui_extension_button).default(WidgetType.ui_extension_button),
|
|
5450
|
+
version: import_zod101.z.literal(1)
|
|
5423
5451
|
});
|
|
5424
|
-
var RebuyButton =
|
|
5452
|
+
var RebuyButton = import_zod101.z.discriminatedUnion("version", [
|
|
5425
5453
|
RebuyButtonV1,
|
|
5426
5454
|
CABRootSection.extend({
|
|
5427
|
-
type:
|
|
5455
|
+
type: import_zod101.z.literal(WidgetType.ui_extension_button).default(WidgetType.ui_extension_button)
|
|
5428
5456
|
})
|
|
5429
5457
|
]);
|
|
5430
5458
|
|
|
5431
5459
|
// src/schema/widgets/rebuyMonetize.ts
|
|
5432
|
-
var
|
|
5433
|
-
var RebuyMonetize =
|
|
5434
|
-
type:
|
|
5460
|
+
var import_zod102 = require("zod");
|
|
5461
|
+
var RebuyMonetize = import_zod102.z.looseObject({
|
|
5462
|
+
type: import_zod102.z.literal(WidgetType.ui_extension_ad).default(WidgetType.ui_extension_ad)
|
|
5435
5463
|
});
|
|
5436
|
-
var RebuyMonetizeV1 =
|
|
5437
|
-
name:
|
|
5438
|
-
previewMode:
|
|
5464
|
+
var RebuyMonetizeV1 = import_zod102.z.object({
|
|
5465
|
+
name: import_zod102.z.string().nullable().optional(),
|
|
5466
|
+
previewMode: import_zod102.z.boolean().optional(),
|
|
5439
5467
|
/** Privacy Policy footer href → the marker section's `privacyPolicyUrl`. */
|
|
5440
|
-
privacyPolicyUrl:
|
|
5468
|
+
privacyPolicyUrl: import_zod102.z.string().nullable().optional(),
|
|
5441
5469
|
/** Ads-taxonomy sub-vertical id — one of the admin Monetize editor's two configurables. */
|
|
5442
|
-
subVertical:
|
|
5443
|
-
tracking:
|
|
5444
|
-
enableAttribution:
|
|
5445
|
-
enableSource:
|
|
5446
|
-
enableWidget:
|
|
5470
|
+
subVertical: import_zod102.z.string().nullable().optional(),
|
|
5471
|
+
tracking: import_zod102.z.object({
|
|
5472
|
+
enableAttribution: import_zod102.z.boolean().optional(),
|
|
5473
|
+
enableSource: import_zod102.z.boolean().optional(),
|
|
5474
|
+
enableWidget: import_zod102.z.boolean().optional()
|
|
5447
5475
|
}).optional(),
|
|
5448
|
-
type:
|
|
5449
|
-
version:
|
|
5476
|
+
type: import_zod102.z.literal(WidgetType.ui_extension_ad).default(WidgetType.ui_extension_ad),
|
|
5477
|
+
version: import_zod102.z.literal(1),
|
|
5450
5478
|
/** Ads-taxonomy vertical id — one of the admin Monetize editor's two configurables. */
|
|
5451
|
-
vertical:
|
|
5479
|
+
vertical: import_zod102.z.string().nullable().optional()
|
|
5452
5480
|
});
|
|
5453
5481
|
|
|
5454
5482
|
// src/schema/widgetData.ts
|
|
@@ -5462,7 +5490,7 @@ var extensionWidgetTypes = [
|
|
|
5462
5490
|
WidgetType.ui_extension_line_item_editor,
|
|
5463
5491
|
WidgetType.ui_extension_progress_bar
|
|
5464
5492
|
];
|
|
5465
|
-
var WidgetData =
|
|
5493
|
+
var WidgetData = import_zod103.z.discriminatedUnion("type", [
|
|
5466
5494
|
ABTestingPlaceholder,
|
|
5467
5495
|
CheckoutExtension,
|
|
5468
5496
|
ContentBlock,
|
|
@@ -5822,36 +5850,36 @@ var SWITCH_LABELS = {
|
|
|
5822
5850
|
};
|
|
5823
5851
|
|
|
5824
5852
|
// src/schema/widgets/post-purchase-offer/postPurchaseOffer.ts
|
|
5825
|
-
var
|
|
5853
|
+
var import_zod105 = require("zod");
|
|
5826
5854
|
|
|
5827
5855
|
// src/schema/widgets/post-purchase-offer/postPurchaseWidget.ts
|
|
5828
|
-
var
|
|
5829
|
-
var PostPurchaseWidgetLinkedFlow =
|
|
5830
|
-
id:
|
|
5831
|
-
name:
|
|
5832
|
-
});
|
|
5833
|
-
var PostPurchaseWidget =
|
|
5834
|
-
classification:
|
|
5835
|
-
createdAtTime:
|
|
5836
|
-
customEndpointName:
|
|
5837
|
-
id:
|
|
5838
|
-
lastViewed:
|
|
5839
|
-
linkedCustomEndpointId:
|
|
5840
|
-
linkedFlows:
|
|
5841
|
-
name:
|
|
5842
|
-
owner:
|
|
5856
|
+
var import_zod104 = require("zod");
|
|
5857
|
+
var PostPurchaseWidgetLinkedFlow = import_zod104.z.object({
|
|
5858
|
+
id: import_zod104.z.number(),
|
|
5859
|
+
name: import_zod104.z.string()
|
|
5860
|
+
});
|
|
5861
|
+
var PostPurchaseWidget = import_zod104.z.object({
|
|
5862
|
+
classification: import_zod104.z.literal("post_purchase_offer_page").default("post_purchase_offer_page"),
|
|
5863
|
+
createdAtTime: import_zod104.z.iso.datetime({ offset: true }).optional(),
|
|
5864
|
+
customEndpointName: import_zod104.z.string().nullish(),
|
|
5865
|
+
id: import_zod104.z.number().default(0),
|
|
5866
|
+
lastViewed: import_zod104.z.iso.datetime({ offset: true }).nullish(),
|
|
5867
|
+
linkedCustomEndpointId: import_zod104.z.number().nullish(),
|
|
5868
|
+
linkedFlows: import_zod104.z.array(PostPurchaseWidgetLinkedFlow).optional(),
|
|
5869
|
+
name: import_zod104.z.string().default(""),
|
|
5870
|
+
owner: import_zod104.z.number().nullish(),
|
|
5843
5871
|
settings: PostPurchaseSettings
|
|
5844
5872
|
});
|
|
5845
5873
|
|
|
5846
5874
|
// src/schema/widgets/post-purchase-offer/postPurchaseOffer.ts
|
|
5847
|
-
var PostPurchaseOffer =
|
|
5848
|
-
|
|
5849
|
-
errors:
|
|
5850
|
-
message:
|
|
5851
|
-
successful:
|
|
5875
|
+
var PostPurchaseOffer = import_zod105.z.discriminatedUnion("successful", [
|
|
5876
|
+
import_zod105.z.strictObject({
|
|
5877
|
+
errors: import_zod105.z.array(import_zod105.z.object({ message: import_zod105.z.string() })),
|
|
5878
|
+
message: import_zod105.z.string(),
|
|
5879
|
+
successful: import_zod105.z.literal(false)
|
|
5852
5880
|
}),
|
|
5853
|
-
|
|
5854
|
-
successful:
|
|
5881
|
+
import_zod105.z.strictObject({
|
|
5882
|
+
successful: import_zod105.z.literal(true),
|
|
5855
5883
|
widget: PostPurchaseWidget
|
|
5856
5884
|
})
|
|
5857
5885
|
]);
|