@rebuy/rebuy 3.44.1 → 3.45.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 +457 -449
- package/dist/index.mjs +457 -449
- package/dist/schema/postPurchaseFinish.d.ts +27 -0
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -187,6 +187,7 @@ __export(src_exports, {
|
|
|
187
187
|
PostPurchaseDisplayPrice: () => PostPurchaseDisplayPrice,
|
|
188
188
|
PostPurchaseEndReasonSchema: () => PostPurchaseEndReasonSchema,
|
|
189
189
|
PostPurchaseExcludedProductIds: () => PostPurchaseExcludedProductIds,
|
|
190
|
+
PostPurchaseFinishReasonSchema: () => PostPurchaseFinishReasonSchema,
|
|
190
191
|
PostPurchaseGroupCatalog: () => PostPurchaseGroupCatalog,
|
|
191
192
|
PostPurchaseGroupChoice: () => PostPurchaseGroupChoice,
|
|
192
193
|
PostPurchaseGroupDescription: () => PostPurchaseGroupDescription,
|
|
@@ -3174,7 +3175,7 @@ var ExitPolicySchema = import_zod38.z.discriminatedUnion("status", [
|
|
|
3174
3175
|
]);
|
|
3175
3176
|
|
|
3176
3177
|
// src/schema/postPurchaseFinish.ts
|
|
3177
|
-
var
|
|
3178
|
+
var import_zod47 = require("zod");
|
|
3178
3179
|
|
|
3179
3180
|
// src/schema/postPurchaseFollowups.ts
|
|
3180
3181
|
var import_zod43 = require("zod");
|
|
@@ -3336,39 +3337,80 @@ var SessionClosureSchema = import_zod44.z.object({ closedAt: PostPurchaseTimesta
|
|
|
3336
3337
|
var SessionCloseRequestSchema = DecideRequestSchema.strict();
|
|
3337
3338
|
var SessionCloseResponseSchema = import_zod44.z.object({ data: SessionClosureSchema, successful: import_zod44.z.literal(true) });
|
|
3338
3339
|
|
|
3340
|
+
// src/schema/postPurchaseTransition.ts
|
|
3341
|
+
var import_zod46 = require("zod");
|
|
3342
|
+
|
|
3343
|
+
// src/schema/postPurchaseSkipTrace.ts
|
|
3344
|
+
var import_zod45 = require("zod");
|
|
3345
|
+
var POST_PURCHASE_SKIP_LIMIT = 32;
|
|
3346
|
+
var PostPurchaseSkipTraceSchema = import_zod45.z.array(
|
|
3347
|
+
import_zod45.z.object({
|
|
3348
|
+
entry: DecisionEntrySchema,
|
|
3349
|
+
reason: PostPurchaseSkipReasonSchema
|
|
3350
|
+
})
|
|
3351
|
+
).max(POST_PURCHASE_SKIP_LIMIT);
|
|
3352
|
+
|
|
3353
|
+
// src/schema/postPurchaseTransition.ts
|
|
3354
|
+
var OfferTransitionRequestSchema = DecideRequestSchema.extend({
|
|
3355
|
+
entryRevision: PostPurchaseProgressSchema.shape.entryRevision,
|
|
3356
|
+
progressRevision: PostPurchaseProgressSchema.shape.revision
|
|
3357
|
+
}).strict();
|
|
3358
|
+
var PostPurchaseEndReasonSchema = import_zod46.z.enum(["no-child", "no-products", "accept-cap"]);
|
|
3359
|
+
var TransitionBaseSchema = import_zod46.z.object({
|
|
3360
|
+
attemptedSkips: PostPurchaseSkipTraceSchema.optional(),
|
|
3361
|
+
progress: PostPurchaseProgressSchema
|
|
3362
|
+
});
|
|
3363
|
+
var OfferTransitionResponseSchema = import_zod46.z.object({
|
|
3364
|
+
data: import_zod46.z.discriminatedUnion("status", [
|
|
3365
|
+
TransitionBaseSchema.extend({ status: import_zod46.z.enum(["advanced", "unavailable"]) }),
|
|
3366
|
+
TransitionBaseSchema.extend({
|
|
3367
|
+
endReason: PostPurchaseEndReasonSchema.optional(),
|
|
3368
|
+
status: import_zod46.z.literal("no-child")
|
|
3369
|
+
})
|
|
3370
|
+
]),
|
|
3371
|
+
successful: import_zod46.z.literal(true)
|
|
3372
|
+
});
|
|
3373
|
+
|
|
3339
3374
|
// src/schema/postPurchaseFinish.ts
|
|
3340
|
-
var FinishedPurchaseSchema =
|
|
3341
|
-
|
|
3342
|
-
|
|
3375
|
+
var FinishedPurchaseSchema = import_zod47.z.union([
|
|
3376
|
+
import_zod47.z.strictObject({ status: import_zod47.z.literal("none") }),
|
|
3377
|
+
import_zod47.z.strictObject({
|
|
3343
3378
|
operationId: PurchaseReceiptSchema.shape.operationId,
|
|
3344
|
-
status:
|
|
3345
|
-
|
|
3379
|
+
status: import_zod47.z.union([
|
|
3380
|
+
import_zod47.z.literal("pending"),
|
|
3346
3381
|
...PurchaseObservationSchema.options.map((option) => option.shape.status)
|
|
3347
3382
|
])
|
|
3348
3383
|
})
|
|
3349
3384
|
]);
|
|
3350
|
-
var
|
|
3351
|
-
var
|
|
3385
|
+
var PostPurchaseFinishReasonSchema = import_zod47.z.enum(["decline-all", "timer-expiry", "end", "unknown-result"]);
|
|
3386
|
+
var SessionFinishRequestSchema = DecideRequestSchema.extend({
|
|
3387
|
+
endReason: PostPurchaseEndReasonSchema.optional(),
|
|
3388
|
+
reason: PostPurchaseFinishReasonSchema.optional()
|
|
3389
|
+
}).strict().refine(({ endReason, reason }) => endReason === void 0 || reason === "end", {
|
|
3390
|
+
message: 'endReason is only valid with reason "end"',
|
|
3391
|
+
path: ["endReason"]
|
|
3392
|
+
});
|
|
3393
|
+
var SessionFinishResponseSchema = import_zod47.z.object({
|
|
3352
3394
|
data: SessionClosureSchema.extend({
|
|
3353
3395
|
classification: ClassificationProgressSchema,
|
|
3354
3396
|
exitPolicy: ExitPolicySchema,
|
|
3355
3397
|
health: RequiredHealthSchema.nullable(),
|
|
3356
3398
|
purchase: FinishedPurchaseSchema
|
|
3357
3399
|
}),
|
|
3358
|
-
successful:
|
|
3400
|
+
successful: import_zod47.z.literal(true)
|
|
3359
3401
|
});
|
|
3360
3402
|
|
|
3361
3403
|
// src/schema/postPurchaseQuantity.ts
|
|
3362
|
-
var
|
|
3404
|
+
var import_zod71 = require("zod");
|
|
3363
3405
|
|
|
3364
3406
|
// src/schema/postPurchaseProductCollectionView.ts
|
|
3365
|
-
var
|
|
3407
|
+
var import_zod70 = require("zod");
|
|
3366
3408
|
|
|
3367
3409
|
// src/schema/postPurchaseProductView.ts
|
|
3368
|
-
var
|
|
3410
|
+
var import_zod69 = require("zod");
|
|
3369
3411
|
|
|
3370
3412
|
// src/schema/postPurchaseGroupCatalog.ts
|
|
3371
|
-
var
|
|
3413
|
+
var import_zod48 = require("zod");
|
|
3372
3414
|
var productId = PreparedPostPurchaseProduct.shape.selection.shape.productId;
|
|
3373
3415
|
var source = PostPurchaseProductSource.shape.data.element;
|
|
3374
3416
|
var PostPurchaseGroupDescription = source.pick({ description: true, id: true, image: true, images: true, title: true }).extend({
|
|
@@ -3376,17 +3418,17 @@ var PostPurchaseGroupDescription = source.pick({ description: true, id: true, im
|
|
|
3376
3418
|
image: source.shape.image.default(null),
|
|
3377
3419
|
options: PostPurchaseVariantCatalog.shape.options.default([])
|
|
3378
3420
|
});
|
|
3379
|
-
var PostPurchaseGroupCatalog =
|
|
3421
|
+
var PostPurchaseGroupCatalog = import_zod48.z.object({
|
|
3380
3422
|
memberProductId: productId,
|
|
3381
|
-
options:
|
|
3423
|
+
options: import_zod48.z.array(import_zod48.z.object({ productId, title: import_zod48.z.string(), variantCatalog: PostPurchaseVariantCatalog }))
|
|
3382
3424
|
});
|
|
3383
|
-
var PostPurchaseGroupSelection =
|
|
3425
|
+
var PostPurchaseGroupSelection = import_zod48.z.object({
|
|
3384
3426
|
memberProductId: productId,
|
|
3385
3427
|
productId
|
|
3386
3428
|
});
|
|
3387
3429
|
|
|
3388
3430
|
// src/schema/widgets/checkout-and-beyond/root.ts
|
|
3389
|
-
var
|
|
3431
|
+
var import_zod68 = require("zod");
|
|
3390
3432
|
|
|
3391
3433
|
// src/schema/widgets/checkout-and-beyond/constants.ts
|
|
3392
3434
|
var import_es_toolkit3 = require("es-toolkit");
|
|
@@ -3441,18 +3483,18 @@ var targetAreas = {
|
|
|
3441
3483
|
|
|
3442
3484
|
// src/schema/widgets/checkout-and-beyond/layout.ts
|
|
3443
3485
|
var import_uuid15 = require("uuid");
|
|
3444
|
-
var
|
|
3486
|
+
var import_zod67 = require("zod");
|
|
3445
3487
|
|
|
3446
3488
|
// src/schema/widgets/checkout-and-beyond/shared.ts
|
|
3447
|
-
var
|
|
3489
|
+
var import_zod66 = require("zod");
|
|
3448
3490
|
|
|
3449
3491
|
// src/schema/widgets/checkout-and-beyond/banner.ts
|
|
3450
|
-
var
|
|
3451
|
-
var CABBannerSection =
|
|
3492
|
+
var import_zod49 = require("zod");
|
|
3493
|
+
var CABBannerSection = import_zod49.z.lazy(
|
|
3452
3494
|
() => CABLayoutSection.omit({ sectionType: true }).extend({
|
|
3453
|
-
buttonField:
|
|
3454
|
-
color:
|
|
3455
|
-
dismissible:
|
|
3495
|
+
buttonField: import_zod49.z.enum(buttonFields).optional(),
|
|
3496
|
+
color: import_zod49.z.enum(bannerColors).default("info"),
|
|
3497
|
+
dismissible: import_zod49.z.boolean().default(true),
|
|
3456
3498
|
/**
|
|
3457
3499
|
* The `s-banner` heading — localized content (a buyer can see a merchant-composed banner). Absent OR
|
|
3458
3500
|
* blank ⇒ no heading; the renderer emits no heading slot for `''` rather than an empty one.
|
|
@@ -3468,18 +3510,18 @@ var CABBannerSection = import_zod47.z.lazy(
|
|
|
3468
3510
|
* not a 500. Nothing emits `heading` yet; the first converter that maps merchant banner copy into it
|
|
3469
3511
|
* either strips first or teaches `normalizeTextContent` to strip this field.
|
|
3470
3512
|
*/
|
|
3471
|
-
heading:
|
|
3472
|
-
sectionType:
|
|
3513
|
+
heading: import_zod49.z.record(import_zod49.z.string(), import_zod49.z.string().refine(checkForHTML, NO_HTML)).optional(),
|
|
3514
|
+
sectionType: import_zod49.z.literal(SectionType.banner).default(SectionType.banner)
|
|
3473
3515
|
})
|
|
3474
3516
|
);
|
|
3475
3517
|
|
|
3476
3518
|
// src/schema/widgets/checkout-and-beyond/button.ts
|
|
3477
3519
|
var import_uuid5 = require("uuid");
|
|
3478
|
-
var
|
|
3520
|
+
var import_zod52 = require("zod");
|
|
3479
3521
|
|
|
3480
3522
|
// src/schema/widgets/checkout-and-beyond/image.ts
|
|
3481
3523
|
var import_uuid4 = require("uuid");
|
|
3482
|
-
var
|
|
3524
|
+
var import_zod51 = require("zod");
|
|
3483
3525
|
|
|
3484
3526
|
// src/schema/widgets/checkout-and-beyond/icons.ts
|
|
3485
3527
|
var iconNames = [
|
|
@@ -3566,24 +3608,24 @@ var iconTones = ["auto", "critical", "custom", "info", "neutral", "success", "wa
|
|
|
3566
3608
|
var IconTone = freezeEnum(iconTones);
|
|
3567
3609
|
|
|
3568
3610
|
// src/schema/widgets/checkout-and-beyond/imageThumbnails.ts
|
|
3569
|
-
var
|
|
3570
|
-
var CABImageThumbnails =
|
|
3571
|
-
limit:
|
|
3572
|
-
perLine:
|
|
3611
|
+
var import_zod50 = require("zod");
|
|
3612
|
+
var CABImageThumbnails = import_zod50.z.object({
|
|
3613
|
+
limit: import_zod50.z.number().int().min(1).default(8),
|
|
3614
|
+
perLine: import_zod50.z.number().int().min(1).max(8).default(4)
|
|
3573
3615
|
});
|
|
3574
3616
|
|
|
3575
3617
|
// src/schema/widgets/checkout-and-beyond/image.ts
|
|
3576
|
-
var CABImageSectionFields =
|
|
3618
|
+
var CABImageSectionFields = import_zod51.z.object({
|
|
3577
3619
|
...CABVariableFields,
|
|
3578
|
-
altText:
|
|
3620
|
+
altText: import_zod51.z.string().refine(checkForHTML, NO_HTML).default(""),
|
|
3579
3621
|
/**
|
|
3580
3622
|
* Image width÷height (e.g. `46` for the progress-bar fill); `null` renders at natural size. Any POSITIVE
|
|
3581
3623
|
* ratio — never limited to 1, but never `0`/negative either: a renderer dividing by it would get `Infinity`,
|
|
3582
3624
|
* and CSS `aspect-ratio` drops a negative value and silently reverts to natural size.
|
|
3583
3625
|
*/
|
|
3584
|
-
aspectRatio:
|
|
3585
|
-
border:
|
|
3586
|
-
buttonField:
|
|
3626
|
+
aspectRatio: import_zod51.z.number().positive().nullable().default(null),
|
|
3627
|
+
border: import_zod51.z.lazy(() => CABBorder),
|
|
3628
|
+
buttonField: import_zod51.z.enum(buttonFields).optional(),
|
|
3587
3629
|
/**
|
|
3588
3630
|
* `icon` renders `source` as a single `s-icon` by name (the uber-image path covers icons too), reading
|
|
3589
3631
|
* `iconSize`/`iconTone`. The other values are a harmless informational holdover from the previous
|
|
@@ -3602,30 +3644,30 @@ var CABImageSectionFields = import_zod49.z.object({
|
|
|
3602
3644
|
* behavior degraded gracefully and told us about it. The client-assembled half of the invariant was never
|
|
3603
3645
|
* the risky half.
|
|
3604
3646
|
*/
|
|
3605
|
-
category:
|
|
3647
|
+
category: import_zod51.z.enum(["gallery", "icon", "icons", "payment-methods", "secure-checkout"]).nullable().default(null),
|
|
3606
3648
|
/** `icon`-mode only: the `s-icon` `size`; `null` ⇒ the component default (`base`). Ignored by image treatments. */
|
|
3607
|
-
iconSize:
|
|
3649
|
+
iconSize: import_zod51.z.enum(iconSizes).nullable().default(null),
|
|
3608
3650
|
/** `icon`-mode only: the `s-icon` `tone`; `null` ⇒ the component default (`auto`). Ignored by image treatments. */
|
|
3609
|
-
iconTone:
|
|
3610
|
-
name:
|
|
3611
|
-
naturalHeight:
|
|
3612
|
-
naturalWidth:
|
|
3651
|
+
iconTone: import_zod51.z.enum(iconTones).nullable().default(null),
|
|
3652
|
+
name: import_zod51.z.string().optional(),
|
|
3653
|
+
naturalHeight: import_zod51.z.number().default(0),
|
|
3654
|
+
naturalWidth: import_zod51.z.number().default(0),
|
|
3613
3655
|
/**
|
|
3614
3656
|
* `contain` (the component default): dimensionless images render in s-image's 1/1 default frame, and
|
|
3615
3657
|
* `cover` would crop non-square art (payment badges lost their edges — 15993); `contain` letterboxes.
|
|
3616
3658
|
*/
|
|
3617
|
-
objectFit:
|
|
3618
|
-
sectionId:
|
|
3619
|
-
sectionType:
|
|
3659
|
+
objectFit: import_zod51.z.enum(objectFits).default(ObjectFit.contain),
|
|
3660
|
+
sectionId: import_zod51.z.uuid().default(() => (0, import_uuid4.v7)()),
|
|
3661
|
+
sectionType: import_zod51.z.literal(SectionType.image).default(SectionType.image),
|
|
3620
3662
|
/**
|
|
3621
3663
|
* An image URL or dynamic token, an empty default, or — when `category: 'icon'` — an icon NAME. Icon mode
|
|
3622
3664
|
* takes a name or `''` only, NOT a token: no renderer resolves a token to an icon today, so accepting one
|
|
3623
3665
|
* would promise a capability that doesn't exist. Widen the refine's carve-out to `DYNAMIC_TOKEN_REGEX` when a
|
|
3624
3666
|
* server-chosen tier icon actually needs it.
|
|
3625
3667
|
*/
|
|
3626
|
-
source:
|
|
3668
|
+
source: import_zod51.z.union([import_zod51.z.url(), import_zod51.z.literal(""), import_zod51.z.string().regex(DYNAMIC_TOKEN_REGEX), import_zod51.z.enum(iconNames)]).default(""),
|
|
3627
3669
|
thumbnails: CABImageThumbnails.optional(),
|
|
3628
|
-
width:
|
|
3670
|
+
width: import_zod51.z.number().default(100)
|
|
3629
3671
|
});
|
|
3630
3672
|
var iconNameSet = new Set(iconNames);
|
|
3631
3673
|
var isIconName = (source2) => iconNameSet.has(source2);
|
|
@@ -3645,35 +3687,35 @@ var CABImageSection = CABImageSectionFields.superRefine(({ category, source: sou
|
|
|
3645
3687
|
});
|
|
3646
3688
|
|
|
3647
3689
|
// src/schema/widgets/checkout-and-beyond/button.ts
|
|
3648
|
-
var CABButtonContent =
|
|
3649
|
-
() =>
|
|
3690
|
+
var CABButtonContent = import_zod52.z.lazy(
|
|
3691
|
+
() => import_zod52.z.discriminatedUnion("sectionType", [CABImageSection, CABLayoutSection, CABTextSection])
|
|
3650
3692
|
);
|
|
3651
|
-
var CABButtonSection =
|
|
3693
|
+
var CABButtonSection = import_zod52.z.object({
|
|
3652
3694
|
...CABVariableFields,
|
|
3653
|
-
action:
|
|
3654
|
-
buttonStyle:
|
|
3655
|
-
custom:
|
|
3656
|
-
color:
|
|
3657
|
-
height:
|
|
3658
|
-
width:
|
|
3695
|
+
action: import_zod52.z.union([import_zod52.z.literal(""), import_zod52.z.enum(buttonActions)]).default(""),
|
|
3696
|
+
buttonStyle: import_zod52.z.enum(buttonStyles).default(ButtonStyle.primary),
|
|
3697
|
+
custom: import_zod52.z.object({
|
|
3698
|
+
color: import_zod52.z.string().regex(HEX_COLOR_REGEX).default("#005bd3"),
|
|
3699
|
+
height: import_zod52.z.number().default(52),
|
|
3700
|
+
width: import_zod52.z.number().default(300)
|
|
3659
3701
|
}).default({
|
|
3660
3702
|
color: "#005bd3",
|
|
3661
3703
|
height: 52,
|
|
3662
3704
|
width: 300
|
|
3663
3705
|
}),
|
|
3664
|
-
disableDowngrade:
|
|
3665
|
-
name:
|
|
3666
|
-
optionId:
|
|
3667
|
-
popover:
|
|
3668
|
-
alignment:
|
|
3669
|
-
position:
|
|
3706
|
+
disableDowngrade: import_zod52.z.boolean().default(false),
|
|
3707
|
+
name: import_zod52.z.string().optional(),
|
|
3708
|
+
optionId: import_zod52.z.number().optional(),
|
|
3709
|
+
popover: import_zod52.z.object({
|
|
3710
|
+
alignment: import_zod52.z.enum(textAlignments).default(TextAlignment.center),
|
|
3711
|
+
position: import_zod52.z.enum(popoverPositions).default(PopoverPosition.blockStart)
|
|
3670
3712
|
}).optional().default(() => ({
|
|
3671
3713
|
alignment: TextAlignment.center,
|
|
3672
3714
|
position: PopoverPosition.blockStart
|
|
3673
3715
|
})),
|
|
3674
|
-
sectionId:
|
|
3675
|
-
sections:
|
|
3676
|
-
sectionType:
|
|
3716
|
+
sectionId: import_zod52.z.uuid().default(() => (0, import_uuid5.v7)()),
|
|
3717
|
+
sections: import_zod52.z.union([import_zod52.z.array(CABButtonContent), import_zod52.z.strictObject({}).transform(() => [])]).default(() => []),
|
|
3718
|
+
sectionType: import_zod52.z.literal(SectionType.button).default(SectionType.button),
|
|
3677
3719
|
/**
|
|
3678
3720
|
* The smart-cart tier this button acts on (`addGift`/`removeGift`): scopes the click to one tier's gift. The
|
|
3679
3721
|
* client resolves the tier's gift (productId) from the progress-bar context by this `tierId` — the button node
|
|
@@ -3688,96 +3730,96 @@ var CABButtonSection = import_zod50.z.object({
|
|
|
3688
3730
|
* lookup finds no tier and the click resolves to nothing. Safe to bound — the field is new, so there are no
|
|
3689
3731
|
* stored payloads to grandfather, and the producer is client code, not a merchant form.
|
|
3690
3732
|
*/
|
|
3691
|
-
tier:
|
|
3733
|
+
tier: import_zod52.z.object({ tierId: import_zod52.z.string().min(1) }).optional(),
|
|
3692
3734
|
/** Fire-and-forget pixel POSTed when the button is clicked (e.g. a Monetize decline). */
|
|
3693
|
-
trackingUrl:
|
|
3735
|
+
trackingUrl: import_zod52.z.string().optional(),
|
|
3694
3736
|
/**
|
|
3695
3737
|
* Secondary effects applied to in-scope variables on click, alongside (never instead of) the primary
|
|
3696
3738
|
* `action` — an `addToOrder` button can also flip a variable. Applied in array order.
|
|
3697
3739
|
*/
|
|
3698
|
-
variableEffects:
|
|
3740
|
+
variableEffects: import_zod52.z.array(CABVariableEffect).optional()
|
|
3699
3741
|
});
|
|
3700
3742
|
|
|
3701
3743
|
// src/schema/widgets/checkout-and-beyond/carousel.ts
|
|
3702
|
-
var
|
|
3744
|
+
var import_zod57 = require("zod");
|
|
3703
3745
|
|
|
3704
3746
|
// src/schema/widgets/checkout-and-beyond/offers.ts
|
|
3705
|
-
var
|
|
3747
|
+
var import_zod56 = require("zod");
|
|
3706
3748
|
|
|
3707
3749
|
// src/schema/widgets/checkout-and-beyond/dataSource.ts
|
|
3708
3750
|
var import_uuid6 = require("uuid");
|
|
3709
|
-
var
|
|
3710
|
-
var CABDiscount =
|
|
3711
|
-
amount:
|
|
3712
|
-
discountedBy:
|
|
3713
|
-
discountedFrom:
|
|
3714
|
-
type:
|
|
3715
|
-
});
|
|
3716
|
-
var CABIntegrations =
|
|
3717
|
-
judgeme:
|
|
3718
|
-
junip:
|
|
3719
|
-
klaviyo:
|
|
3720
|
-
loox:
|
|
3721
|
-
okendo:
|
|
3722
|
-
opinew:
|
|
3723
|
-
reviewsio:
|
|
3724
|
-
stamped:
|
|
3725
|
-
yotpo:
|
|
3726
|
-
});
|
|
3727
|
-
var CABVariantLabels =
|
|
3728
|
-
variantOption:
|
|
3729
|
-
variantOptions:
|
|
3730
|
-
});
|
|
3731
|
-
var CABDataSourceSection =
|
|
3732
|
-
dataSourceId:
|
|
3733
|
-
dataSourcePath:
|
|
3751
|
+
var import_zod53 = require("zod");
|
|
3752
|
+
var CABDiscount = import_zod53.z.object({
|
|
3753
|
+
amount: import_zod53.z.union([import_zod53.z.number(), import_zod53.z.string()]).catch(0),
|
|
3754
|
+
discountedBy: import_zod53.z.string().optional(),
|
|
3755
|
+
discountedFrom: import_zod53.z.enum(discountSources).optional().catch(void 0),
|
|
3756
|
+
type: import_zod53.z.enum(discountTypes).catch("none")
|
|
3757
|
+
});
|
|
3758
|
+
var CABIntegrations = import_zod53.z.object({
|
|
3759
|
+
judgeme: import_zod53.z.boolean().default(false),
|
|
3760
|
+
junip: import_zod53.z.boolean().default(false),
|
|
3761
|
+
klaviyo: import_zod53.z.boolean().default(false),
|
|
3762
|
+
loox: import_zod53.z.boolean().default(false),
|
|
3763
|
+
okendo: import_zod53.z.boolean().default(false),
|
|
3764
|
+
opinew: import_zod53.z.boolean().default(false),
|
|
3765
|
+
reviewsio: import_zod53.z.boolean().default(false),
|
|
3766
|
+
stamped: import_zod53.z.boolean().default(false),
|
|
3767
|
+
yotpo: import_zod53.z.boolean().default(false)
|
|
3768
|
+
});
|
|
3769
|
+
var CABVariantLabels = import_zod53.z.object({
|
|
3770
|
+
variantOption: import_zod53.z.string().optional().catch(void 0),
|
|
3771
|
+
variantOptions: import_zod53.z.string().optional().catch(void 0)
|
|
3772
|
+
});
|
|
3773
|
+
var CABDataSourceSection = import_zod53.z.object({
|
|
3774
|
+
dataSourceId: import_zod53.z.number().nullable().default(null),
|
|
3775
|
+
dataSourcePath: import_zod53.z.string().default(DEFAULT_ENDPOINTS[0].value),
|
|
3734
3776
|
discount: CABDiscount.optional(),
|
|
3735
3777
|
integrations: CABIntegrations.optional(),
|
|
3736
|
-
limit:
|
|
3737
|
-
matchVariant:
|
|
3738
|
-
matchVariantOutOfStock:
|
|
3739
|
-
name:
|
|
3740
|
-
productType:
|
|
3741
|
-
sectionId:
|
|
3742
|
-
sectionType:
|
|
3778
|
+
limit: import_zod53.z.number().default(1),
|
|
3779
|
+
matchVariant: import_zod53.z.boolean().default(false),
|
|
3780
|
+
matchVariantOutOfStock: import_zod53.z.boolean().default(false),
|
|
3781
|
+
name: import_zod53.z.string().default(DEFAULT_ENDPOINTS[0].label),
|
|
3782
|
+
productType: import_zod53.z.enum(productTypes).optional(),
|
|
3783
|
+
sectionId: import_zod53.z.uuid().default(() => (0, import_uuid6.v7)()),
|
|
3784
|
+
sectionType: import_zod53.z.literal(SectionType.dataSource).default(SectionType.dataSource),
|
|
3743
3785
|
/** Default subscribe-vs-one-time for `productType: both` (legacy `subscription_is_default`). */
|
|
3744
|
-
subscriptionIsDefault:
|
|
3745
|
-
treatAsGwp:
|
|
3786
|
+
subscriptionIsDefault: import_zod53.z.boolean().default(false),
|
|
3787
|
+
treatAsGwp: import_zod53.z.boolean().default(false),
|
|
3746
3788
|
variantLabels: CABVariantLabels.optional().catch(void 0)
|
|
3747
3789
|
});
|
|
3748
3790
|
|
|
3749
3791
|
// src/schema/widgets/checkout-and-beyond/products.ts
|
|
3750
3792
|
var import_uuid8 = require("uuid");
|
|
3751
|
-
var
|
|
3793
|
+
var import_zod55 = require("zod");
|
|
3752
3794
|
|
|
3753
3795
|
// src/schema/widgets/checkout-and-beyond/product.ts
|
|
3754
3796
|
var import_uuid7 = require("uuid");
|
|
3755
|
-
var
|
|
3756
|
-
var CABVariantContent =
|
|
3757
|
-
() =>
|
|
3797
|
+
var import_zod54 = require("zod");
|
|
3798
|
+
var CABVariantContent = import_zod54.z.lazy(
|
|
3799
|
+
() => import_zod54.z.discriminatedUnion("sectionType", [CABButtonSection, CABTextSection])
|
|
3758
3800
|
);
|
|
3759
|
-
var CABProductSection =
|
|
3801
|
+
var CABProductSection = import_zod54.z.object({
|
|
3760
3802
|
...CABVariableFields,
|
|
3761
|
-
name:
|
|
3762
|
-
productId:
|
|
3763
|
-
sectionId:
|
|
3764
|
-
sections:
|
|
3765
|
-
sectionType:
|
|
3766
|
-
selectors:
|
|
3767
|
-
variantMode:
|
|
3803
|
+
name: import_zod54.z.string().optional(),
|
|
3804
|
+
productId: import_zod54.z.number().nullable().default(null),
|
|
3805
|
+
sectionId: import_zod54.z.uuid().default(() => (0, import_uuid7.v7)()),
|
|
3806
|
+
sections: import_zod54.z.union([import_zod54.z.array(CABVariantContent), import_zod54.z.strictObject({}).transform(() => [])]).default(() => []),
|
|
3807
|
+
sectionType: import_zod54.z.literal(SectionType.product).default(SectionType.product),
|
|
3808
|
+
selectors: import_zod54.z.record(import_zod54.z.string(), import_zod54.z.enum(variantSelectors).default(VariantSelector.menu)).default(() => ({})),
|
|
3809
|
+
variantMode: import_zod54.z.enum(variantModes).default(VariantMode.multiple)
|
|
3768
3810
|
});
|
|
3769
3811
|
|
|
3770
3812
|
// src/schema/widgets/checkout-and-beyond/products.ts
|
|
3771
|
-
var CABProductsSection =
|
|
3813
|
+
var CABProductsSection = import_zod55.z.object({
|
|
3772
3814
|
...CABVariableFields,
|
|
3773
|
-
name:
|
|
3774
|
-
sectionId:
|
|
3775
|
-
sections:
|
|
3776
|
-
sectionType:
|
|
3815
|
+
name: import_zod55.z.string().optional(),
|
|
3816
|
+
sectionId: import_zod55.z.uuid().default(() => (0, import_uuid8.v7)()),
|
|
3817
|
+
sections: import_zod55.z.union([import_zod55.z.array(import_zod55.z.lazy(() => CABProductSection)), import_zod55.z.strictObject({}).transform(() => [])]).default(() => []),
|
|
3818
|
+
sectionType: import_zod55.z.literal(SectionType.products).default(SectionType.products)
|
|
3777
3819
|
});
|
|
3778
3820
|
|
|
3779
3821
|
// src/schema/widgets/checkout-and-beyond/offers.ts
|
|
3780
|
-
var CABOffersSection =
|
|
3822
|
+
var CABOffersSection = import_zod56.z.lazy(
|
|
3781
3823
|
() => CABLayoutSection.omit({ sections: true, sectionType: true }).extend({
|
|
3782
3824
|
/**
|
|
3783
3825
|
* A rule between consecutive cards in the vertical list — legacy checkout-offers' `<Divider />`,
|
|
@@ -3785,8 +3827,8 @@ var CABOffersSection = import_zod54.z.lazy(
|
|
|
3785
3827
|
* run of products). Optional, not defaulted: only the v1 converter sets it (REB-24265); a
|
|
3786
3828
|
* hand-built tree keeps React CAB's dividerless rendering.
|
|
3787
3829
|
*/
|
|
3788
|
-
divider:
|
|
3789
|
-
sections:
|
|
3830
|
+
divider: import_zod56.z.boolean().optional(),
|
|
3831
|
+
sections: import_zod56.z.union([import_zod56.z.array(import_zod56.z.lazy(() => CABSection)), import_zod56.z.strictObject({}).transform(() => [])]).default(() => [
|
|
3790
3832
|
CABBannerSection.parse({
|
|
3791
3833
|
buttonField: "undoAddToOrder",
|
|
3792
3834
|
color: "success",
|
|
@@ -3800,77 +3842,77 @@ var CABOffersSection = import_zod54.z.lazy(
|
|
|
3800
3842
|
CABDataSourceSection.parse({}),
|
|
3801
3843
|
CABProductsSection.parse({})
|
|
3802
3844
|
]),
|
|
3803
|
-
sectionType:
|
|
3845
|
+
sectionType: import_zod56.z.literal(SectionType.offers).default(SectionType.offers)
|
|
3804
3846
|
})
|
|
3805
3847
|
);
|
|
3806
3848
|
|
|
3807
3849
|
// src/schema/widgets/checkout-and-beyond/carousel.ts
|
|
3808
|
-
var CABCarouselSection =
|
|
3850
|
+
var CABCarouselSection = import_zod57.z.lazy(
|
|
3809
3851
|
() => CABLayoutSection.omit({ sections: true, sectionType: true }).extend({
|
|
3810
|
-
autoAdvanceInterval:
|
|
3811
|
-
itemsAtOnce:
|
|
3852
|
+
autoAdvanceInterval: import_zod57.z.number().default(0),
|
|
3853
|
+
itemsAtOnce: import_zod57.z.number().min(1).default(1),
|
|
3812
3854
|
/** Card arrangement for the offers child (`horizontal` = side-by-side) — NOT the carousel's own `direction`. */
|
|
3813
|
-
offersDirection:
|
|
3814
|
-
sections:
|
|
3815
|
-
sectionType:
|
|
3855
|
+
offersDirection: import_zod57.z.enum(offersDirections).default("vertical"),
|
|
3856
|
+
sections: import_zod57.z.union([import_zod57.z.array(import_zod57.z.lazy(() => CABSection)), import_zod57.z.strictObject({}).transform(() => [])]).default(() => [CABOffersSection.parse({})]),
|
|
3857
|
+
sectionType: import_zod57.z.literal(SectionType.carousel).default(SectionType.carousel)
|
|
3816
3858
|
})
|
|
3817
3859
|
);
|
|
3818
3860
|
|
|
3819
3861
|
// src/schema/widgets/checkout-and-beyond/cartLine.ts
|
|
3820
|
-
var
|
|
3821
|
-
var CABCartLineSection =
|
|
3862
|
+
var import_zod58 = require("zod");
|
|
3863
|
+
var CABCartLineSection = import_zod58.z.lazy(
|
|
3822
3864
|
() => CABLayoutSection.omit({ sections: true, sectionType: true }).extend({
|
|
3823
|
-
sections:
|
|
3824
|
-
sectionType:
|
|
3865
|
+
sections: import_zod58.z.union([import_zod58.z.array(import_zod58.z.lazy(() => CABSection)), import_zod58.z.strictObject({}).transform(() => [])]).default(() => [CABButtonSection.parse({ action: ButtonAction.switchToSubscription })]),
|
|
3866
|
+
sectionType: import_zod58.z.literal(SectionType.cartLine).default(SectionType.cartLine)
|
|
3825
3867
|
})
|
|
3826
3868
|
);
|
|
3827
3869
|
|
|
3828
3870
|
// src/schema/widgets/checkout-and-beyond/discount.ts
|
|
3829
3871
|
var import_uuid9 = require("uuid");
|
|
3830
|
-
var
|
|
3831
|
-
var CABDiscountSection =
|
|
3872
|
+
var import_zod59 = require("zod");
|
|
3873
|
+
var CABDiscountSection = import_zod59.z.object({
|
|
3832
3874
|
...CABVariableFields,
|
|
3833
|
-
amount:
|
|
3834
|
-
discountedBy:
|
|
3835
|
-
discountedFrom:
|
|
3836
|
-
message:
|
|
3837
|
-
name:
|
|
3838
|
-
quantity:
|
|
3839
|
-
sectionId:
|
|
3840
|
-
sectionType:
|
|
3841
|
-
type:
|
|
3875
|
+
amount: import_zod59.z.union([import_zod59.z.number(), import_zod59.z.string()]).catch(0),
|
|
3876
|
+
discountedBy: import_zod59.z.string().optional(),
|
|
3877
|
+
discountedFrom: import_zod59.z.enum(discountSources).optional().catch(void 0),
|
|
3878
|
+
message: import_zod59.z.string().optional(),
|
|
3879
|
+
name: import_zod59.z.string().optional(),
|
|
3880
|
+
quantity: import_zod59.z.number().default(1),
|
|
3881
|
+
sectionId: import_zod59.z.uuid().default(() => (0, import_uuid9.v7)()),
|
|
3882
|
+
sectionType: import_zod59.z.literal(SectionType.discount).default(SectionType.discount),
|
|
3883
|
+
type: import_zod59.z.enum(discountTypes).catch("none")
|
|
3842
3884
|
});
|
|
3843
3885
|
|
|
3844
3886
|
// src/schema/widgets/checkout-and-beyond/monetize.ts
|
|
3845
3887
|
var import_uuid10 = require("uuid");
|
|
3846
|
-
var
|
|
3847
|
-
var CABMonetizeAds =
|
|
3848
|
-
requestId:
|
|
3888
|
+
var import_zod60 = require("zod");
|
|
3889
|
+
var CABMonetizeAds = import_zod60.z.object({
|
|
3890
|
+
requestId: import_zod60.z.string().optional(),
|
|
3849
3891
|
/** Defaulted here, never in the beacon: absence of information is `ads` itself being absent. */
|
|
3850
|
-
testing:
|
|
3892
|
+
testing: import_zod60.z.boolean().default(false)
|
|
3851
3893
|
});
|
|
3852
|
-
var CABMonetizeSection =
|
|
3894
|
+
var CABMonetizeSection = import_zod60.z.object({
|
|
3853
3895
|
...CABVariableFields,
|
|
3854
3896
|
ads: CABMonetizeAds.optional(),
|
|
3855
|
-
name:
|
|
3897
|
+
name: import_zod60.z.string().optional(),
|
|
3856
3898
|
/**
|
|
3857
3899
|
* Server-hydrated offer cards (inline hydration): when `/cab/sections` was asked with a `monetize`
|
|
3858
3900
|
* context block, the composed cards ride the marker itself — `[]` means "hydrated, no fill" (render
|
|
3859
3901
|
* nothing, skip the fetch); ABSENT means "not hydrated" (the client fetches via `/cab/monetize`).
|
|
3860
3902
|
*/
|
|
3861
|
-
offers:
|
|
3903
|
+
offers: import_zod60.z.array(import_zod60.z.lazy(() => CABSection)).optional(),
|
|
3862
3904
|
/** 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. */
|
|
3863
|
-
privacyPolicyUrl:
|
|
3864
|
-
sectionId:
|
|
3865
|
-
sectionType:
|
|
3905
|
+
privacyPolicyUrl: import_zod60.z.string().optional(),
|
|
3906
|
+
sectionId: import_zod60.z.uuid().default(() => (0, import_uuid10.v7)()),
|
|
3907
|
+
sectionType: import_zod60.z.literal(SectionType.monetize).default(SectionType.monetize),
|
|
3866
3908
|
/** Ads-taxonomy sub-vertical id (the widget's `sub_vertical` setting); paired with `vertical`. */
|
|
3867
|
-
subVertical:
|
|
3909
|
+
subVertical: import_zod60.z.string().optional(),
|
|
3868
3910
|
/** Ads-taxonomy vertical id (the widget's `vertical` setting) — with `subVertical`, the admin Monetize editor's two configurables. */
|
|
3869
|
-
vertical:
|
|
3911
|
+
vertical: import_zod60.z.string().optional()
|
|
3870
3912
|
});
|
|
3871
3913
|
|
|
3872
3914
|
// src/schema/widgets/checkout-and-beyond/progressBar.ts
|
|
3873
|
-
var
|
|
3915
|
+
var import_zod61 = require("zod");
|
|
3874
3916
|
|
|
3875
3917
|
// src/schema/widgets/checkout-and-beyond/giftLabels.ts
|
|
3876
3918
|
var GIFT_LABELS = {
|
|
@@ -3989,34 +4031,34 @@ var GIFT_LABELS = {
|
|
|
3989
4031
|
};
|
|
3990
4032
|
|
|
3991
4033
|
// src/schema/widgets/checkout-and-beyond/progressBar.ts
|
|
3992
|
-
var CABProgressTierExclusion =
|
|
3993
|
-
collectionIds:
|
|
3994
|
-
productIds:
|
|
3995
|
-
tags:
|
|
3996
|
-
type:
|
|
4034
|
+
var CABProgressTierExclusion = import_zod61.z.object({
|
|
4035
|
+
collectionIds: import_zod61.z.array(import_zod61.z.number().int().positive()).default(() => []),
|
|
4036
|
+
productIds: import_zod61.z.array(import_zod61.z.number().int().positive()).default(() => []),
|
|
4037
|
+
tags: import_zod61.z.array(import_zod61.z.string().min(1)).default(() => []),
|
|
4038
|
+
type: import_zod61.z.enum(progressTierExclusionTypes)
|
|
3997
4039
|
});
|
|
3998
|
-
var CABProgressTier =
|
|
4040
|
+
var CABProgressTier = import_zod61.z.object({
|
|
3999
4041
|
/**
|
|
4000
4042
|
* Order-discount tiers only (onsite `discount`): the reward the order-discount Function applies at
|
|
4001
4043
|
* cart time, carried so the client can resolve the `{{discountAmount}}` token in this tier's copy.
|
|
4002
4044
|
* `fixedAmount`: shop-currency CENTS (FX-scaled by the client, like {@link CABProgressTier.threshold});
|
|
4003
4045
|
* `percentage`: the whole-percent number rendered raw (`{n}%`). Absent on non-discount tiers.
|
|
4004
4046
|
*/
|
|
4005
|
-
discount:
|
|
4047
|
+
discount: import_zod61.z.object({ amount: import_zod61.z.number().nonnegative(), type: import_zod61.z.enum(["fixedAmount", "percentage"]) }).optional(),
|
|
4006
4048
|
/**
|
|
4007
4049
|
* Per-tier exclusion rules (onsite `exclusions` when `exclusions_enabled`): lines they match don't count
|
|
4008
4050
|
* toward this tier. Empty (the default, and the converter's output for a disabled or ruleless tier) means
|
|
4009
4051
|
* the tier measures the plain bar-level adjusted progress. Consumers read ONLY the list named by the rule's
|
|
4010
4052
|
* `type` — the converter leaves the other two at `[]`, so a populated off-type list never reaches the tree.
|
|
4011
4053
|
*/
|
|
4012
|
-
exclusions:
|
|
4054
|
+
exclusions: import_zod61.z.array(CABProgressTierExclusion).default(() => []),
|
|
4013
4055
|
/**
|
|
4014
4056
|
* Smart-cart product (gift) tiers only (onsite `filter_oos_variants`): when set, the client drops this
|
|
4015
4057
|
* tier entirely once its gift has NO in-stock eligible variant — the milestone, fill slot and gift
|
|
4016
4058
|
* controls all disappear, mirroring onsite removing the tier from `bar.tiers` before it renders. Absent
|
|
4017
4059
|
* on shipping/discount/decorative tiers and left off by default (the tier renders regardless of stock).
|
|
4018
4060
|
*/
|
|
4019
|
-
filterOosVariants:
|
|
4061
|
+
filterOosVariants: import_zod61.z.boolean().default(false),
|
|
4020
4062
|
/**
|
|
4021
4063
|
* Smart-cart product (gift) tiers only: the reward unlocked at this tier. The client enriches
|
|
4022
4064
|
* `productId`/`variantIds` to live variants (availability, price) and adds the chosen one to the cart
|
|
@@ -4024,10 +4066,10 @@ var CABProgressTier = import_zod59.z.object({
|
|
|
4024
4066
|
* tiers and on tiers with no configured product. Cart add/remove is a later stage; carried here so the
|
|
4025
4067
|
* tree is complete.
|
|
4026
4068
|
*/
|
|
4027
|
-
gift:
|
|
4028
|
-
productId:
|
|
4029
|
-
title:
|
|
4030
|
-
variantIds:
|
|
4069
|
+
gift: import_zod61.z.object({
|
|
4070
|
+
productId: import_zod61.z.number().int().positive(),
|
|
4071
|
+
title: import_zod61.z.string().optional(),
|
|
4072
|
+
variantIds: import_zod61.z.array(import_zod61.z.number().int().positive()).default(() => [])
|
|
4031
4073
|
}).optional(),
|
|
4032
4074
|
/**
|
|
4033
4075
|
* The step-row icon's square size in PIXELS (onsite `product_tier_element_size`, an admin px string the
|
|
@@ -4047,7 +4089,7 @@ var CABProgressTier = import_zod59.z.object({
|
|
|
4047
4089
|
* renderer never spells a fallback), which also makes a tree authored before this field render at
|
|
4048
4090
|
* React's size rather than the old hardcoded 20.
|
|
4049
4091
|
*/
|
|
4050
|
-
iconSizePx:
|
|
4092
|
+
iconSizePx: import_zod61.z.number().int().min(1).max(64).default(18),
|
|
4051
4093
|
/**
|
|
4052
4094
|
* The step-row label at this tier's slot (onsite `getTierLabel`): the merchant custom label, else the
|
|
4053
4095
|
* type default — 'Free Shipping' or '{n}% Discount'. A PRODUCT tier gets NO converter label: its name is
|
|
@@ -4057,35 +4099,35 @@ var CABProgressTier = import_zod59.z.object({
|
|
|
4057
4099
|
* turns a blank label into an absent key, and a client-authored blank means the same thing — the renderer
|
|
4058
4100
|
* emits no caption slot rather than an empty one). Plain text — a compact icon+label.
|
|
4059
4101
|
*/
|
|
4060
|
-
label:
|
|
4102
|
+
label: import_zod61.z.record(import_zod61.z.string(), import_zod61.z.string()).optional(),
|
|
4061
4103
|
/**
|
|
4062
4104
|
* Smart-cart product (gift) tiers only (onsite `product_tier_image`): show the gift's product image in
|
|
4063
4105
|
* the step-row slot instead of the generic bag icon. The converter can't supply the image URL (config
|
|
4064
4106
|
* carries only product IDs), so the client resolves it (authoritative Shopify featured image, React
|
|
4065
4107
|
* parity) and falls back to the bag icon when the flag is off or no image resolves. Default false.
|
|
4066
4108
|
*/
|
|
4067
|
-
productTierImage:
|
|
4109
|
+
productTierImage: import_zod61.z.boolean().default(false),
|
|
4068
4110
|
/**
|
|
4069
4111
|
* The tier's goal, measured per `unit`. `currency` (default): SHOP-currency cents — the canonical
|
|
4070
4112
|
* fallback: when the buyer's presentment currency has no entry in `thresholds`, the client
|
|
4071
4113
|
* multiplies this by the live FX rate (converter maps the v1 `unlock_price`, e.g. `75` → `7500`).
|
|
4072
4114
|
* `item`: a raw item count — no cents, no FX, no `thresholds` overrides.
|
|
4073
4115
|
*/
|
|
4074
|
-
threshold:
|
|
4116
|
+
threshold: import_zod61.z.number().int().nonnegative(),
|
|
4075
4117
|
/**
|
|
4076
4118
|
* Per-presentment-currency goal overrides — lowercased ISO currency code → cents (e.g. `{ cad: 9900 }`).
|
|
4077
4119
|
* When the buyer's currency has an entry, the client uses it verbatim INSTEAD of FX-converting
|
|
4078
4120
|
* `threshold`, so merchants show intentional, clean per-market amounts (Shopify Markets) rather than a
|
|
4079
4121
|
* converted base. Defaults to `{}` — no overrides means always fall back to `threshold`.
|
|
4080
4122
|
*/
|
|
4081
|
-
thresholds:
|
|
4123
|
+
thresholds: import_zod61.z.record(import_zod61.z.string(), import_zod61.z.number().int().nonnegative()).default(() => ({})),
|
|
4082
4124
|
/**
|
|
4083
4125
|
* Smart-cart tier identifier, mirrored onto the gift cart line's `_tier` attribute so the client can
|
|
4084
4126
|
* match an in-cart gift back to its tier (add on reach, remove on downgrade/decline). Absent on the
|
|
4085
4127
|
* shipping bar (single unlabeled tier, no gift).
|
|
4086
4128
|
*/
|
|
4087
|
-
tierId:
|
|
4088
|
-
tierType:
|
|
4129
|
+
tierId: import_zod61.z.string().optional(),
|
|
4130
|
+
tierType: import_zod61.z.enum(progressTierTypes).default(ProgressTierType.shipping),
|
|
4089
4131
|
/**
|
|
4090
4132
|
* What this tier's progress is measured in — PER TIER (onsite's `unlock_condition_type` model, NOT
|
|
4091
4133
|
* the React port's bar-level `tiers[0]` shortcut). `currency` compares money cents against the
|
|
@@ -4096,9 +4138,9 @@ var CABProgressTier = import_zod59.z.object({
|
|
|
4096
4138
|
* count carries no injected noun (no English `item`/`items` inflection on localized copy); merchant
|
|
4097
4139
|
* template text supplies grammatically-neutral wording around the token.
|
|
4098
4140
|
*/
|
|
4099
|
-
unit:
|
|
4141
|
+
unit: import_zod61.z.enum(progressTierUnits).default(ProgressTierUnit.currency)
|
|
4100
4142
|
});
|
|
4101
|
-
var CABProgressBarSection =
|
|
4143
|
+
var CABProgressBarSection = import_zod61.z.lazy(
|
|
4102
4144
|
() => CABLayoutSection.omit({ sectionType: true }).extend({
|
|
4103
4145
|
/**
|
|
4104
4146
|
* The onsite bar id (smart-cart TPB bars only). The client mirrors it to the cart's `_barId` attribute
|
|
@@ -4107,35 +4149,35 @@ var CABProgressBarSection = import_zod59.z.lazy(
|
|
|
4107
4149
|
* checkout reaches the extension without it, so the client writes it or the tier gift's 100% discount
|
|
4108
4150
|
* (and any tier order discount) never applies. Absent on the v1 shipping bar (no gift tiers, no id).
|
|
4109
4151
|
*/
|
|
4110
|
-
barId:
|
|
4152
|
+
barId: import_zod61.z.string().optional(),
|
|
4111
4153
|
/** Empty = shown everywhere; otherwise uppercase ISO country codes. */
|
|
4112
|
-
countryCodes:
|
|
4154
|
+
countryCodes: import_zod61.z.array(import_zod61.z.string().transform((code) => code.trim().toUpperCase())).default(() => []),
|
|
4113
4155
|
/**
|
|
4114
4156
|
* Uppercase ISO codes where a higher-precedence geo bar applies, so this (default, non-geo) bar is
|
|
4115
4157
|
* hidden there — replicates React `getbar`'s geo-match-over-default precedence. Empty = never excluded.
|
|
4116
4158
|
*/
|
|
4117
|
-
excludeCountryCodes:
|
|
4159
|
+
excludeCountryCodes: import_zod61.z.array(import_zod61.z.string().transform((code) => code.trim().toUpperCase())).default(() => []),
|
|
4118
4160
|
/**
|
|
4119
4161
|
* Measure progress against the PRE-discount subtotal (onsite `exclude_discount_in_subtotal`, and
|
|
4120
4162
|
* forced on for bars with a discount tier so its own reward can't un-reach the tier). The client
|
|
4121
4163
|
* adds the cart's discount allocations back to the live subtotal.
|
|
4122
4164
|
*/
|
|
4123
|
-
excludeDiscountInSubtotal:
|
|
4165
|
+
excludeDiscountInSubtotal: import_zod61.z.boolean().default(false),
|
|
4124
4166
|
/** Variant ids the client subtracts from the adjusted subtotal (React `bar.excluded_products`). */
|
|
4125
|
-
excludedVariantIds:
|
|
4167
|
+
excludedVariantIds: import_zod61.z.array(import_zod61.z.number().int().positive()).default(() => []),
|
|
4126
4168
|
/**
|
|
4127
4169
|
* When the cart holds a subscription item, treat the bar as reached regardless of subtotal (React
|
|
4128
4170
|
* `free_shipping_on_subscription(s)`). `freeShippingOnAll` is already a zero-threshold tier instead.
|
|
4129
4171
|
*/
|
|
4130
|
-
freeShippingOnSubscription:
|
|
4172
|
+
freeShippingOnSubscription: import_zod61.z.boolean().default(false),
|
|
4131
4173
|
/** Localized heading over the gift controls (onsite `gift_area_title`, default 'FREE GIFTS'). */
|
|
4132
|
-
giftAreaTitle:
|
|
4174
|
+
giftAreaTitle: import_zod61.z.record(import_zod61.z.string(), import_zod61.z.string()).default(() => ({ en: "FREE GIFTS" })),
|
|
4133
4175
|
/** Localized gift-control labels (add/remove/heading); a tier's gift `title` beats `yourGift`. */
|
|
4134
|
-
giftLabels:
|
|
4135
|
-
addGift:
|
|
4136
|
-
remove:
|
|
4137
|
-
selectOptions:
|
|
4138
|
-
yourGift:
|
|
4176
|
+
giftLabels: import_zod61.z.object({
|
|
4177
|
+
addGift: import_zod61.z.record(import_zod61.z.string(), import_zod61.z.string()).default(() => ({ ...GIFT_LABELS.addGift })),
|
|
4178
|
+
remove: import_zod61.z.record(import_zod61.z.string(), import_zod61.z.string()).default(() => ({ ...GIFT_LABELS.remove })),
|
|
4179
|
+
selectOptions: import_zod61.z.record(import_zod61.z.string(), import_zod61.z.string()).default(() => ({ ...GIFT_LABELS.selectOptions })),
|
|
4180
|
+
yourGift: import_zod61.z.record(import_zod61.z.string(), import_zod61.z.string()).default(() => ({ ...GIFT_LABELS.yourGift }))
|
|
4139
4181
|
}).default(() => ({
|
|
4140
4182
|
addGift: { ...GIFT_LABELS.addGift },
|
|
4141
4183
|
remove: { ...GIFT_LABELS.remove },
|
|
@@ -4143,38 +4185,38 @@ var CABProgressBarSection = import_zod59.z.lazy(
|
|
|
4143
4185
|
yourGift: { ...GIFT_LABELS.yourGift }
|
|
4144
4186
|
})),
|
|
4145
4187
|
/** The bar's a11y label; the merchant names it in the editor, else this default (React parity). */
|
|
4146
|
-
name:
|
|
4188
|
+
name: import_zod61.z.string().default("Order progress"),
|
|
4147
4189
|
/**
|
|
4148
4190
|
* Bar fill color. An explicit (widget-authored) value is used verbatim; when absent the server
|
|
4149
4191
|
* fills it with the live shop theme's `buttonBackground` (React `useRebuyTheme` parity). Still
|
|
4150
4192
|
* absent after that ⇒ the theme fetch failed and the client renders its platform-default bar —
|
|
4151
4193
|
* optional, not defaulted, so "merchant chose no color" stays distinguishable from any real value.
|
|
4152
4194
|
*/
|
|
4153
|
-
progressColor:
|
|
4154
|
-
sectionType:
|
|
4195
|
+
progressColor: import_zod61.z.string().optional(),
|
|
4196
|
+
sectionType: import_zod61.z.literal(SectionType.progressBar).default(SectionType.progressBar),
|
|
4155
4197
|
/**
|
|
4156
4198
|
* The bar's milestones in the merchant's CONFIGURED order — the renderer does NOT sort them (022
|
|
4157
4199
|
* O-B2: sorting by resolved threshold reversed configured milestones on out-of-order or mixed-unit
|
|
4158
4200
|
* count-vs-cents bars). Drives the fill (even slot per tier) and, for smart-cart product tiers, the
|
|
4159
4201
|
* gift add/remove. The visual tier display lives in `sections` (composable), NOT here.
|
|
4160
4202
|
*/
|
|
4161
|
-
tiers:
|
|
4203
|
+
tiers: import_zod61.z.union([import_zod61.z.array(CABProgressTier), import_zod61.z.strictObject({}).transform(() => [])]).default(() => [])
|
|
4162
4204
|
})
|
|
4163
4205
|
);
|
|
4164
4206
|
|
|
4165
4207
|
// src/schema/widgets/checkout-and-beyond/quantity.ts
|
|
4166
4208
|
var import_uuid11 = require("uuid");
|
|
4167
|
-
var
|
|
4168
|
-
var CABQuantitySection =
|
|
4209
|
+
var import_zod62 = require("zod");
|
|
4210
|
+
var CABQuantitySection = import_zod62.z.object({
|
|
4169
4211
|
...CABVariableFields,
|
|
4170
|
-
errorMessages:
|
|
4171
|
-
|
|
4172
|
-
|
|
4212
|
+
errorMessages: import_zod62.z.record(
|
|
4213
|
+
import_zod62.z.string(),
|
|
4214
|
+
import_zod62.z.object({
|
|
4173
4215
|
/** `{{step}}` is interpolated at render — the off-increment message React never gave a merchant key. */
|
|
4174
|
-
increment:
|
|
4175
|
-
max:
|
|
4176
|
-
min:
|
|
4177
|
-
neg:
|
|
4216
|
+
increment: import_zod62.z.string().optional(),
|
|
4217
|
+
max: import_zod62.z.string().optional(),
|
|
4218
|
+
min: import_zod62.z.string().optional(),
|
|
4219
|
+
neg: import_zod62.z.string().optional()
|
|
4178
4220
|
})
|
|
4179
4221
|
).default({
|
|
4180
4222
|
en: {
|
|
@@ -4184,18 +4226,18 @@ var CABQuantitySection = import_zod60.z.object({
|
|
|
4184
4226
|
neg: "Quantity cannot be negative"
|
|
4185
4227
|
}
|
|
4186
4228
|
}),
|
|
4187
|
-
inputType:
|
|
4188
|
-
max:
|
|
4189
|
-
min:
|
|
4229
|
+
inputType: import_zod62.z.enum(quantityInputs).default(QuantityInput.select),
|
|
4230
|
+
max: import_zod62.z.number().min(1).max(100).default(10),
|
|
4231
|
+
min: import_zod62.z.number().min(1).default(1),
|
|
4190
4232
|
/** The a11y label for the quantity control; the merchant names it in the editor, else this default. */
|
|
4191
|
-
name:
|
|
4192
|
-
sectionId:
|
|
4193
|
-
sectionType:
|
|
4233
|
+
name: import_zod62.z.string().default("Quantity"),
|
|
4234
|
+
sectionId: import_zod62.z.uuid().default(() => (0, import_uuid11.v7)()),
|
|
4235
|
+
sectionType: import_zod62.z.literal(SectionType.quantity).default(SectionType.quantity)
|
|
4194
4236
|
});
|
|
4195
4237
|
|
|
4196
4238
|
// src/schema/widgets/checkout-and-beyond/reviews.ts
|
|
4197
4239
|
var import_uuid12 = require("uuid");
|
|
4198
|
-
var
|
|
4240
|
+
var import_zod63 = require("zod");
|
|
4199
4241
|
|
|
4200
4242
|
// src/schema/widgets/checkout-and-beyond/reviewLabels.ts
|
|
4201
4243
|
var REVIEW_LABELS = {
|
|
@@ -4258,69 +4300,69 @@ var REVIEW_LABELS = {
|
|
|
4258
4300
|
};
|
|
4259
4301
|
|
|
4260
4302
|
// src/schema/widgets/checkout-and-beyond/reviews.ts
|
|
4261
|
-
var CABReviewsSection =
|
|
4303
|
+
var CABReviewsSection = import_zod63.z.object({
|
|
4262
4304
|
...CABVariableFields,
|
|
4263
|
-
color:
|
|
4305
|
+
color: import_zod63.z.string().default("#fadb14"),
|
|
4264
4306
|
/**
|
|
4265
4307
|
* Localized review-count templates (`{{reviewCount}}`), one/other plural forms; the client picks the
|
|
4266
4308
|
* form via `Intl.PluralRules`. Defaults here (schema-first) so every tree localizes without converter
|
|
4267
4309
|
* or merchant work.
|
|
4268
4310
|
*/
|
|
4269
|
-
countLabels:
|
|
4270
|
-
one:
|
|
4271
|
-
other:
|
|
4311
|
+
countLabels: import_zod63.z.object({
|
|
4312
|
+
one: import_zod63.z.record(import_zod63.z.string(), import_zod63.z.string()).default(() => ({ ...REVIEW_LABELS.one })),
|
|
4313
|
+
other: import_zod63.z.record(import_zod63.z.string(), import_zod63.z.string()).default(() => ({ ...REVIEW_LABELS.other }))
|
|
4272
4314
|
}).default(() => ({ one: { ...REVIEW_LABELS.one }, other: { ...REVIEW_LABELS.other } })),
|
|
4273
|
-
name:
|
|
4274
|
-
sectionId:
|
|
4275
|
-
sectionType:
|
|
4276
|
-
size:
|
|
4315
|
+
name: import_zod63.z.string().optional(),
|
|
4316
|
+
sectionId: import_zod63.z.uuid().default(() => (0, import_uuid12.v7)()),
|
|
4317
|
+
sectionType: import_zod63.z.literal(SectionType.reviews).default(SectionType.reviews),
|
|
4318
|
+
size: import_zod63.z.enum(reviewsSizes).default(ReviewsSize.default),
|
|
4277
4319
|
/**
|
|
4278
4320
|
* Star outline color, interpolated into a style by the renderer, so it is hex-constrained like
|
|
4279
4321
|
* `CABButtonSection.color`. The legacy source (`PostPurchaseSettings.styles.starStrokeColor`) is a free
|
|
4280
4322
|
* string: its converter must validate and fall back to this default rather than let one odd value drop
|
|
4281
4323
|
* the whole reviews section.
|
|
4282
4324
|
*/
|
|
4283
|
-
strokeColor:
|
|
4325
|
+
strokeColor: import_zod63.z.string().regex(HEX_COLOR_REGEX).default("#fadb14"),
|
|
4284
4326
|
/** Star outline width in px; `0` draws no outline. The legacy `styles.strokeWidth` is a STRING ('1') — its converter coerces. */
|
|
4285
|
-
strokeWidth:
|
|
4327
|
+
strokeWidth: import_zod63.z.number().nonnegative().default(0)
|
|
4286
4328
|
});
|
|
4287
4329
|
|
|
4288
4330
|
// src/schema/widgets/checkout-and-beyond/separator.ts
|
|
4289
4331
|
var import_uuid13 = require("uuid");
|
|
4290
|
-
var
|
|
4291
|
-
var CABSeparatorSection =
|
|
4332
|
+
var import_zod64 = require("zod");
|
|
4333
|
+
var CABSeparatorSection = import_zod64.z.object({
|
|
4292
4334
|
...CABVariableFields,
|
|
4293
|
-
sectionId:
|
|
4294
|
-
sectionType:
|
|
4335
|
+
sectionId: import_zod64.z.uuid().default(() => (0, import_uuid13.v7)()),
|
|
4336
|
+
sectionType: import_zod64.z.literal(SectionType.separator).default(SectionType.separator)
|
|
4295
4337
|
});
|
|
4296
4338
|
|
|
4297
4339
|
// src/schema/widgets/checkout-and-beyond/variants.ts
|
|
4298
4340
|
var import_compat5 = require("es-toolkit/compat");
|
|
4299
4341
|
var import_uuid14 = require("uuid");
|
|
4300
|
-
var
|
|
4301
|
-
var CABVariantsSection =
|
|
4342
|
+
var import_zod65 = require("zod");
|
|
4343
|
+
var CABVariantsSection = import_zod65.z.object({
|
|
4302
4344
|
...CABVariableFields,
|
|
4303
|
-
hideOutOfStockVariants:
|
|
4304
|
-
name:
|
|
4305
|
-
sectionId:
|
|
4306
|
-
sectionType:
|
|
4307
|
-
selector:
|
|
4345
|
+
hideOutOfStockVariants: import_zod65.z.boolean().default(false),
|
|
4346
|
+
name: import_zod65.z.string().optional(),
|
|
4347
|
+
sectionId: import_zod65.z.uuid().default(() => (0, import_uuid14.v7)()),
|
|
4348
|
+
sectionType: import_zod65.z.literal(SectionType.variants).default(SectionType.variants),
|
|
4349
|
+
selector: import_zod65.z.enum((0, import_compat5.slice)(variantSelectors, 0, 3)).default(VariantSelector.menu),
|
|
4308
4350
|
/** `productGroup` is additive (REB-24817): a renderer without group support must render nothing for it. */
|
|
4309
|
-
variantMode:
|
|
4351
|
+
variantMode: import_zod65.z.enum(variantsModes).default(VariantsMode.multiple)
|
|
4310
4352
|
});
|
|
4311
4353
|
|
|
4312
4354
|
// src/schema/widgets/checkout-and-beyond/shared.ts
|
|
4313
|
-
var CABBorder =
|
|
4314
|
-
radius:
|
|
4315
|
-
style:
|
|
4316
|
-
width:
|
|
4355
|
+
var CABBorder = import_zod66.z.object({
|
|
4356
|
+
radius: import_zod66.z.enum(borderRadii).default(BorderRadius.base),
|
|
4357
|
+
style: import_zod66.z.enum(borderStyles).default(BorderStyle.none),
|
|
4358
|
+
width: import_zod66.z.enum(borderWidths).default(BorderWidth.base)
|
|
4317
4359
|
}).default({
|
|
4318
4360
|
radius: BorderRadius.base,
|
|
4319
4361
|
style: BorderStyle.none,
|
|
4320
4362
|
width: BorderWidth.base
|
|
4321
4363
|
});
|
|
4322
|
-
var CABSection =
|
|
4323
|
-
() =>
|
|
4364
|
+
var CABSection = import_zod66.z.lazy(
|
|
4365
|
+
() => import_zod66.z.discriminatedUnion("sectionType", [
|
|
4324
4366
|
CABBannerSection,
|
|
4325
4367
|
CABButtonSection,
|
|
4326
4368
|
CABCarouselSection,
|
|
@@ -4343,41 +4385,41 @@ var CABSection = import_zod64.z.lazy(
|
|
|
4343
4385
|
);
|
|
4344
4386
|
|
|
4345
4387
|
// src/schema/widgets/checkout-and-beyond/layout.ts
|
|
4346
|
-
var GridItem =
|
|
4347
|
-
var CABLayoutWrapping =
|
|
4348
|
-
breakAt:
|
|
4349
|
-
maxPerLine:
|
|
4388
|
+
var GridItem = import_zod67.z.union([import_zod67.z.literal("auto"), import_zod67.z.literal("fill"), import_zod67.z.string().regex(/^\d+%$/), import_zod67.z.number()]);
|
|
4389
|
+
var CABLayoutWrapping = import_zod67.z.object({
|
|
4390
|
+
breakAt: import_zod67.z.number().positive(),
|
|
4391
|
+
maxPerLine: import_zod67.z.number().int().positive()
|
|
4350
4392
|
});
|
|
4351
|
-
var CABLayoutSection =
|
|
4393
|
+
var CABLayoutSection = import_zod67.z.object({
|
|
4352
4394
|
...CABVariableFields,
|
|
4353
|
-
alignment:
|
|
4354
|
-
horizontal:
|
|
4355
|
-
vertical:
|
|
4395
|
+
alignment: import_zod67.z.object({
|
|
4396
|
+
horizontal: import_zod67.z.enum(horizontalAlignments).default(HorizontalAlignment.start),
|
|
4397
|
+
vertical: import_zod67.z.enum(verticalAlignments).default(VerticalAlignment.top)
|
|
4356
4398
|
}).default({
|
|
4357
4399
|
horizontal: HorizontalAlignment.start,
|
|
4358
4400
|
vertical: VerticalAlignment.top
|
|
4359
4401
|
}),
|
|
4360
|
-
border:
|
|
4361
|
-
buttonField:
|
|
4362
|
-
direction:
|
|
4402
|
+
border: import_zod67.z.lazy(() => CABBorder),
|
|
4403
|
+
buttonField: import_zod67.z.enum(buttonFields).optional(),
|
|
4404
|
+
direction: import_zod67.z.enum(directions).default(Direction.rows),
|
|
4363
4405
|
/**
|
|
4364
4406
|
* Platform chrome around the section, not a layout behavior: `callout` is a subdued box with block borders
|
|
4365
4407
|
* (the legacy post-purchase callout banner), `offer-content` the post-purchase offer's own content card.
|
|
4366
4408
|
*/
|
|
4367
|
-
frame:
|
|
4368
|
-
grid:
|
|
4369
|
-
columns:
|
|
4370
|
-
rows:
|
|
4409
|
+
frame: import_zod67.z.enum(layoutFrames).optional(),
|
|
4410
|
+
grid: import_zod67.z.object({
|
|
4411
|
+
columns: import_zod67.z.union([import_zod67.z.array(GridItem), import_zod67.z.undefined()]).default(() => ["auto"]),
|
|
4412
|
+
rows: import_zod67.z.union([import_zod67.z.array(GridItem), import_zod67.z.undefined()]).default(() => ["auto"])
|
|
4371
4413
|
}).default({ columns: ["auto"], rows: ["auto"] }).optional(),
|
|
4372
|
-
name:
|
|
4373
|
-
padding:
|
|
4374
|
-
sectionId:
|
|
4375
|
-
sections:
|
|
4376
|
-
sectionType:
|
|
4377
|
-
spacing:
|
|
4414
|
+
name: import_zod67.z.string().optional(),
|
|
4415
|
+
padding: import_zod67.z.enum(spacings).default(Spacing.none),
|
|
4416
|
+
sectionId: import_zod67.z.uuid().default(() => (0, import_uuid15.v7)()),
|
|
4417
|
+
sections: import_zod67.z.union([import_zod67.z.array(import_zod67.z.lazy(() => CABSection)), import_zod67.z.strictObject({}).transform(() => [])]).default(() => []),
|
|
4418
|
+
sectionType: import_zod67.z.literal(SectionType.layout).default(SectionType.layout),
|
|
4419
|
+
spacing: import_zod67.z.enum(spacings).default(Spacing.base),
|
|
4378
4420
|
/** Fire-and-forget impression pixel POSTed once when the section is shown (e.g. a Monetize offer view). */
|
|
4379
|
-
viewUrl:
|
|
4380
|
-
width:
|
|
4421
|
+
viewUrl: import_zod67.z.string().optional(),
|
|
4422
|
+
width: import_zod67.z.number().default(100),
|
|
4381
4423
|
wrapping: CABLayoutWrapping.optional()
|
|
4382
4424
|
});
|
|
4383
4425
|
|
|
@@ -4399,8 +4441,8 @@ var UI_LABELS = {
|
|
|
4399
4441
|
};
|
|
4400
4442
|
|
|
4401
4443
|
// src/schema/widgets/checkout-and-beyond/root.ts
|
|
4402
|
-
var localized = (fallback) =>
|
|
4403
|
-
var CABUILabels =
|
|
4444
|
+
var localized = (fallback) => import_zod68.z.record(import_zod68.z.string(), import_zod68.z.string()).default(() => ({ ...fallback })).transform((labels) => Object.keys(labels).length > 0 ? labels : { ...fallback });
|
|
4445
|
+
var CABUILabels = import_zod68.z.object({
|
|
4404
4446
|
currentPage: localized(UI_LABELS.currentPage),
|
|
4405
4447
|
guest: localized(UI_LABELS.guest),
|
|
4406
4448
|
loadingOptions: localized(UI_LABELS.loadingOptions),
|
|
@@ -4425,49 +4467,49 @@ var CABUILabels = import_zod66.z.object({
|
|
|
4425
4467
|
subscriptionOptions: { ...UI_LABELS.subscriptionOptions },
|
|
4426
4468
|
updating: { ...UI_LABELS.updating }
|
|
4427
4469
|
}));
|
|
4428
|
-
var TargetArea =
|
|
4429
|
-
fill:
|
|
4430
|
-
flip:
|
|
4431
|
-
icon:
|
|
4432
|
-
label:
|
|
4433
|
-
width:
|
|
4470
|
+
var TargetArea = import_zod68.z.object({
|
|
4471
|
+
fill: import_zod68.z.boolean().optional(),
|
|
4472
|
+
flip: import_zod68.z.enum(["both", "horizontal", "vertical"]).optional(),
|
|
4473
|
+
icon: import_zod68.z.string(),
|
|
4474
|
+
label: import_zod68.z.string(),
|
|
4475
|
+
width: import_zod68.z.string()
|
|
4434
4476
|
}).default(targetAreas[EditorMode.checkoutExtension][1]);
|
|
4435
|
-
var CABTracking =
|
|
4436
|
-
enableAttribution:
|
|
4437
|
-
enableSource:
|
|
4438
|
-
enableWidget:
|
|
4477
|
+
var CABTracking = import_zod68.z.object({
|
|
4478
|
+
enableAttribution: import_zod68.z.boolean().nullish().transform((value) => value ?? true),
|
|
4479
|
+
enableSource: import_zod68.z.boolean().nullish().transform((value) => value ?? true),
|
|
4480
|
+
enableWidget: import_zod68.z.boolean().nullish().transform((value) => value ?? true)
|
|
4439
4481
|
}).nullish().transform((value) => value ?? { enableAttribution: true, enableSource: true, enableWidget: true });
|
|
4440
|
-
var CABExperiment =
|
|
4441
|
-
elementId:
|
|
4442
|
-
experimentId:
|
|
4443
|
-
experimentType:
|
|
4444
|
-
selectedId:
|
|
4482
|
+
var CABExperiment = import_zod68.z.object({
|
|
4483
|
+
elementId: import_zod68.z.number(),
|
|
4484
|
+
experimentId: import_zod68.z.number(),
|
|
4485
|
+
experimentType: import_zod68.z.string(),
|
|
4486
|
+
selectedId: import_zod68.z.number()
|
|
4445
4487
|
});
|
|
4446
4488
|
var CABRootSection = CABLayoutSection.extend({
|
|
4447
|
-
editorMode:
|
|
4489
|
+
editorMode: import_zod68.z.enum(editorModes).default(EditorMode.checkoutExtension),
|
|
4448
4490
|
experiment: CABExperiment.optional(),
|
|
4449
4491
|
// Same rule as CABTracking above: the v1 converters pass raw legacy `previewMode` through, so a
|
|
4450
4492
|
// `null` must fall back rather than throw the widget; malformed values still throw.
|
|
4451
|
-
previewMode:
|
|
4452
|
-
storeId:
|
|
4493
|
+
previewMode: import_zod68.z.boolean().nullish().transform((value) => value ?? false),
|
|
4494
|
+
storeId: import_zod68.z.number().nullable().default(null),
|
|
4453
4495
|
targetArea: TargetArea.nullable(),
|
|
4454
4496
|
tracking: CABTracking,
|
|
4455
|
-
type:
|
|
4497
|
+
type: import_zod68.z.enum(widgetTypes).default(WidgetType.ui_extension_content_block),
|
|
4456
4498
|
uiLabels: CABUILabels,
|
|
4457
|
-
version:
|
|
4458
|
-
widgetId:
|
|
4499
|
+
version: import_zod68.z.literal(2).default(2),
|
|
4500
|
+
widgetId: import_zod68.z.number().nullable().default(null)
|
|
4459
4501
|
});
|
|
4460
4502
|
|
|
4461
4503
|
// src/schema/postPurchaseProductView.ts
|
|
4462
|
-
var PostPurchaseProductView =
|
|
4463
|
-
|
|
4504
|
+
var PostPurchaseProductView = import_zod69.z.union([
|
|
4505
|
+
import_zod69.z.object({
|
|
4464
4506
|
changeset: PostPurchaseProductChangeset.optional(),
|
|
4465
4507
|
displayPrice: PostPurchaseDisplayPrice.optional(),
|
|
4466
4508
|
groupCatalog: PostPurchaseGroupCatalog.optional(),
|
|
4467
4509
|
initialVariant: PostPurchaseVariantSelector.optional(),
|
|
4468
4510
|
planCatalog: PostPurchasePlanCatalog.nullable().optional(),
|
|
4469
4511
|
preparation: PreparedPostPurchaseProduct.extend({
|
|
4470
|
-
display: PreparedPostPurchaseProduct.shape.display.extend({ description:
|
|
4512
|
+
display: PreparedPostPurchaseProduct.shape.display.extend({ description: import_zod69.z.string().nullable() }).refine(
|
|
4471
4513
|
({ description, descriptionDocument }) => description === null === (descriptionDocument !== void 0),
|
|
4472
4514
|
"Exactly one of the plain and rich descriptions is shown"
|
|
4473
4515
|
)
|
|
@@ -4476,7 +4518,7 @@ var PostPurchaseProductView = import_zod67.z.union([
|
|
|
4476
4518
|
sections: CABRootSection,
|
|
4477
4519
|
variantCatalog: PostPurchaseVariantCatalog.optional()
|
|
4478
4520
|
}),
|
|
4479
|
-
|
|
4521
|
+
import_zod69.z.object({
|
|
4480
4522
|
groupCatalog: PostPurchaseGroupCatalog.optional(),
|
|
4481
4523
|
initialVariant: PostPurchaseVariantSelector.optional(),
|
|
4482
4524
|
/** The localized unavailable copy, for the choices still offered beneath an unprepared product. */
|
|
@@ -4491,21 +4533,21 @@ var PostPurchaseProductView = import_zod67.z.union([
|
|
|
4491
4533
|
]);
|
|
4492
4534
|
|
|
4493
4535
|
// src/schema/postPurchaseProductCollectionView.ts
|
|
4494
|
-
var PostPurchaseProductCollectionView =
|
|
4495
|
-
members:
|
|
4496
|
-
|
|
4536
|
+
var PostPurchaseProductCollectionView = import_zod70.z.object({
|
|
4537
|
+
members: import_zod70.z.array(
|
|
4538
|
+
import_zod70.z.object({
|
|
4497
4539
|
productId: PostPurchaseProductId,
|
|
4498
|
-
productIndex:
|
|
4540
|
+
productIndex: import_zod70.z.number().int().nonnegative(),
|
|
4499
4541
|
view: PostPurchaseProductView
|
|
4500
4542
|
})
|
|
4501
4543
|
)
|
|
4502
4544
|
});
|
|
4503
|
-
var PostPurchaseCollectionChoice =
|
|
4545
|
+
var PostPurchaseCollectionChoice = import_zod70.z.object({
|
|
4504
4546
|
choice: PostPurchaseChoice.optional(),
|
|
4505
4547
|
productId: PostPurchaseProductId,
|
|
4506
4548
|
variantId: PostPurchaseVariantSelector.shape.variantId.optional()
|
|
4507
4549
|
}).strict();
|
|
4508
|
-
var PostPurchaseExcludedProductIds =
|
|
4550
|
+
var PostPurchaseExcludedProductIds = import_zod70.z.array(PostPurchaseProductId).default([]);
|
|
4509
4551
|
var PostPurchaseMemberSelector = PostPurchaseProgressSchema.shape.members.element.pick({ productId: true }).extend({ progressRevision: PostPurchaseProgressSchema.shape.revision });
|
|
4510
4552
|
var PostPurchaseMemberPointer = PostPurchaseProgressSchema.shape.members.element.omit({ status: true }).extend({
|
|
4511
4553
|
entryRevision: PostPurchaseProgressSchema.shape.entryRevision,
|
|
@@ -4518,7 +4560,7 @@ var PostPurchaseQuantityChoice = PostPurchaseCollectionChoice.extend({ quantity:
|
|
|
4518
4560
|
var PostPurchaseQuantityPolicy = PostPurchaseSettings.shape.quantityInputs.omit({ defaultQuantity: true }).extend({
|
|
4519
4561
|
initialQuantity: quantity,
|
|
4520
4562
|
maxValue: quantity,
|
|
4521
|
-
minValue:
|
|
4563
|
+
minValue: import_zod71.z.literal(0).transform(() => 1).or(quantity)
|
|
4522
4564
|
}).refine(({ maxValue, minValue }) => minValue <= maxValue, "Quantity bounds are reversed");
|
|
4523
4565
|
|
|
4524
4566
|
// src/schema/postPurchaseGroup.ts
|
|
@@ -4527,33 +4569,33 @@ var PostPurchaseGroupChoice = PostPurchaseQuantityChoice.extend({
|
|
|
4527
4569
|
});
|
|
4528
4570
|
|
|
4529
4571
|
// src/schema/postPurchaseHealth.ts
|
|
4530
|
-
var
|
|
4572
|
+
var import_zod74 = require("zod");
|
|
4531
4573
|
|
|
4532
4574
|
// src/schema/postPurchaseHealthSchedule.ts
|
|
4533
|
-
var
|
|
4575
|
+
var import_zod73 = require("zod");
|
|
4534
4576
|
|
|
4535
4577
|
// src/schema/postPurchaseReleaseSchedule.ts
|
|
4536
|
-
var
|
|
4537
|
-
var postPurchaseTaskNameSchema = (queue, id) =>
|
|
4538
|
-
var SessionReleaseScheduleRequestSchema =
|
|
4578
|
+
var import_zod72 = require("zod");
|
|
4579
|
+
var postPurchaseTaskNameSchema = (queue, id) => import_zod72.z.string().regex(new RegExp(`^projects/[a-zA-Z0-9.:-]+/locations/us-central1/queues/${queue}/tasks/${id}$`));
|
|
4580
|
+
var SessionReleaseScheduleRequestSchema = import_zod72.z.strictObject({
|
|
4539
4581
|
deadline: PostPurchaseTimestampSchema,
|
|
4540
4582
|
orderId: PostPurchaseOrderIdSchema,
|
|
4541
4583
|
releaseOwner: ReleaseOwnerSchema,
|
|
4542
4584
|
sessionId: PostPurchaseSessionIdSchema
|
|
4543
4585
|
});
|
|
4544
|
-
var SessionReleaseScheduleResponseSchema =
|
|
4545
|
-
data:
|
|
4586
|
+
var SessionReleaseScheduleResponseSchema = import_zod72.z.object({
|
|
4587
|
+
data: import_zod72.z.discriminatedUnion("status", [
|
|
4546
4588
|
SessionReleaseScheduleRequestSchema.extend({
|
|
4547
|
-
releaseOwner:
|
|
4548
|
-
status:
|
|
4589
|
+
releaseOwner: import_zod72.z.literal("rebuy"),
|
|
4590
|
+
status: import_zod72.z.literal("queued"),
|
|
4549
4591
|
taskName: postPurchaseTaskNameSchema("post-purchase-order-hold-release", "[a-f0-9]{64}-release")
|
|
4550
4592
|
}),
|
|
4551
4593
|
SessionReleaseScheduleRequestSchema.extend({
|
|
4552
|
-
releaseOwner:
|
|
4553
|
-
status:
|
|
4594
|
+
releaseOwner: import_zod72.z.literal("shopify"),
|
|
4595
|
+
status: import_zod72.z.literal("native")
|
|
4554
4596
|
})
|
|
4555
4597
|
]),
|
|
4556
|
-
successful:
|
|
4598
|
+
successful: import_zod72.z.literal(true)
|
|
4557
4599
|
});
|
|
4558
4600
|
|
|
4559
4601
|
// src/schema/postPurchaseHealthSchedule.ts
|
|
@@ -4562,15 +4604,15 @@ var PostPurchaseHealthTaskNameSchema = postPurchaseTaskNameSchema(
|
|
|
4562
4604
|
"post-purchase-health-check",
|
|
4563
4605
|
"[a-z0-9][a-z0-9-]*--[1-9][0-9]*"
|
|
4564
4606
|
);
|
|
4565
|
-
var HealthScheduleAcknowledgementSchema =
|
|
4607
|
+
var HealthScheduleAcknowledgementSchema = import_zod73.z.strictObject({
|
|
4566
4608
|
data: HealthScheduleSchema.extend({
|
|
4567
|
-
status:
|
|
4609
|
+
status: import_zod73.z.literal("queued"),
|
|
4568
4610
|
taskName: PostPurchaseHealthTaskNameSchema
|
|
4569
4611
|
}).refine(
|
|
4570
4612
|
(data) => data.taskName.endsWith(`/tasks/${postPurchaseHealthTaskId(data)}`),
|
|
4571
4613
|
"taskName must be this order's health task"
|
|
4572
4614
|
),
|
|
4573
|
-
successful:
|
|
4615
|
+
successful: import_zod73.z.literal(true)
|
|
4574
4616
|
});
|
|
4575
4617
|
|
|
4576
4618
|
// src/schema/postPurchaseHealth.ts
|
|
@@ -4579,7 +4621,7 @@ var HealthFactSchema = HealthScheduleSchema.pick({
|
|
|
4579
4621
|
operationId: true,
|
|
4580
4622
|
removePartialOrder: true
|
|
4581
4623
|
});
|
|
4582
|
-
var HealthScheduleReceiptSchema =
|
|
4624
|
+
var HealthScheduleReceiptSchema = import_zod74.z.strictObject({
|
|
4583
4625
|
recordedAt: PostPurchaseTimestampSchema,
|
|
4584
4626
|
taskName: PostPurchaseHealthTaskNameSchema
|
|
4585
4627
|
});
|
|
@@ -4589,150 +4631,138 @@ var StoredHealthFactSchema = HealthFactSchema.extend({
|
|
|
4589
4631
|
});
|
|
4590
4632
|
var HealthAttemptSchema = StoredHealthFactSchema.extend({
|
|
4591
4633
|
attemptedAt: PostPurchaseTimestampSchema,
|
|
4592
|
-
attemptId:
|
|
4593
|
-
status:
|
|
4634
|
+
attemptId: import_zod74.z.uuid(),
|
|
4635
|
+
status: import_zod74.z.literal("attempted")
|
|
4594
4636
|
});
|
|
4595
4637
|
var HealthResultSchema = HealthAttemptSchema.extend({
|
|
4596
4638
|
finishedAt: PostPurchaseTimestampSchema,
|
|
4597
|
-
status:
|
|
4639
|
+
status: import_zod74.z.enum(["returned", "unknown"])
|
|
4598
4640
|
});
|
|
4599
|
-
var HealthStateSchema =
|
|
4600
|
-
StoredHealthFactSchema.extend({ status:
|
|
4641
|
+
var HealthStateSchema = import_zod74.z.union([
|
|
4642
|
+
StoredHealthFactSchema.extend({ status: import_zod74.z.literal("pending") }),
|
|
4601
4643
|
HealthAttemptSchema,
|
|
4602
4644
|
HealthResultSchema
|
|
4603
4645
|
]);
|
|
4604
4646
|
var HealthPrepareRequestSchema = DecideRequestSchema.extend({
|
|
4605
4647
|
operationId: HealthScheduleSchema.shape.operationId
|
|
4606
4648
|
}).strict();
|
|
4607
|
-
var HealthPrepareResponseSchema =
|
|
4608
|
-
var HealthClaimRequestSchema =
|
|
4649
|
+
var HealthPrepareResponseSchema = import_zod74.z.object({ data: HealthScheduleSchema, successful: import_zod74.z.literal(true) });
|
|
4650
|
+
var HealthClaimRequestSchema = import_zod74.z.strictObject({
|
|
4609
4651
|
orderId: PostPurchaseOrderIdSchema,
|
|
4610
|
-
removePartialOrder:
|
|
4652
|
+
removePartialOrder: import_zod74.z.boolean(),
|
|
4611
4653
|
shop: ShopifyDomainSchema
|
|
4612
4654
|
});
|
|
4613
4655
|
var HealthClaimFactSchema = HealthClaimRequestSchema.extend({
|
|
4614
4656
|
healthScheduledAt: HealthFactSchema.shape.healthScheduledAt
|
|
4615
4657
|
});
|
|
4616
|
-
var HealthClaimResponseSchema =
|
|
4617
|
-
data:
|
|
4618
|
-
|
|
4619
|
-
HealthClaimFactSchema.extend({ status:
|
|
4620
|
-
HealthClaimFactSchema.extend({ attemptId: HealthAttemptSchema.shape.attemptId, status:
|
|
4658
|
+
var HealthClaimResponseSchema = import_zod74.z.object({
|
|
4659
|
+
data: import_zod74.z.union([
|
|
4660
|
+
import_zod74.z.strictObject({ status: import_zod74.z.literal("missing") }),
|
|
4661
|
+
HealthClaimFactSchema.extend({ status: import_zod74.z.enum(["pending", "attempted", "returned", "unknown"]) }),
|
|
4662
|
+
HealthClaimFactSchema.extend({ attemptId: HealthAttemptSchema.shape.attemptId, status: import_zod74.z.literal("claimed") })
|
|
4621
4663
|
]),
|
|
4622
|
-
successful:
|
|
4664
|
+
successful: import_zod74.z.literal(true)
|
|
4623
4665
|
});
|
|
4624
4666
|
var HealthResultRequestSchema = HealthClaimRequestSchema.extend({
|
|
4625
4667
|
attemptId: HealthAttemptSchema.shape.attemptId,
|
|
4626
4668
|
outcome: HealthResultSchema.shape.status
|
|
4627
4669
|
});
|
|
4628
|
-
var HealthResultResponseSchema =
|
|
4670
|
+
var HealthResultResponseSchema = import_zod74.z.object({
|
|
4629
4671
|
data: HealthClaimFactSchema.extend({
|
|
4630
4672
|
finishedAt: HealthResultSchema.shape.finishedAt,
|
|
4631
4673
|
status: HealthResultSchema.shape.status
|
|
4632
4674
|
}),
|
|
4633
|
-
successful:
|
|
4675
|
+
successful: import_zod74.z.literal(true)
|
|
4634
4676
|
});
|
|
4635
4677
|
|
|
4636
4678
|
// src/schema/postPurchaseLifecycle.ts
|
|
4637
|
-
var
|
|
4638
|
-
var Presentation =
|
|
4679
|
+
var import_zod75 = require("zod");
|
|
4680
|
+
var Presentation = import_zod75.z.strictObject({
|
|
4639
4681
|
member: PostPurchaseMemberIdentity,
|
|
4640
4682
|
selectedProductId: PostPurchaseMemberIdentity.shape.productId.optional(),
|
|
4641
4683
|
variant: PostPurchaseVariantSelector
|
|
4642
4684
|
});
|
|
4643
4685
|
var LifecycleObservationRequestSchema = DecideRequestSchema.extend({
|
|
4644
4686
|
entryRevision: PostPurchaseProgressSchema.shape.entryRevision,
|
|
4645
|
-
eventType:
|
|
4687
|
+
eventType: import_zod75.z.enum(["OFFER_VIEWED", "OFFER_TIMER_EXPIRED"]),
|
|
4646
4688
|
presentation: Presentation.nullable(),
|
|
4647
4689
|
progressRevision: PostPurchaseProgressSchema.shape.revision,
|
|
4648
|
-
requestId:
|
|
4690
|
+
requestId: import_zod75.z.uuid()
|
|
4649
4691
|
}).strict().refine(
|
|
4650
4692
|
({ eventType, presentation }) => eventType !== "OFFER_VIEWED" || presentation !== null,
|
|
4651
4693
|
"Viewed observations require a presented product"
|
|
4652
4694
|
);
|
|
4653
|
-
var LifecycleObservationResponseSchema =
|
|
4654
|
-
data:
|
|
4695
|
+
var LifecycleObservationResponseSchema = import_zod75.z.object({
|
|
4696
|
+
data: import_zod75.z.strictObject({
|
|
4655
4697
|
requestId: LifecycleObservationRequestSchema.shape.requestId,
|
|
4656
|
-
status:
|
|
4698
|
+
status: import_zod75.z.union([AcceptedEventOutcomeSchema, import_zod75.z.literal("unavailable")])
|
|
4657
4699
|
}),
|
|
4658
|
-
successful:
|
|
4700
|
+
successful: import_zod75.z.literal(true)
|
|
4659
4701
|
});
|
|
4660
4702
|
|
|
4661
4703
|
// src/schema/postPurchaseOffer.ts
|
|
4662
|
-
var
|
|
4663
|
-
|
|
4664
|
-
// src/schema/postPurchaseSkipTrace.ts
|
|
4665
|
-
var import_zod74 = require("zod");
|
|
4666
|
-
var POST_PURCHASE_SKIP_LIMIT = 32;
|
|
4667
|
-
var PostPurchaseSkipTraceSchema = import_zod74.z.array(
|
|
4668
|
-
import_zod74.z.object({
|
|
4669
|
-
entry: DecisionEntrySchema,
|
|
4670
|
-
reason: PostPurchaseSkipReasonSchema
|
|
4671
|
-
})
|
|
4672
|
-
).max(POST_PURCHASE_SKIP_LIMIT);
|
|
4673
|
-
|
|
4674
|
-
// src/schema/postPurchaseOffer.ts
|
|
4704
|
+
var import_zod76 = require("zod");
|
|
4675
4705
|
var OfferPreparationRequestSchema = DecideRequestSchema.strict();
|
|
4676
|
-
var OfferPreparationResponseSchema =
|
|
4677
|
-
data:
|
|
4678
|
-
successful:
|
|
4706
|
+
var OfferPreparationResponseSchema = import_zod76.z.object({
|
|
4707
|
+
data: import_zod76.z.object({ attemptedSkips: PostPurchaseSkipTraceSchema.optional(), progress: PostPurchaseProgressSchema }),
|
|
4708
|
+
successful: import_zod76.z.literal(true)
|
|
4679
4709
|
});
|
|
4680
4710
|
|
|
4681
4711
|
// src/schema/postPurchaseOfferEligibility.ts
|
|
4682
|
-
var
|
|
4712
|
+
var import_zod77 = require("zod");
|
|
4683
4713
|
var selection2 = PreparedPostPurchaseProduct.shape.selection;
|
|
4684
|
-
var PostPurchaseOfferSkipReason =
|
|
4685
|
-
var PostPurchaseOfferEligibilityContext =
|
|
4714
|
+
var PostPurchaseOfferSkipReason = import_zod77.z.enum(["empty", "no-eligible-subscription"]);
|
|
4715
|
+
var PostPurchaseOfferEligibilityContext = import_zod77.z.object({
|
|
4686
4716
|
excludedProductIds: PostPurchaseExcludedProductIds,
|
|
4687
|
-
originalLineItems:
|
|
4717
|
+
originalLineItems: import_zod77.z.array(selection2.pick({ productId: true, sellingPlanId: true, variantId: true }))
|
|
4688
4718
|
});
|
|
4689
|
-
var PostPurchaseOfferEligibility =
|
|
4690
|
-
|
|
4691
|
-
members:
|
|
4692
|
-
|
|
4719
|
+
var PostPurchaseOfferEligibility = import_zod77.z.discriminatedUnion("status", [
|
|
4720
|
+
import_zod77.z.object({
|
|
4721
|
+
members: import_zod77.z.array(
|
|
4722
|
+
import_zod77.z.object({ productId: selection2.shape.productId, productIndex: import_zod77.z.number().int().nonnegative() })
|
|
4693
4723
|
),
|
|
4694
|
-
status:
|
|
4724
|
+
status: import_zod77.z.literal("retain")
|
|
4695
4725
|
}),
|
|
4696
|
-
|
|
4697
|
-
|
|
4726
|
+
import_zod77.z.object({ reason: PostPurchaseOfferSkipReason, status: import_zod77.z.literal("skip") }),
|
|
4727
|
+
import_zod77.z.object({ reason: import_zod77.z.literal("eligible-upgrade").optional(), status: import_zod77.z.literal("unavailable") })
|
|
4698
4728
|
]);
|
|
4699
4729
|
|
|
4700
4730
|
// src/schema/postPurchaseOfferPresentation.ts
|
|
4701
|
-
var
|
|
4731
|
+
var import_zod78 = require("zod");
|
|
4702
4732
|
var language2 = PostPurchaseSettings.shape.language.shape.global.unwrap().unwrap();
|
|
4703
|
-
var PostPurchaseOfferPresentation =
|
|
4733
|
+
var PostPurchaseOfferPresentation = import_zod78.z.strictObject({
|
|
4704
4734
|
labels: language2.pick({ declineAll: true, declineThisOffer: true }),
|
|
4705
4735
|
layout: PostPurchaseSettings.shape.offersLayout,
|
|
4706
4736
|
sections: CABRootSection.nullable(),
|
|
4707
4737
|
showDeclineAll: PostPurchaseSettings.shape.productOptions.shape.showDeclineAll
|
|
4708
4738
|
});
|
|
4709
4739
|
var OfferPresentationRequestSchema = DecideRequestSchema.strict();
|
|
4710
|
-
var OfferPresentationResponseSchema =
|
|
4711
|
-
data:
|
|
4740
|
+
var OfferPresentationResponseSchema = import_zod78.z.object({
|
|
4741
|
+
data: import_zod78.z.strictObject({
|
|
4712
4742
|
presentation: PostPurchaseOfferPresentation.nullable(),
|
|
4713
4743
|
progress: PostPurchaseProgressSchema.nullable(),
|
|
4714
4744
|
serverNow: PostPurchaseTimestampSchema
|
|
4715
4745
|
}),
|
|
4716
|
-
successful:
|
|
4746
|
+
successful: import_zod78.z.literal(true)
|
|
4717
4747
|
});
|
|
4718
4748
|
|
|
4719
4749
|
// src/schema/postPurchaseOrderDecision.ts
|
|
4720
|
-
var
|
|
4721
|
-
var OrderDecisionSchema =
|
|
4722
|
-
|
|
4723
|
-
|
|
4750
|
+
var import_zod79 = require("zod");
|
|
4751
|
+
var OrderDecisionSchema = import_zod79.z.discriminatedUnion("owner", [
|
|
4752
|
+
import_zod79.z.object({ owner: import_zod79.z.literal("session"), sessionId: PostPurchaseSessionIdSchema }),
|
|
4753
|
+
import_zod79.z.object({ owner: import_zod79.z.literal("release"), sessionId: import_zod79.z.null() })
|
|
4724
4754
|
]);
|
|
4725
4755
|
|
|
4726
4756
|
// src/schema/postPurchasePolicy.ts
|
|
4727
|
-
var
|
|
4728
|
-
var HoldSettingSchema =
|
|
4729
|
-
|
|
4730
|
-
|
|
4757
|
+
var import_zod80 = require("zod");
|
|
4758
|
+
var HoldSettingSchema = import_zod80.z.discriminatedUnion("enabled", [
|
|
4759
|
+
import_zod80.z.object({ durationMinutes: import_zod80.z.number().int().min(1).max(60), enabled: import_zod80.z.literal(true) }),
|
|
4760
|
+
import_zod80.z.object({ durationMinutes: import_zod80.z.null(), enabled: import_zod80.z.literal(false) })
|
|
4731
4761
|
]);
|
|
4732
|
-
var TimingSettingsSchema =
|
|
4762
|
+
var TimingSettingsSchema = import_zod80.z.object({ flowHold: HoldSettingSchema, shopHold: HoldSettingSchema });
|
|
4733
4763
|
var SessionPolicySchema = TimingSettingsSchema.extend({
|
|
4734
|
-
durationMinutes:
|
|
4735
|
-
source:
|
|
4764
|
+
durationMinutes: import_zod80.z.number().int().min(1).max(60).nullable(),
|
|
4765
|
+
source: import_zod80.z.enum(["shop", "flow", "native"])
|
|
4736
4766
|
}).refine(
|
|
4737
4767
|
(policy) => {
|
|
4738
4768
|
const expectedSource = policy.shopHold.enabled ? "shop" : policy.flowHold.enabled ? "flow" : "native";
|
|
@@ -4746,8 +4776,8 @@ var SessionPolicySchema = TimingSettingsSchema.extend({
|
|
|
4746
4776
|
);
|
|
4747
4777
|
|
|
4748
4778
|
// src/schema/postPurchasePreparationOptions.ts
|
|
4749
|
-
var
|
|
4750
|
-
var PostPurchasePreparationOptions =
|
|
4779
|
+
var import_zod81 = require("zod");
|
|
4780
|
+
var PostPurchasePreparationOptions = import_zod81.z.object({
|
|
4751
4781
|
choice: PostPurchaseChoice.optional(),
|
|
4752
4782
|
member: PostPurchaseMemberSelector.strict().optional(),
|
|
4753
4783
|
quantity: PreparedPostPurchaseProduct.shape.selection.shape.quantity.optional(),
|
|
@@ -4759,8 +4789,8 @@ var PostPurchasePreparationOptions = import_zod80.z.object({
|
|
|
4759
4789
|
);
|
|
4760
4790
|
|
|
4761
4791
|
// src/schema/postPurchaseProductSettings.ts
|
|
4762
|
-
var
|
|
4763
|
-
var amount =
|
|
4792
|
+
var import_zod82 = require("zod");
|
|
4793
|
+
var amount = import_zod82.z.union([import_zod82.z.number().nonnegative(), PostPurchaseAmount.transform(Number)]);
|
|
4764
4794
|
var PostPurchaseProductSettings = PostPurchaseSettings.pick({
|
|
4765
4795
|
discountedFrom: true,
|
|
4766
4796
|
language: true,
|
|
@@ -4772,22 +4802,22 @@ var PostPurchaseProductSettings = PostPurchaseSettings.pick({
|
|
|
4772
4802
|
subscriptionIsDefault: true,
|
|
4773
4803
|
upgradeToSubscription: true
|
|
4774
4804
|
}).extend({
|
|
4775
|
-
advance:
|
|
4776
|
-
blocks:
|
|
4805
|
+
advance: import_zod82.z.unknown().default({}),
|
|
4806
|
+
blocks: import_zod82.z.array(import_zod82.z.unknown()).optional(),
|
|
4777
4807
|
discount: PostPurchaseSettings.shape.discount.extend({ amount: amount.default(30) }),
|
|
4778
|
-
integrations:
|
|
4808
|
+
integrations: import_zod82.z.unknown().default({}),
|
|
4779
4809
|
shipping: PostPurchaseSettings.shape.shipping.extend({ amount: amount.default(10) }),
|
|
4780
|
-
styles:
|
|
4810
|
+
styles: import_zod82.z.unknown().default({}),
|
|
4781
4811
|
subImages: PostPurchaseSettings.shape.subImages.catch(null),
|
|
4782
|
-
subscription:
|
|
4812
|
+
subscription: import_zod82.z.unknown().default(PostPurchaseSettings.shape.subscription.parse(void 0))
|
|
4783
4813
|
});
|
|
4784
4814
|
|
|
4785
4815
|
// src/schema/postPurchaseRecovery.ts
|
|
4786
|
-
var
|
|
4816
|
+
var import_zod83 = require("zod");
|
|
4787
4817
|
var PurchaseRecoveryRequestSchema = DecideRequestSchema.strict();
|
|
4788
|
-
var PurchaseRecoveryResponseSchema =
|
|
4789
|
-
data:
|
|
4790
|
-
operation:
|
|
4818
|
+
var PurchaseRecoveryResponseSchema = import_zod83.z.object({
|
|
4819
|
+
data: import_zod83.z.object({
|
|
4820
|
+
operation: import_zod83.z.object({
|
|
4791
4821
|
observation: RecordedPurchaseObservationSchema.nullable(),
|
|
4792
4822
|
operationId: PurchaseReceiptSchema.shape.operationId,
|
|
4793
4823
|
upgrade: UpgradeProgressSchema.optional()
|
|
@@ -4797,41 +4827,41 @@ var PurchaseRecoveryResponseSchema = import_zod82.z.object({
|
|
|
4797
4827
|
}).nullable(),
|
|
4798
4828
|
progress: PostPurchaseProgressSchema.nullable().optional()
|
|
4799
4829
|
}),
|
|
4800
|
-
successful:
|
|
4830
|
+
successful: import_zod83.z.literal(true)
|
|
4801
4831
|
});
|
|
4802
4832
|
|
|
4803
4833
|
// src/schema/postPurchaseReleaseClaim.ts
|
|
4804
|
-
var
|
|
4834
|
+
var import_zod84 = require("zod");
|
|
4805
4835
|
var ReleaseClaimRequestSchema = ReleaseAuthorityRequestSchema;
|
|
4806
|
-
var ReleaseClaimResponseSchema =
|
|
4807
|
-
data:
|
|
4808
|
-
|
|
4836
|
+
var ReleaseClaimResponseSchema = import_zod84.z.object({
|
|
4837
|
+
data: import_zod84.z.discriminatedUnion("status", [
|
|
4838
|
+
import_zod84.z.object({ status: import_zod84.z.literal("release-permitted") }),
|
|
4809
4839
|
PendingReleaseAuthoritySchema,
|
|
4810
4840
|
ReadyReleaseAuthoritySchema
|
|
4811
4841
|
]),
|
|
4812
|
-
successful:
|
|
4842
|
+
successful: import_zod84.z.literal(true)
|
|
4813
4843
|
});
|
|
4814
4844
|
|
|
4815
4845
|
// src/schema/postPurchaseSelection.ts
|
|
4816
|
-
var
|
|
4846
|
+
var import_zod85 = require("zod");
|
|
4817
4847
|
var SelectionClaimsSchema = DecideRequestSchema.extend({
|
|
4818
4848
|
appId: PostPurchaseAppIdSchema,
|
|
4819
4849
|
entry: DecisionEntrySchema,
|
|
4820
|
-
iss:
|
|
4821
|
-
purpose:
|
|
4850
|
+
iss: import_zod85.z.literal("rebuy-api"),
|
|
4851
|
+
purpose: import_zod85.z.literal("post-purchase-selection")
|
|
4822
4852
|
});
|
|
4823
4853
|
var SessionStartRequestSchema = DecideRequestSchema.extend({
|
|
4824
|
-
selectionToken:
|
|
4854
|
+
selectionToken: import_zod85.z.string().min(1).max(8192).optional()
|
|
4825
4855
|
}).strict();
|
|
4826
4856
|
|
|
4827
4857
|
// src/schema/postPurchaseSession.ts
|
|
4828
|
-
var
|
|
4858
|
+
var import_zod86 = require("zod");
|
|
4829
4859
|
var SessionIdentitySchema = DecideRequestSchema.extend({ appId: PostPurchaseAppIdSchema });
|
|
4830
|
-
var SessionOrderTimingSchema =
|
|
4860
|
+
var SessionOrderTimingSchema = import_zod86.z.object({
|
|
4831
4861
|
nativeDeadline: PostPurchaseTimestampSchema,
|
|
4832
4862
|
orderCreatedAt: PostPurchaseTimestampSchema,
|
|
4833
4863
|
orderId: PostPurchaseOrderIdSchema,
|
|
4834
|
-
timingSource:
|
|
4864
|
+
timingSource: import_zod86.z.literal("shopify-order-created-at")
|
|
4835
4865
|
});
|
|
4836
4866
|
var ReadySessionTimingSchema = SessionOrderTimingSchema.extend({
|
|
4837
4867
|
deadline: PostPurchaseTimestampSchema,
|
|
@@ -4848,33 +4878,33 @@ var ReadySessionTimingSchema = SessionOrderTimingSchema.extend({
|
|
|
4848
4878
|
message: "deadline must not exceed nativeDeadline",
|
|
4849
4879
|
path: ["deadline"]
|
|
4850
4880
|
});
|
|
4851
|
-
var SessionStartResponseSchema =
|
|
4852
|
-
data:
|
|
4853
|
-
phase:
|
|
4881
|
+
var SessionStartResponseSchema = import_zod86.z.object({
|
|
4882
|
+
data: import_zod86.z.object({
|
|
4883
|
+
phase: import_zod86.z.literal("render"),
|
|
4854
4884
|
serverNow: PostPurchaseTimestampSchema,
|
|
4855
4885
|
session: ReadySessionTimingSchema,
|
|
4856
|
-
workflowPhase:
|
|
4886
|
+
workflowPhase: import_zod86.z.literal("start")
|
|
4857
4887
|
}),
|
|
4858
|
-
successful:
|
|
4888
|
+
successful: import_zod86.z.literal(true)
|
|
4859
4889
|
});
|
|
4860
4890
|
|
|
4861
4891
|
// src/schema/postPurchaseShadow.ts
|
|
4862
|
-
var
|
|
4863
|
-
var PostPurchaseShadowSelectionSchema =
|
|
4864
|
-
|
|
4865
|
-
|
|
4892
|
+
var import_zod87 = require("zod");
|
|
4893
|
+
var PostPurchaseShadowSelectionSchema = import_zod87.z.discriminatedUnion("verdict", [
|
|
4894
|
+
import_zod87.z.object({ entry: DecisionEntrySchema, verdict: import_zod87.z.literal("render") }),
|
|
4895
|
+
import_zod87.z.object({ verdict: import_zod87.z.literal("skip") })
|
|
4866
4896
|
]);
|
|
4867
|
-
var PostPurchaseShadowReportFields =
|
|
4868
|
-
differences:
|
|
4897
|
+
var PostPurchaseShadowReportFields = import_zod87.z.object({
|
|
4898
|
+
differences: import_zod87.z.array(import_zod87.z.enum(["verdict", "entry", "targeting", "incomplete-capture", "unsupported-configuration"])).refine((differences) => new Set(differences).size === differences.length, {
|
|
4869
4899
|
message: "differences must not contain duplicate entries"
|
|
4870
4900
|
}),
|
|
4871
4901
|
legacySelection: PostPurchaseShadowSelectionSchema,
|
|
4872
|
-
phase:
|
|
4873
|
-
sampleId:
|
|
4902
|
+
phase: import_zod87.z.literal("shouldRender"),
|
|
4903
|
+
sampleId: import_zod87.z.string(),
|
|
4874
4904
|
serverSelection: PostPurchaseShadowSelectionSchema.optional(),
|
|
4875
|
-
status:
|
|
4876
|
-
targetingFlowIds:
|
|
4877
|
-
workflowPhase:
|
|
4905
|
+
status: import_zod87.z.enum(["match", "diverged", "incomplete"]),
|
|
4906
|
+
targetingFlowIds: import_zod87.z.array(import_zod87.z.number().int().positive()),
|
|
4907
|
+
workflowPhase: import_zod87.z.literal("decide")
|
|
4878
4908
|
});
|
|
4879
4909
|
var PostPurchaseShadowReportSchema = PostPurchaseShadowReportFields.refine(
|
|
4880
4910
|
(report) => report.status !== "match" || report.differences.length === 0,
|
|
@@ -4888,9 +4918,9 @@ var PostPurchaseShadowReportSchema = PostPurchaseShadowReportFields.refine(
|
|
|
4888
4918
|
});
|
|
4889
4919
|
|
|
4890
4920
|
// src/schema/postPurchaseSubscriptionProduct.ts
|
|
4891
|
-
var
|
|
4921
|
+
var import_zod88 = require("zod");
|
|
4892
4922
|
var PreparedPostPurchaseSubscription = PreparedPostPurchaseProduct.extend({
|
|
4893
|
-
selection: PreparedPostPurchaseProduct.shape.selection.extend({ sellingPlanId:
|
|
4923
|
+
selection: PreparedPostPurchaseProduct.shape.selection.extend({ sellingPlanId: import_zod88.z.number().int().positive() }),
|
|
4894
4924
|
terms: PreparedPostPurchaseProduct.shape.terms.extend({
|
|
4895
4925
|
subscription: PostPurchaseSubscriptionTerms
|
|
4896
4926
|
}).refine(
|
|
@@ -4902,28 +4932,6 @@ var readPostPurchaseSubscription = (prepared) => {
|
|
|
4902
4932
|
return PreparedPostPurchaseSubscription.parse(prepared);
|
|
4903
4933
|
};
|
|
4904
4934
|
|
|
4905
|
-
// src/schema/postPurchaseTransition.ts
|
|
4906
|
-
var import_zod88 = require("zod");
|
|
4907
|
-
var OfferTransitionRequestSchema = DecideRequestSchema.extend({
|
|
4908
|
-
entryRevision: PostPurchaseProgressSchema.shape.entryRevision,
|
|
4909
|
-
progressRevision: PostPurchaseProgressSchema.shape.revision
|
|
4910
|
-
}).strict();
|
|
4911
|
-
var PostPurchaseEndReasonSchema = import_zod88.z.enum(["no-child", "no-products", "accept-cap"]);
|
|
4912
|
-
var TransitionBaseSchema = import_zod88.z.object({
|
|
4913
|
-
attemptedSkips: PostPurchaseSkipTraceSchema.optional(),
|
|
4914
|
-
progress: PostPurchaseProgressSchema
|
|
4915
|
-
});
|
|
4916
|
-
var OfferTransitionResponseSchema = import_zod88.z.object({
|
|
4917
|
-
data: import_zod88.z.discriminatedUnion("status", [
|
|
4918
|
-
TransitionBaseSchema.extend({ status: import_zod88.z.enum(["advanced", "unavailable"]) }),
|
|
4919
|
-
TransitionBaseSchema.extend({
|
|
4920
|
-
endReason: PostPurchaseEndReasonSchema.optional(),
|
|
4921
|
-
status: import_zod88.z.literal("no-child")
|
|
4922
|
-
})
|
|
4923
|
-
]),
|
|
4924
|
-
successful: import_zod88.z.literal(true)
|
|
4925
|
-
});
|
|
4926
|
-
|
|
4927
4935
|
// src/schema/postPurchaseVariantDefault.ts
|
|
4928
4936
|
var import_zod89 = require("zod");
|
|
4929
4937
|
var values = PostPurchaseVariantValues.partial().extend({
|