@rebuy/rebuy 3.37.0 → 3.39.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 +1589 -1096
- package/dist/index.d.ts +2 -0
- package/dist/index.mjs +1589 -1096
- package/dist/pricing/postPurchaseChangeset.d.ts +5 -0
- package/dist/pricing/postPurchaseCosts.d.ts +5 -0
- package/dist/schema/index.d.ts +18 -0
- package/dist/schema/postPurchaseAcceptedEvent.d.ts +76 -0
- package/dist/schema/postPurchaseAcceptedMetafield.d.ts +40 -0
- package/dist/schema/postPurchaseAdmission.d.ts +158 -0
- package/dist/schema/postPurchaseAnalytics.d.ts +24 -0
- package/dist/schema/postPurchaseClassification.d.ts +34 -0
- package/dist/schema/postPurchaseDecline.d.ts +87 -0
- package/dist/schema/postPurchaseDeclineDelivery.d.ts +17 -0
- package/dist/schema/postPurchaseFinish.d.ts +95 -0
- package/dist/schema/postPurchaseFollowups.d.ts +130 -0
- package/dist/schema/postPurchaseHealthProgress.d.ts +40 -0
- package/dist/schema/postPurchaseLifecycle.d.ts +36 -0
- package/dist/schema/postPurchaseMemberIdentity.d.ts +7 -0
- package/dist/schema/postPurchaseObservation.d.ts +131 -0
- package/dist/schema/postPurchaseOffer.d.ts +68 -0
- package/dist/schema/postPurchaseOfferPresentation.d.ts +437 -1
- package/dist/schema/postPurchasePreparationOptions.d.ts +20 -0
- package/dist/schema/postPurchaseProductCollectionView.d.ts +31 -5
- package/dist/schema/postPurchaseProgress.d.ts +42 -0
- package/dist/schema/postPurchaseRecovery.d.ts +85 -0
- package/dist/schema/postPurchaseTransition.d.ts +73 -0
- package/dist/schema/widgets/checkout-and-beyond/banner.d.ts +1 -1
- package/dist/schema/widgets/checkout-and-beyond/carousel.d.ts +1 -1
- package/dist/schema/widgets/checkout-and-beyond/cartLine.d.ts +1 -1
- package/dist/schema/widgets/checkout-and-beyond/offers.d.ts +1 -1
- package/dist/schema/widgets/checkout-and-beyond/progressBar.d.ts +1 -1
- package/dist/server/__fixtures__/postPurchasePurchase.d.ts +63 -0
- package/dist/server/__fixtures__/postPurchaseSubscription.d.ts +42 -0
- package/dist/server/adsEngine.d.ts +1 -0
- package/dist/server/index.cjs +396 -144
- package/dist/server/index.d.ts +1 -0
- package/dist/server/index.mjs +396 -144
- package/dist/server/preparePostPurchaseDeclineDisplay.d.ts +6 -0
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -22,6 +22,16 @@ var src_exports = {};
|
|
|
22
22
|
__export(src_exports, {
|
|
23
23
|
ABTestingPlaceholder: () => ABTestingPlaceholder,
|
|
24
24
|
ARRAY_INDEX_STRING: () => ARRAY_INDEX_STRING,
|
|
25
|
+
AcceptedEventAttemptProgressSchema: () => AcceptedEventAttemptProgressSchema,
|
|
26
|
+
AcceptedEventOutcomeSchema: () => AcceptedEventOutcomeSchema,
|
|
27
|
+
AcceptedEventRequestSchema: () => AcceptedEventRequestSchema,
|
|
28
|
+
AcceptedEventResponseSchema: () => AcceptedEventResponseSchema,
|
|
29
|
+
AcceptedEventResultProgressSchema: () => AcceptedEventResultProgressSchema,
|
|
30
|
+
AcceptedFollowupsResponseSchema: () => AcceptedFollowupsResponseSchema,
|
|
31
|
+
AcceptedMetafieldOutcomeSchema: () => AcceptedMetafieldOutcomeSchema,
|
|
32
|
+
AcceptedMetafieldRequestSchema: () => AcceptedMetafieldRequestSchema,
|
|
33
|
+
AcceptedMetafieldResponseSchema: () => AcceptedMetafieldResponseSchema,
|
|
34
|
+
AcceptedMetafieldResultSchema: () => AcceptedMetafieldResultSchema,
|
|
25
35
|
Api: () => Api,
|
|
26
36
|
BannerColor: () => BannerColor,
|
|
27
37
|
BlockType: () => BlockType,
|
|
@@ -88,6 +98,9 @@ __export(src_exports, {
|
|
|
88
98
|
CacheInfo: () => CacheInfo,
|
|
89
99
|
CalloutBannerBlock: () => CalloutBannerBlock,
|
|
90
100
|
CheckoutExtension: () => CheckoutExtension,
|
|
101
|
+
ClassificationAttemptProgressSchema: () => ClassificationAttemptProgressSchema,
|
|
102
|
+
ClassificationProgressSchema: () => ClassificationProgressSchema,
|
|
103
|
+
ClassificationResultProgressSchema: () => ClassificationResultProgressSchema,
|
|
91
104
|
ContentBlock: () => ContentBlock,
|
|
92
105
|
ContentBlockV1: () => ContentBlockV1,
|
|
93
106
|
ContentOperator: () => ContentOperator,
|
|
@@ -97,17 +110,22 @@ __export(src_exports, {
|
|
|
97
110
|
DYNAMIC_TOKEN_REGEX: () => DYNAMIC_TOKEN_REGEX,
|
|
98
111
|
DecideRequestSchema: () => DecideRequestSchema,
|
|
99
112
|
DecisionEntrySchema: () => DecisionEntrySchema,
|
|
113
|
+
DeclineDeliveryProgressSchema: () => DeclineDeliveryProgressSchema,
|
|
100
114
|
Direction: () => Direction,
|
|
101
115
|
DiscountSource: () => DiscountSource,
|
|
102
116
|
DiscountType: () => DiscountType,
|
|
103
117
|
EditorMode: () => EditorMode,
|
|
118
|
+
EventCalculationSchema: () => EventCalculationSchema,
|
|
104
119
|
ExitPolicySchema: () => ExitPolicySchema,
|
|
120
|
+
FinishedPurchaseSchema: () => FinishedPurchaseSchema,
|
|
105
121
|
GIFT_LABELS: () => GIFT_LABELS,
|
|
106
122
|
Geolocation: () => Geolocation,
|
|
107
123
|
GiftWithPurchase: () => GiftWithPurchase,
|
|
108
124
|
GridItem: () => GridItem,
|
|
109
125
|
HEX_COLOR_REGEX: () => HEX_COLOR_REGEX,
|
|
110
126
|
HTML_TAGS_REGEX: () => HTML_TAGS_REGEX,
|
|
127
|
+
HealthScheduleSchema: () => HealthScheduleSchema,
|
|
128
|
+
HealthSchedulingResponseSchema: () => HealthSchedulingResponseSchema,
|
|
111
129
|
HoldSettingSchema: () => HoldSettingSchema,
|
|
112
130
|
HorizontalAlignment: () => HorizontalAlignment,
|
|
113
131
|
IconName: () => IconName,
|
|
@@ -119,6 +137,8 @@ __export(src_exports, {
|
|
|
119
137
|
InlineTextSizeName: () => InlineTextSizeName,
|
|
120
138
|
LanguageKey: () => LanguageKey,
|
|
121
139
|
LayoutFrame: () => LayoutFrame,
|
|
140
|
+
LifecycleObservationRequestSchema: () => LifecycleObservationRequestSchema,
|
|
141
|
+
LifecycleObservationResponseSchema: () => LifecycleObservationResponseSchema,
|
|
122
142
|
LineItemEditor: () => LineItemEditor,
|
|
123
143
|
LineItemEditorSwitchLanguageV1: () => LineItemEditorSwitchLanguageV1,
|
|
124
144
|
LineItemEditorV1: () => LineItemEditorV1,
|
|
@@ -127,7 +147,15 @@ __export(src_exports, {
|
|
|
127
147
|
NO_HTML: () => NO_HTML,
|
|
128
148
|
OFFER_LABELS: () => OFFER_LABELS,
|
|
129
149
|
ObjectFit: () => ObjectFit,
|
|
150
|
+
OfferDeclineRequestSchema: () => OfferDeclineRequestSchema,
|
|
151
|
+
OfferDeclineResponseSchema: () => OfferDeclineResponseSchema,
|
|
152
|
+
OfferPreparationRequestSchema: () => OfferPreparationRequestSchema,
|
|
153
|
+
OfferPreparationResponseSchema: () => OfferPreparationResponseSchema,
|
|
154
|
+
OfferPresentationRequestSchema: () => OfferPresentationRequestSchema,
|
|
155
|
+
OfferPresentationResponseSchema: () => OfferPresentationResponseSchema,
|
|
130
156
|
OfferProduct: () => OfferProduct,
|
|
157
|
+
OfferTransitionRequestSchema: () => OfferTransitionRequestSchema,
|
|
158
|
+
OfferTransitionResponseSchema: () => OfferTransitionResponseSchema,
|
|
131
159
|
OffersDirection: () => OffersDirection,
|
|
132
160
|
OrderDecisionSchema: () => OrderDecisionSchema,
|
|
133
161
|
POST_PURCHASE_SKIP_LIMIT: () => POST_PURCHASE_SKIP_LIMIT,
|
|
@@ -147,6 +175,9 @@ __export(src_exports, {
|
|
|
147
175
|
PostPurchaseGroupDescription: () => PostPurchaseGroupDescription,
|
|
148
176
|
PostPurchaseGroupSelection: () => PostPurchaseGroupSelection,
|
|
149
177
|
PostPurchaseKlaviyoReviewRating: () => PostPurchaseKlaviyoReviewRating,
|
|
178
|
+
PostPurchaseMemberIdentity: () => PostPurchaseMemberIdentity,
|
|
179
|
+
PostPurchaseMemberPointer: () => PostPurchaseMemberPointer,
|
|
180
|
+
PostPurchaseMemberSelector: () => PostPurchaseMemberSelector,
|
|
150
181
|
PostPurchaseOffer: () => PostPurchaseOffer,
|
|
151
182
|
PostPurchaseOfferEligibility: () => PostPurchaseOfferEligibility,
|
|
152
183
|
PostPurchaseOfferEligibilityContext: () => PostPurchaseOfferEligibilityContext,
|
|
@@ -160,6 +191,7 @@ __export(src_exports, {
|
|
|
160
191
|
PostPurchasePlanCatalog: () => PostPurchasePlanCatalog,
|
|
161
192
|
PostPurchasePlanOption: () => PostPurchasePlanOption,
|
|
162
193
|
PostPurchasePreparation: () => PostPurchasePreparation,
|
|
194
|
+
PostPurchasePreparationOptions: () => PostPurchasePreparationOptions,
|
|
163
195
|
PostPurchasePrimaryImageSource: () => PostPurchasePrimaryImageSource,
|
|
164
196
|
PostPurchaseProductCalculation: () => PostPurchaseProductCalculation,
|
|
165
197
|
PostPurchaseProductChangeset: () => PostPurchaseProductChangeset,
|
|
@@ -172,6 +204,7 @@ __export(src_exports, {
|
|
|
172
204
|
PostPurchaseProductSettings: () => PostPurchaseProductSettings,
|
|
173
205
|
PostPurchaseProductSource: () => PostPurchaseProductSource,
|
|
174
206
|
PostPurchaseProductView: () => PostPurchaseProductView,
|
|
207
|
+
PostPurchaseProgressSchema: () => PostPurchaseProgressSchema,
|
|
175
208
|
PostPurchaseQuantityChoice: () => PostPurchaseQuantityChoice,
|
|
176
209
|
PostPurchaseQuantityPolicy: () => PostPurchaseQuantityPolicy,
|
|
177
210
|
PostPurchaseReviewCount: () => PostPurchaseReviewCount,
|
|
@@ -205,6 +238,18 @@ __export(src_exports, {
|
|
|
205
238
|
ProgressTierExclusionType: () => ProgressTierExclusionType,
|
|
206
239
|
ProgressTierType: () => ProgressTierType,
|
|
207
240
|
ProgressTierUnit: () => ProgressTierUnit,
|
|
241
|
+
PurchaseAnalyticsRequestSchema: () => PurchaseAnalyticsRequestSchema,
|
|
242
|
+
PurchaseAnalyticsResponseSchema: () => PurchaseAnalyticsResponseSchema,
|
|
243
|
+
PurchaseAnalyticsStatusSchema: () => PurchaseAnalyticsStatusSchema,
|
|
244
|
+
PurchaseExpectedSchema: () => PurchaseExpectedSchema,
|
|
245
|
+
PurchaseObservationRequestSchema: () => PurchaseObservationRequestSchema,
|
|
246
|
+
PurchaseObservationResponseSchema: () => PurchaseObservationResponseSchema,
|
|
247
|
+
PurchaseObservationSchema: () => PurchaseObservationSchema,
|
|
248
|
+
PurchaseReceiptSchema: () => PurchaseReceiptSchema,
|
|
249
|
+
PurchaseRecoveryRequestSchema: () => PurchaseRecoveryRequestSchema,
|
|
250
|
+
PurchaseRecoveryResponseSchema: () => PurchaseRecoveryResponseSchema,
|
|
251
|
+
PurchaseRequestSchema: () => PurchaseRequestSchema,
|
|
252
|
+
PurchaseResponseSchema: () => PurchaseResponseSchema,
|
|
208
253
|
QuantityInput: () => QuantityInput,
|
|
209
254
|
REVIEW_LABELS: () => REVIEW_LABELS,
|
|
210
255
|
ROOT_RELATIVE_PATH_REGEX: () => ROOT_RELATIVE_PATH_REGEX,
|
|
@@ -214,6 +259,9 @@ __export(src_exports, {
|
|
|
214
259
|
RebuyClient: () => RebuyClient,
|
|
215
260
|
RebuyMonetize: () => RebuyMonetize,
|
|
216
261
|
RebuyMonetizeV1: () => RebuyMonetizeV1,
|
|
262
|
+
RecordedOfferDeclineSchema: () => RecordedOfferDeclineSchema,
|
|
263
|
+
RecordedPurchaseObservationSchema: () => RecordedPurchaseObservationSchema,
|
|
264
|
+
RequiredHealthSchema: () => RequiredHealthSchema,
|
|
217
265
|
ResultCountOperator: () => ResultCountOperator,
|
|
218
266
|
ResultTagOperator: () => ResultTagOperator,
|
|
219
267
|
ReviewsSize: () => ReviewsSize,
|
|
@@ -232,6 +280,8 @@ __export(src_exports, {
|
|
|
232
280
|
SessionCloseRequestSchema: () => SessionCloseRequestSchema,
|
|
233
281
|
SessionCloseResponseSchema: () => SessionCloseResponseSchema,
|
|
234
282
|
SessionClosureSchema: () => SessionClosureSchema,
|
|
283
|
+
SessionFinishRequestSchema: () => SessionFinishRequestSchema,
|
|
284
|
+
SessionFinishResponseSchema: () => SessionFinishResponseSchema,
|
|
235
285
|
SessionIdentitySchema: () => SessionIdentitySchema,
|
|
236
286
|
SessionOrderTimingSchema: () => SessionOrderTimingSchema,
|
|
237
287
|
SessionPolicySchema: () => SessionPolicySchema,
|
|
@@ -337,6 +387,8 @@ __export(src_exports, {
|
|
|
337
387
|
offersDirections: () => offersDirections,
|
|
338
388
|
popoverPositionMap: () => popoverPositionMap,
|
|
339
389
|
popoverPositions: () => popoverPositions,
|
|
390
|
+
postPurchaseChangeset: () => postPurchaseChangeset,
|
|
391
|
+
postPurchaseCosts: () => postPurchaseCosts,
|
|
340
392
|
postPurchaseSubscriptionDisplay: () => postPurchaseSubscriptionDisplay,
|
|
341
393
|
productImageObject: () => productImageObject,
|
|
342
394
|
productTypes: () => productTypes,
|
|
@@ -1632,60 +1684,87 @@ var OfferProduct = import_zod5.z.object({
|
|
|
1632
1684
|
variants: import_zod5.z.array(OfferProductVariant).min(1)
|
|
1633
1685
|
});
|
|
1634
1686
|
|
|
1635
|
-
// src/schema/
|
|
1636
|
-
var
|
|
1687
|
+
// src/schema/postPurchaseAcceptedEvent.ts
|
|
1688
|
+
var import_zod25 = require("zod");
|
|
1637
1689
|
|
|
1638
|
-
// src/schema/
|
|
1639
|
-
var
|
|
1690
|
+
// src/schema/postPurchaseAdmission.ts
|
|
1691
|
+
var import_zod24 = require("zod");
|
|
1640
1692
|
|
|
1641
|
-
// src/schema/
|
|
1693
|
+
// src/schema/postPurchaseIdentity.ts
|
|
1694
|
+
var import_zod6 = require("zod");
|
|
1695
|
+
var POST_PURCHASE_ID_MAX = 128;
|
|
1696
|
+
var PostPurchaseTimestampSchema = import_zod6.z.number().int().nonnegative();
|
|
1697
|
+
var PostPurchaseOrderIdSchema = import_zod6.z.string().regex(/^gid:\/\/shopify\/Order\/[1-9]\d*$/);
|
|
1698
|
+
var ShopifyDomainSchema = import_zod6.z.string().max(POST_PURCHASE_ID_MAX).regex(/^[a-z0-9]([a-z0-9-]*[a-z0-9])?\.myshopify\.com$/);
|
|
1699
|
+
var DecideRequestSchema = import_zod6.z.object({
|
|
1700
|
+
checkoutToken: import_zod6.z.string().min(1).max(POST_PURCHASE_ID_MAX),
|
|
1701
|
+
shop: ShopifyDomainSchema
|
|
1702
|
+
});
|
|
1703
|
+
var PostPurchaseAppIdSchema = import_zod6.z.string().min(1).max(POST_PURCHASE_ID_MAX);
|
|
1704
|
+
var DecisionEntrySchema = import_zod6.z.object({
|
|
1705
|
+
blockId: import_zod6.z.number().int().positive(),
|
|
1706
|
+
blockIndex: import_zod6.z.string(),
|
|
1707
|
+
blockParentIndex: import_zod6.z.string(),
|
|
1708
|
+
flowId: import_zod6.z.number().int().positive(),
|
|
1709
|
+
sectionId: import_zod6.z.number().int().positive(),
|
|
1710
|
+
widgetId: import_zod6.z.number().int().positive(),
|
|
1711
|
+
widgetTraffic: import_zod6.z.number().min(0).max(100)
|
|
1712
|
+
});
|
|
1713
|
+
|
|
1714
|
+
// src/schema/postPurchaseMemberIdentity.ts
|
|
1642
1715
|
var import_zod7 = require("zod");
|
|
1716
|
+
var PostPurchaseMemberIdentity = import_zod7.z.object({
|
|
1717
|
+
productId: import_zod7.z.number().int().positive(),
|
|
1718
|
+
productIndex: import_zod7.z.number().int().nonnegative()
|
|
1719
|
+
}).strict();
|
|
1720
|
+
|
|
1721
|
+
// src/schema/postPurchaseProduct.ts
|
|
1722
|
+
var import_zod22 = require("zod");
|
|
1643
1723
|
|
|
1644
1724
|
// src/schema/postPurchaseDiscount.ts
|
|
1645
|
-
var
|
|
1646
|
-
var Discount =
|
|
1647
|
-
amount:
|
|
1648
|
-
title:
|
|
1649
|
-
type:
|
|
1725
|
+
var import_zod8 = require("zod");
|
|
1726
|
+
var Discount = import_zod8.z.object({
|
|
1727
|
+
amount: import_zod8.z.number().nonnegative(),
|
|
1728
|
+
title: import_zod8.z.string(),
|
|
1729
|
+
type: import_zod8.z.enum(["none", "fixed_amount", "percentage"])
|
|
1650
1730
|
});
|
|
1651
1731
|
var validPostPurchaseDiscount = (discount) => discount.type !== "percentage" || discount.amount <= 100;
|
|
1652
1732
|
var PostPurchaseDiscount = Discount.refine(validPostPurchaseDiscount);
|
|
1653
1733
|
|
|
1654
|
-
// src/schema/
|
|
1655
|
-
var
|
|
1656
|
-
amount: PostPurchaseDiscount.shape.amount,
|
|
1657
|
-
type: import_zod7.z.enum(["percentage", "fixed_amount", "price"])
|
|
1658
|
-
}).refine(({ amount: amount2, type }) => type === "price" || validPostPurchaseDiscount({ amount: amount2, type }));
|
|
1734
|
+
// src/schema/postPurchaseProductDisplay.ts
|
|
1735
|
+
var import_zod18 = require("zod");
|
|
1659
1736
|
|
|
1660
|
-
// src/schema/
|
|
1661
|
-
var
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
variantId: import_zod8.z.number().int().positive()
|
|
1737
|
+
// src/schema/postPurchaseProductGallery.ts
|
|
1738
|
+
var import_zod9 = require("zod");
|
|
1739
|
+
var PostPurchaseProductGallery = import_zod9.z.object({
|
|
1740
|
+
images: import_zod9.z.array(
|
|
1741
|
+
import_zod9.z.object({
|
|
1742
|
+
description: import_zod9.z.string(),
|
|
1743
|
+
id: import_zod9.z.number().int().positive(),
|
|
1744
|
+
source: import_zod9.z.string(),
|
|
1745
|
+
thumbnail: import_zod9.z.string()
|
|
1746
|
+
})
|
|
1747
|
+
),
|
|
1748
|
+
selectedImageId: import_zod9.z.number().int().positive().optional()
|
|
1673
1749
|
});
|
|
1674
1750
|
|
|
1751
|
+
// src/schema/postPurchaseProductReviews.ts
|
|
1752
|
+
var import_zod17 = require("zod");
|
|
1753
|
+
|
|
1675
1754
|
// src/schema/widgets/post-purchase-offer/postPurchaseSettings.ts
|
|
1676
|
-
var
|
|
1755
|
+
var import_zod16 = require("zod");
|
|
1677
1756
|
|
|
1678
1757
|
// src/schema/widgets/post-purchase-offer/common.ts
|
|
1679
1758
|
var import_compat = require("es-toolkit/compat");
|
|
1680
|
-
var
|
|
1681
|
-
var strictNumber =
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1759
|
+
var import_zod10 = require("zod");
|
|
1760
|
+
var strictNumber = import_zod10.z.union([
|
|
1761
|
+
import_zod10.z.number(),
|
|
1762
|
+
import_zod10.z.string().transform((value) => (0, import_compat.toNumber)((0, import_compat.replace)((0, import_compat.toString)(value), /[^0-9.]/g, "")) || 0),
|
|
1763
|
+
import_zod10.z.unknown().transform(() => 0)
|
|
1685
1764
|
]);
|
|
1686
1765
|
|
|
1687
1766
|
// src/schema/widgets/post-purchase-offer/constants.ts
|
|
1688
|
-
var
|
|
1767
|
+
var import_zod11 = require("zod");
|
|
1689
1768
|
var blockTypes = [
|
|
1690
1769
|
"callout_banner",
|
|
1691
1770
|
"image",
|
|
@@ -1696,18 +1775,18 @@ var blockTypes = [
|
|
|
1696
1775
|
"text",
|
|
1697
1776
|
"timer"
|
|
1698
1777
|
];
|
|
1699
|
-
var blockType =
|
|
1778
|
+
var blockType = import_zod11.z.enum(blockTypes);
|
|
1700
1779
|
var BlockType = blockType.enum;
|
|
1701
1780
|
|
|
1702
1781
|
// src/schema/widgets/post-purchase-offer/postPurchaseBlocks.ts
|
|
1703
1782
|
var import_compat4 = require("es-toolkit/compat");
|
|
1704
1783
|
var import_uuid3 = require("uuid");
|
|
1705
|
-
var
|
|
1784
|
+
var import_zod15 = require("zod");
|
|
1706
1785
|
|
|
1707
1786
|
// src/schema/widgets/checkout-and-beyond/text.ts
|
|
1708
1787
|
var import_compat3 = require("es-toolkit/compat");
|
|
1709
1788
|
var import_uuid2 = require("uuid");
|
|
1710
|
-
var
|
|
1789
|
+
var import_zod14 = require("zod");
|
|
1711
1790
|
|
|
1712
1791
|
// src/schema/widgets/checkout-and-beyond/common.ts
|
|
1713
1792
|
var freezeEnum = (values2) => Object.freeze(Object.fromEntries(values2.map((v) => [v, v])));
|
|
@@ -1991,10 +2070,10 @@ var isTextType = isSectionType(SectionType.text);
|
|
|
1991
2070
|
var isVariantsType = isSectionType(SectionType.variants);
|
|
1992
2071
|
|
|
1993
2072
|
// src/schema/widgets/checkout-and-beyond/variables.ts
|
|
1994
|
-
var
|
|
2073
|
+
var import_zod13 = require("zod");
|
|
1995
2074
|
|
|
1996
2075
|
// src/schema/widgets/checkout-and-beyond/rule.ts
|
|
1997
|
-
var
|
|
2076
|
+
var import_zod12 = require("zod");
|
|
1998
2077
|
var ruleTypes = [
|
|
1999
2078
|
"cart",
|
|
2000
2079
|
"cart_count",
|
|
@@ -2013,7 +2092,7 @@ var ruleTypes = [
|
|
|
2013
2092
|
"product_type",
|
|
2014
2093
|
"product_vendor"
|
|
2015
2094
|
];
|
|
2016
|
-
var ruleType =
|
|
2095
|
+
var ruleType = import_zod12.z.enum(ruleTypes);
|
|
2017
2096
|
var RuleType = ruleType.enum;
|
|
2018
2097
|
var ruleOperators = [
|
|
2019
2098
|
"after",
|
|
@@ -2028,177 +2107,177 @@ var ruleOperators = [
|
|
|
2028
2107
|
"greater_than",
|
|
2029
2108
|
"less_than"
|
|
2030
2109
|
];
|
|
2031
|
-
var ruleOperator =
|
|
2110
|
+
var ruleOperator = import_zod12.z.enum(ruleOperators);
|
|
2032
2111
|
var RuleOperator = ruleOperator.enum;
|
|
2033
|
-
var RuleCondition =
|
|
2034
|
-
operator:
|
|
2035
|
-
products:
|
|
2036
|
-
type:
|
|
2037
|
-
value:
|
|
2038
|
-
});
|
|
2039
|
-
var RuleLogicBlock =
|
|
2040
|
-
rules:
|
|
2041
|
-
});
|
|
2042
|
-
var CABRulesetEntry =
|
|
2043
|
-
exitIfMatched:
|
|
2044
|
-
logic:
|
|
2045
|
-
output:
|
|
2046
|
-
|
|
2047
|
-
key:
|
|
2048
|
-
type:
|
|
2049
|
-
value:
|
|
2112
|
+
var RuleCondition = import_zod12.z.object({
|
|
2113
|
+
operator: import_zod12.z.enum(ruleOperators).default(RuleOperator.anything),
|
|
2114
|
+
products: import_zod12.z.union([import_zod12.z.array(import_zod12.z.unknown()), import_zod12.z.strictObject({}).transform(() => [])]).default(() => []),
|
|
2115
|
+
type: import_zod12.z.enum(ruleTypes).default(RuleType.cart_subtotal),
|
|
2116
|
+
value: import_zod12.z.coerce.string().default("")
|
|
2117
|
+
});
|
|
2118
|
+
var RuleLogicBlock = import_zod12.z.object({
|
|
2119
|
+
rules: import_zod12.z.array(RuleCondition).default(() => [])
|
|
2120
|
+
});
|
|
2121
|
+
var CABRulesetEntry = import_zod12.z.object({
|
|
2122
|
+
exitIfMatched: import_zod12.z.boolean().default(true),
|
|
2123
|
+
logic: import_zod12.z.array(RuleLogicBlock).default(() => []),
|
|
2124
|
+
output: import_zod12.z.array(
|
|
2125
|
+
import_zod12.z.object({
|
|
2126
|
+
key: import_zod12.z.string().default("should_show"),
|
|
2127
|
+
type: import_zod12.z.literal("data_json").default("data_json"),
|
|
2128
|
+
value: import_zod12.z.string().default("true")
|
|
2050
2129
|
})
|
|
2051
2130
|
).default(() => [{ key: "should_show", type: "data_json", value: "true" }])
|
|
2052
2131
|
});
|
|
2053
|
-
var CABRuleset =
|
|
2132
|
+
var CABRuleset = import_zod12.z.union([import_zod12.z.array(CABRulesetEntry), import_zod12.z.strictObject({}).transform(() => [])]).default(() => []);
|
|
2054
2133
|
|
|
2055
2134
|
// src/schema/widgets/checkout-and-beyond/variables.ts
|
|
2056
|
-
var variableEffect =
|
|
2057
|
-
var CABVariableSeed =
|
|
2058
|
-
dataSourceId:
|
|
2135
|
+
var variableEffect = import_zod13.z.enum(variableEffects);
|
|
2136
|
+
var CABVariableSeed = import_zod13.z.object({
|
|
2137
|
+
dataSourceId: import_zod13.z.number().nullable().default(null),
|
|
2059
2138
|
ruleset: CABRuleset
|
|
2060
2139
|
});
|
|
2061
|
-
var CABBooleanVariable =
|
|
2140
|
+
var CABBooleanVariable = import_zod13.z.object({
|
|
2062
2141
|
/**
|
|
2063
2142
|
* Holds until the first seed verdict lands (and forever, for unseeded variables). Omitted, it derives
|
|
2064
2143
|
* from seededness — `false` with a `seed` (visibility is EARNED), `true` without — via the transform
|
|
2065
2144
|
* below; a cross-field default has no `.default()` spelling. An explicit value always wins.
|
|
2066
2145
|
*/
|
|
2067
|
-
defaultValue:
|
|
2068
|
-
name:
|
|
2146
|
+
defaultValue: import_zod13.z.boolean().optional(),
|
|
2147
|
+
name: import_zod13.z.string().min(1),
|
|
2069
2148
|
seed: CABVariableSeed.optional(),
|
|
2070
2149
|
/** Defaulted so every stored declaration (all boolean before `text` existed) parses unchanged. */
|
|
2071
|
-
type:
|
|
2150
|
+
type: import_zod13.z.literal(VariableType.boolean).default(VariableType.boolean)
|
|
2072
2151
|
});
|
|
2073
|
-
var CABTextVariable =
|
|
2074
|
-
defaultValue:
|
|
2075
|
-
name:
|
|
2076
|
-
seed:
|
|
2077
|
-
type:
|
|
2152
|
+
var CABTextVariable = import_zod13.z.object({
|
|
2153
|
+
defaultValue: import_zod13.z.string(),
|
|
2154
|
+
name: import_zod13.z.string().min(1),
|
|
2155
|
+
seed: import_zod13.z.never().optional(),
|
|
2156
|
+
type: import_zod13.z.literal(VariableType.text)
|
|
2078
2157
|
});
|
|
2079
|
-
var CABNumberVariable =
|
|
2080
|
-
defaultValue:
|
|
2081
|
-
name:
|
|
2082
|
-
seed:
|
|
2083
|
-
type:
|
|
2158
|
+
var CABNumberVariable = import_zod13.z.object({
|
|
2159
|
+
defaultValue: import_zod13.z.number(),
|
|
2160
|
+
name: import_zod13.z.string().min(1),
|
|
2161
|
+
seed: import_zod13.z.never().optional(),
|
|
2162
|
+
type: import_zod13.z.literal(VariableType.number)
|
|
2084
2163
|
});
|
|
2085
|
-
var CABVariable =
|
|
2164
|
+
var CABVariable = import_zod13.z.union([CABTextVariable, CABNumberVariable, CABBooleanVariable]).transform(
|
|
2086
2165
|
(variable) => variable.type === VariableType.boolean ? { ...variable, defaultValue: variable.defaultValue ?? variable.seed === void 0 } : variable
|
|
2087
2166
|
);
|
|
2088
|
-
var CABVariableEffect =
|
|
2167
|
+
var CABVariableEffect = import_zod13.z.object({
|
|
2089
2168
|
effect: variableEffect.default(VariableEffect.toggle),
|
|
2090
|
-
variable:
|
|
2169
|
+
variable: import_zod13.z.string().min(1)
|
|
2091
2170
|
});
|
|
2092
|
-
var CABVisibility =
|
|
2093
|
-
variable:
|
|
2094
|
-
visibleWhen:
|
|
2171
|
+
var CABVisibility = import_zod13.z.object({
|
|
2172
|
+
variable: import_zod13.z.string().min(1),
|
|
2173
|
+
visibleWhen: import_zod13.z.boolean().default(true)
|
|
2095
2174
|
});
|
|
2096
|
-
var contentOperator =
|
|
2097
|
-
var resultCountOperator =
|
|
2098
|
-
var resultTagOperator =
|
|
2099
|
-
var mutatorEvent =
|
|
2100
|
-
var CABContentTrigger =
|
|
2175
|
+
var contentOperator = import_zod13.z.enum(contentOperators);
|
|
2176
|
+
var resultCountOperator = import_zod13.z.enum(resultCountOperators);
|
|
2177
|
+
var resultTagOperator = import_zod13.z.enum(resultTagOperators);
|
|
2178
|
+
var mutatorEvent = import_zod13.z.enum(mutatorEvents);
|
|
2179
|
+
var CABContentTrigger = import_zod13.z.object({
|
|
2101
2180
|
operator: contentOperator.default(ContentOperator.is_empty),
|
|
2102
|
-
type:
|
|
2181
|
+
type: import_zod13.z.literal("content")
|
|
2103
2182
|
});
|
|
2104
|
-
var CABResultCountTrigger =
|
|
2183
|
+
var CABResultCountTrigger = import_zod13.z.object({
|
|
2105
2184
|
operator: resultCountOperator.default(ResultCountOperator.equals),
|
|
2106
|
-
type:
|
|
2107
|
-
value:
|
|
2185
|
+
type: import_zod13.z.literal("result_count"),
|
|
2186
|
+
value: import_zod13.z.number().default(0)
|
|
2108
2187
|
});
|
|
2109
|
-
var CABResultTagTrigger =
|
|
2188
|
+
var CABResultTagTrigger = import_zod13.z.object({
|
|
2110
2189
|
operator: resultTagOperator.default(ResultTagOperator.contains),
|
|
2111
|
-
type:
|
|
2112
|
-
value:
|
|
2190
|
+
type: import_zod13.z.literal("result_tag"),
|
|
2191
|
+
value: import_zod13.z.string().min(1)
|
|
2113
2192
|
});
|
|
2114
|
-
var CABEventTrigger =
|
|
2193
|
+
var CABEventTrigger = import_zod13.z.object({
|
|
2115
2194
|
event: mutatorEvent,
|
|
2116
|
-
type:
|
|
2195
|
+
type: import_zod13.z.literal("event")
|
|
2117
2196
|
});
|
|
2118
|
-
var CABVariableTrigger =
|
|
2197
|
+
var CABVariableTrigger = import_zod13.z.discriminatedUnion("type", [
|
|
2119
2198
|
CABContentTrigger,
|
|
2120
2199
|
CABEventTrigger,
|
|
2121
2200
|
CABResultCountTrigger,
|
|
2122
2201
|
CABResultTagTrigger
|
|
2123
2202
|
]);
|
|
2124
|
-
var CABVariableMutator =
|
|
2203
|
+
var CABVariableMutator = import_zod13.z.object({
|
|
2125
2204
|
effect: variableEffect.default(VariableEffect.set_false),
|
|
2126
|
-
variable:
|
|
2205
|
+
variable: import_zod13.z.string().min(1),
|
|
2127
2206
|
when: CABVariableTrigger
|
|
2128
2207
|
});
|
|
2129
2208
|
var CABVariableFields = {
|
|
2130
|
-
mutators:
|
|
2131
|
-
variables:
|
|
2209
|
+
mutators: import_zod13.z.array(CABVariableMutator).optional(),
|
|
2210
|
+
variables: import_zod13.z.array(CABVariable).refine((variables) => new Set(variables.map(({ name }) => name)).size === variables.length, {
|
|
2132
2211
|
message: "variable names must be unique within a section"
|
|
2133
2212
|
}).optional(),
|
|
2134
2213
|
visibility: CABVisibility.optional()
|
|
2135
2214
|
};
|
|
2136
2215
|
|
|
2137
2216
|
// src/schema/widgets/checkout-and-beyond/text.ts
|
|
2138
|
-
var enumOrOmit = (...vals) =>
|
|
2139
|
-
var TiptapText =
|
|
2140
|
-
marks:
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
attrs:
|
|
2147
|
-
class:
|
|
2148
|
-
href:
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2217
|
+
var enumOrOmit = (...vals) => import_zod14.z.string().transform((val) => vals.includes(val) ? val : void 0).optional();
|
|
2218
|
+
var TiptapText = import_zod14.z.object({
|
|
2219
|
+
marks: import_zod14.z.union([
|
|
2220
|
+
import_zod14.z.array(
|
|
2221
|
+
import_zod14.z.discriminatedUnion("type", [
|
|
2222
|
+
import_zod14.z.object({ type: import_zod14.z.literal("bold") }),
|
|
2223
|
+
import_zod14.z.object({ type: import_zod14.z.literal("italic") }),
|
|
2224
|
+
import_zod14.z.object({
|
|
2225
|
+
attrs: import_zod14.z.object({
|
|
2226
|
+
class: import_zod14.z.string().nullable(),
|
|
2227
|
+
href: import_zod14.z.union([
|
|
2228
|
+
import_zod14.z.url(),
|
|
2229
|
+
import_zod14.z.literal("#"),
|
|
2230
|
+
import_zod14.z.string().regex(DYNAMIC_TOKEN_REGEX),
|
|
2231
|
+
import_zod14.z.string().regex(ROOT_RELATIVE_PATH_REGEX)
|
|
2153
2232
|
]),
|
|
2154
|
-
rel:
|
|
2155
|
-
target:
|
|
2233
|
+
rel: import_zod14.z.string().default("noopener noreferrer nofollow"),
|
|
2234
|
+
target: import_zod14.z.string().default("_blank")
|
|
2156
2235
|
}),
|
|
2157
|
-
type:
|
|
2236
|
+
type: import_zod14.z.literal("link")
|
|
2158
2237
|
}),
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
attrs:
|
|
2238
|
+
import_zod14.z.object({ type: import_zod14.z.literal("strike") }),
|
|
2239
|
+
import_zod14.z.object({
|
|
2240
|
+
attrs: import_zod14.z.object({
|
|
2162
2241
|
color: enumOrOmit(...textColorNames).default(TextColorName.base),
|
|
2163
2242
|
fontSize: enumOrOmit(...textSizeNames).default(TextSizeName.base)
|
|
2164
2243
|
}),
|
|
2165
|
-
type:
|
|
2244
|
+
type: import_zod14.z.literal("textStyle")
|
|
2166
2245
|
})
|
|
2167
2246
|
])
|
|
2168
2247
|
),
|
|
2169
|
-
|
|
2248
|
+
import_zod14.z.strictObject({}).transform(() => [])
|
|
2170
2249
|
]).optional(),
|
|
2171
|
-
text:
|
|
2172
|
-
type:
|
|
2250
|
+
text: import_zod14.z.string().default(""),
|
|
2251
|
+
type: import_zod14.z.literal("text").default("text")
|
|
2173
2252
|
});
|
|
2174
|
-
var TiptapParagraph =
|
|
2175
|
-
attrs:
|
|
2253
|
+
var TiptapParagraph = import_zod14.z.object({
|
|
2254
|
+
attrs: import_zod14.z.object({
|
|
2176
2255
|
textAlign: enumOrOmit(...textAlignments)
|
|
2177
2256
|
}).default({ textAlign: TextAlignment.start }),
|
|
2178
|
-
content:
|
|
2179
|
-
type:
|
|
2257
|
+
content: import_zod14.z.union([import_zod14.z.array(TiptapText), import_zod14.z.strictObject({}).transform(() => [])]).default(() => []),
|
|
2258
|
+
type: import_zod14.z.literal("paragraph").default("paragraph")
|
|
2180
2259
|
});
|
|
2181
|
-
var TiptapDocument =
|
|
2182
|
-
attrs:
|
|
2260
|
+
var TiptapDocument = import_zod14.z.object({
|
|
2261
|
+
attrs: import_zod14.z.object({
|
|
2183
2262
|
blockSpacing: enumOrOmit(...spacings)
|
|
2184
2263
|
}).default({ blockSpacing: Spacing.base }),
|
|
2185
|
-
content:
|
|
2186
|
-
type:
|
|
2264
|
+
content: import_zod14.z.union([import_zod14.z.array(TiptapParagraph), import_zod14.z.strictObject({}).transform(() => [])]).default(() => [TiptapParagraph.parse({})]),
|
|
2265
|
+
type: import_zod14.z.literal("doc").default("doc")
|
|
2187
2266
|
});
|
|
2188
|
-
var CABTextTier =
|
|
2189
|
-
threshold:
|
|
2190
|
-
thresholds:
|
|
2191
|
-
tierId:
|
|
2192
|
-
tierType:
|
|
2267
|
+
var CABTextTier = import_zod14.z.object({
|
|
2268
|
+
threshold: import_zod14.z.number().int().nonnegative(),
|
|
2269
|
+
thresholds: import_zod14.z.record(import_zod14.z.string(), import_zod14.z.number().int().nonnegative()).default(() => ({})),
|
|
2270
|
+
tierId: import_zod14.z.string().optional(),
|
|
2271
|
+
tierType: import_zod14.z.enum(progressTierTypes).default(ProgressTierType.shipping)
|
|
2193
2272
|
});
|
|
2194
|
-
var CABTextSection =
|
|
2273
|
+
var CABTextSection = import_zod14.z.object({
|
|
2195
2274
|
...CABVariableFields,
|
|
2196
|
-
buttonField:
|
|
2197
|
-
content:
|
|
2198
|
-
name:
|
|
2199
|
-
optionId:
|
|
2200
|
-
sectionId:
|
|
2201
|
-
sectionType:
|
|
2275
|
+
buttonField: import_zod14.z.enum(buttonFields).optional(),
|
|
2276
|
+
content: import_zod14.z.record(import_zod14.z.string(), import_zod14.z.union([import_zod14.z.string(), TiptapDocument]).refine(checkForHTML, NO_HTML).optional()).default({ en: TiptapDocument.parse({}) }).optional(),
|
|
2277
|
+
name: import_zod14.z.string().optional(),
|
|
2278
|
+
optionId: import_zod14.z.number().optional(),
|
|
2279
|
+
sectionId: import_zod14.z.uuid().default(() => (0, import_uuid2.v7)()),
|
|
2280
|
+
sectionType: import_zod14.z.literal(SectionType.text).default(SectionType.text),
|
|
2202
2281
|
tier: CABTextTier.optional()
|
|
2203
2282
|
}).superRefine(({ buttonField, content }, ctx) => {
|
|
2204
2283
|
if (buttonField === ButtonField.destinationUrl && content) {
|
|
@@ -2220,137 +2299,137 @@ var CABTextSection = import_zod13.z.object({
|
|
|
2220
2299
|
});
|
|
2221
2300
|
|
|
2222
2301
|
// src/schema/widgets/post-purchase-offer/postPurchaseBlocks.ts
|
|
2223
|
-
var TextAlignment2 =
|
|
2224
|
-
var TextSize =
|
|
2225
|
-
|
|
2226
|
-
|
|
2302
|
+
var TextAlignment2 = import_zod15.z.union([import_zod15.z.enum(["leading", "center", "trailing"]), import_zod15.z.unknown().transform(() => "leading")]);
|
|
2303
|
+
var TextSize = import_zod15.z.union([
|
|
2304
|
+
import_zod15.z.enum(["xsmall", "small", "base", "default", "medium", "large", "xlarge"]),
|
|
2305
|
+
import_zod15.z.unknown().transform(() => "medium")
|
|
2227
2306
|
]);
|
|
2228
|
-
var CalloutBannerBlock =
|
|
2229
|
-
id:
|
|
2230
|
-
name:
|
|
2231
|
-
settings:
|
|
2232
|
-
superTitle:
|
|
2233
|
-
title:
|
|
2307
|
+
var CalloutBannerBlock = import_zod15.z.object({
|
|
2308
|
+
id: import_zod15.z.string().optional().default(() => (0, import_uuid3.v4)()),
|
|
2309
|
+
name: import_zod15.z.string().optional(),
|
|
2310
|
+
settings: import_zod15.z.object({
|
|
2311
|
+
superTitle: import_zod15.z.union([import_zod15.z.string(), TiptapDocument]).default(() => "Limited-time Offer"),
|
|
2312
|
+
title: import_zod15.z.union([import_zod15.z.string(), TiptapDocument]).default(() => "Add this customer favorite to your order")
|
|
2234
2313
|
}),
|
|
2235
|
-
styles:
|
|
2236
|
-
superTitleEmphasized:
|
|
2314
|
+
styles: import_zod15.z.object({
|
|
2315
|
+
superTitleEmphasized: import_zod15.z.boolean().default(false),
|
|
2237
2316
|
superTitleSize: TextSize.default("large"),
|
|
2238
2317
|
textAlignment: TextAlignment2.default("center"),
|
|
2239
|
-
titleEmphasized:
|
|
2318
|
+
titleEmphasized: import_zod15.z.boolean().default(true),
|
|
2240
2319
|
titleSize: TextSize.default("large")
|
|
2241
2320
|
}),
|
|
2242
|
-
type:
|
|
2321
|
+
type: import_zod15.z.literal(BlockType.callout_banner).default(BlockType.callout_banner)
|
|
2243
2322
|
});
|
|
2244
|
-
var ImageBlock =
|
|
2245
|
-
id:
|
|
2246
|
-
name:
|
|
2247
|
-
settings:
|
|
2248
|
-
|
|
2323
|
+
var ImageBlock = import_zod15.z.object({
|
|
2324
|
+
id: import_zod15.z.string().optional().default(() => (0, import_uuid3.v4)()),
|
|
2325
|
+
name: import_zod15.z.string().optional(),
|
|
2326
|
+
settings: import_zod15.z.union([
|
|
2327
|
+
import_zod15.z.object({
|
|
2249
2328
|
/** This isn't used in the post-purchase offer widget */
|
|
2250
|
-
alt:
|
|
2251
|
-
image:
|
|
2252
|
-
imageSize:
|
|
2253
|
-
imageType:
|
|
2329
|
+
alt: import_zod15.z.string().optional().default(""),
|
|
2330
|
+
image: import_zod15.z.union([import_zod15.z.literal(""), import_zod15.z.url()]).default(""),
|
|
2331
|
+
imageSize: import_zod15.z.number().default(20),
|
|
2332
|
+
imageType: import_zod15.z.enum(["URL", "UPLOAD"]).default("URL")
|
|
2254
2333
|
}),
|
|
2255
|
-
|
|
2334
|
+
import_zod15.z.array(import_zod15.z.never()).transform(() => ({}))
|
|
2256
2335
|
]),
|
|
2257
|
-
type:
|
|
2258
|
-
});
|
|
2259
|
-
var ImageContentBlock =
|
|
2260
|
-
id:
|
|
2261
|
-
name:
|
|
2262
|
-
settings:
|
|
2263
|
-
alt:
|
|
2264
|
-
description:
|
|
2336
|
+
type: import_zod15.z.literal(BlockType.image).default(BlockType.image)
|
|
2337
|
+
});
|
|
2338
|
+
var ImageContentBlock = import_zod15.z.object({
|
|
2339
|
+
id: import_zod15.z.string().optional().default(() => (0, import_uuid3.v4)()),
|
|
2340
|
+
name: import_zod15.z.string().optional(),
|
|
2341
|
+
settings: import_zod15.z.object({
|
|
2342
|
+
alt: import_zod15.z.string().optional().default(""),
|
|
2343
|
+
description: import_zod15.z.union([import_zod15.z.string(), TiptapDocument, import_zod15.z.null()]).default(
|
|
2265
2344
|
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."
|
|
2266
2345
|
),
|
|
2267
2346
|
descriptionSize: TextSize.default("medium"),
|
|
2268
2347
|
horizontalAlignment: TextAlignment2.default("leading"),
|
|
2269
|
-
image:
|
|
2270
|
-
imagePlacement:
|
|
2271
|
-
imageSize:
|
|
2272
|
-
superTitle:
|
|
2348
|
+
image: import_zod15.z.union([import_zod15.z.literal(""), import_zod15.z.url()]).default(""),
|
|
2349
|
+
imagePlacement: import_zod15.z.enum(["bottom", "left", "right", "top"]).optional().default("left"),
|
|
2350
|
+
imageSize: import_zod15.z.number().default(20),
|
|
2351
|
+
superTitle: import_zod15.z.union([import_zod15.z.string(), TiptapDocument]).default("Lorem Ipsum!"),
|
|
2273
2352
|
superTitleSize: TextSize.default("medium"),
|
|
2274
2353
|
/** This isn't configurable in the admin-nextjs editor */
|
|
2275
|
-
swapContent:
|
|
2276
|
-
title:
|
|
2354
|
+
swapContent: import_zod15.z.boolean().optional().default(false),
|
|
2355
|
+
title: import_zod15.z.union([import_zod15.z.string(), TiptapDocument]).nullable().default("Lorem ipsum dolor sit amet"),
|
|
2277
2356
|
titleSize: TextSize.default("medium")
|
|
2278
2357
|
}),
|
|
2279
|
-
type:
|
|
2280
|
-
});
|
|
2281
|
-
var PayButtonBlock =
|
|
2282
|
-
id:
|
|
2283
|
-
name:
|
|
2284
|
-
settings:
|
|
2285
|
-
|
|
2286
|
-
label:
|
|
2358
|
+
type: import_zod15.z.literal(BlockType.image_content).default(BlockType.image_content)
|
|
2359
|
+
});
|
|
2360
|
+
var PayButtonBlock = import_zod15.z.object({
|
|
2361
|
+
id: import_zod15.z.string().optional().default(() => (0, import_uuid3.v4)()),
|
|
2362
|
+
name: import_zod15.z.string().optional(),
|
|
2363
|
+
settings: import_zod15.z.union([
|
|
2364
|
+
import_zod15.z.object({
|
|
2365
|
+
label: import_zod15.z.string().default("Pay Now")
|
|
2287
2366
|
}),
|
|
2288
|
-
|
|
2367
|
+
import_zod15.z.array(import_zod15.z.never()).transform(() => ({
|
|
2289
2368
|
label: "Pay Now"
|
|
2290
2369
|
}))
|
|
2291
2370
|
]),
|
|
2292
|
-
styles:
|
|
2293
|
-
|
|
2294
|
-
buttonWidth:
|
|
2371
|
+
styles: import_zod15.z.union([
|
|
2372
|
+
import_zod15.z.object({
|
|
2373
|
+
buttonWidth: import_zod15.z.number().min(10).max(100).default(50)
|
|
2295
2374
|
}),
|
|
2296
|
-
|
|
2375
|
+
import_zod15.z.array(import_zod15.z.never()).transform(() => ({
|
|
2297
2376
|
buttonWidth: 50
|
|
2298
2377
|
}))
|
|
2299
2378
|
]),
|
|
2300
|
-
type:
|
|
2379
|
+
type: import_zod15.z.literal(BlockType.pay_button).default(BlockType.pay_button)
|
|
2301
2380
|
});
|
|
2302
|
-
var ProductInformationBlock =
|
|
2381
|
+
var ProductInformationBlock = import_zod15.z.object({
|
|
2303
2382
|
/** This isn't configurable in the admin-nextjs editor */
|
|
2304
|
-
hideProductImage:
|
|
2305
|
-
id:
|
|
2306
|
-
name:
|
|
2307
|
-
type:
|
|
2308
|
-
});
|
|
2309
|
-
var SeparatorBlock =
|
|
2310
|
-
id:
|
|
2311
|
-
name:
|
|
2312
|
-
type:
|
|
2313
|
-
});
|
|
2314
|
-
var TextBlock =
|
|
2315
|
-
id:
|
|
2316
|
-
name:
|
|
2317
|
-
settings:
|
|
2318
|
-
description:
|
|
2383
|
+
hideProductImage: import_zod15.z.boolean().optional().default(false),
|
|
2384
|
+
id: import_zod15.z.string().optional().default(() => (0, import_uuid3.v4)()),
|
|
2385
|
+
name: import_zod15.z.string().optional(),
|
|
2386
|
+
type: import_zod15.z.literal(BlockType.product_information).default(BlockType.product_information)
|
|
2387
|
+
});
|
|
2388
|
+
var SeparatorBlock = import_zod15.z.object({
|
|
2389
|
+
id: import_zod15.z.string().optional().default(() => (0, import_uuid3.v4)()),
|
|
2390
|
+
name: import_zod15.z.string().optional(),
|
|
2391
|
+
type: import_zod15.z.literal(BlockType.separator).default(BlockType.separator)
|
|
2392
|
+
});
|
|
2393
|
+
var TextBlock = import_zod15.z.object({
|
|
2394
|
+
id: import_zod15.z.string().optional().default(() => (0, import_uuid3.v4)()),
|
|
2395
|
+
name: import_zod15.z.string().optional(),
|
|
2396
|
+
settings: import_zod15.z.object({
|
|
2397
|
+
description: import_zod15.z.union([import_zod15.z.string(), TiptapDocument]).optional().default(
|
|
2319
2398
|
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."
|
|
2320
2399
|
),
|
|
2321
2400
|
/** This isn't used in the post-purchase offer widget */
|
|
2322
2401
|
descriptionSize: TextSize.default("medium"),
|
|
2323
2402
|
horizontalAlignment: TextAlignment2.default("leading"),
|
|
2324
|
-
superTitle:
|
|
2403
|
+
superTitle: import_zod15.z.union([import_zod15.z.string(), TiptapDocument]).default("Super Title"),
|
|
2325
2404
|
/** This isn't used in the post-purchase offer widget */
|
|
2326
2405
|
superTitleSize: TextSize.default("medium"),
|
|
2327
|
-
title:
|
|
2406
|
+
title: import_zod15.z.union([import_zod15.z.string(), TiptapDocument]).nullable().default("Lorem ipsum dolor sit amet."),
|
|
2328
2407
|
/** This isn't used in the post-purchase offer widget */
|
|
2329
2408
|
titleSize: TextSize.default("medium")
|
|
2330
2409
|
}),
|
|
2331
|
-
type:
|
|
2332
|
-
});
|
|
2333
|
-
var TimerBlock =
|
|
2334
|
-
id:
|
|
2335
|
-
name:
|
|
2336
|
-
settings:
|
|
2337
|
-
durationMinutes:
|
|
2338
|
-
durationSeconds:
|
|
2339
|
-
endOffer:
|
|
2340
|
-
title:
|
|
2410
|
+
type: import_zod15.z.literal(BlockType.text).default(BlockType.text)
|
|
2411
|
+
});
|
|
2412
|
+
var TimerBlock = import_zod15.z.object({
|
|
2413
|
+
id: import_zod15.z.string().optional().default(() => (0, import_uuid3.v4)()),
|
|
2414
|
+
name: import_zod15.z.string().optional(),
|
|
2415
|
+
settings: import_zod15.z.object({
|
|
2416
|
+
durationMinutes: import_zod15.z.number().min(0).default(10),
|
|
2417
|
+
durationSeconds: import_zod15.z.union([import_zod15.z.number().min(0), import_zod15.z.unknown().transform(() => 0)]).default(0),
|
|
2418
|
+
endOffer: import_zod15.z.boolean().default(true),
|
|
2419
|
+
title: import_zod15.z.union([import_zod15.z.string(), TiptapDocument]).default("Hurry \u2014 your special offer ends in:")
|
|
2341
2420
|
}),
|
|
2342
|
-
styles:
|
|
2421
|
+
styles: import_zod15.z.object({
|
|
2343
2422
|
textAlignment: TextAlignment2.default("center"),
|
|
2344
|
-
timerBackgroundColor:
|
|
2345
|
-
timerEmphasized:
|
|
2423
|
+
timerBackgroundColor: import_zod15.z.enum(["info", "warning", "success", "critical"]).default("warning"),
|
|
2424
|
+
timerEmphasized: import_zod15.z.union([import_zod15.z.boolean(), import_zod15.z.unknown().transform(() => true)]).default(true),
|
|
2346
2425
|
timerSize: TextSize.default("medium"),
|
|
2347
|
-
timerWidth:
|
|
2348
|
-
titleEmphasized:
|
|
2426
|
+
timerWidth: import_zod15.z.number().min(10).max(100).optional().default(100),
|
|
2427
|
+
titleEmphasized: import_zod15.z.union([import_zod15.z.boolean(), import_zod15.z.unknown().transform(() => true)]).default(false),
|
|
2349
2428
|
titleSize: TextSize.default("medium")
|
|
2350
2429
|
}),
|
|
2351
|
-
type:
|
|
2430
|
+
type: import_zod15.z.literal(BlockType.timer).default(BlockType.timer)
|
|
2352
2431
|
});
|
|
2353
|
-
var PostPurchaseBlock =
|
|
2432
|
+
var PostPurchaseBlock = import_zod15.z.discriminatedUnion("type", [
|
|
2354
2433
|
CalloutBannerBlock,
|
|
2355
2434
|
ImageBlock,
|
|
2356
2435
|
ImageContentBlock,
|
|
@@ -2370,61 +2449,61 @@ var isTextBlock = (block) => (0, import_compat4.isEqual)((0, import_compat4.get)
|
|
|
2370
2449
|
var isTimerBlock = (block) => (0, import_compat4.isEqual)((0, import_compat4.get)(block, "type"), BlockType.timer);
|
|
2371
2450
|
|
|
2372
2451
|
// src/schema/widgets/post-purchase-offer/postPurchaseSettings.ts
|
|
2373
|
-
var PostPurchaseSettings =
|
|
2374
|
-
advance:
|
|
2375
|
-
blocks:
|
|
2452
|
+
var PostPurchaseSettings = import_zod16.z.object({
|
|
2453
|
+
advance: import_zod16.z.object({ removePartialOrder: import_zod16.z.boolean().default(true) }).optional().default(() => ({ removePartialOrder: true })),
|
|
2454
|
+
blocks: import_zod16.z.union([import_zod16.z.array(PostPurchaseBlock), import_zod16.z.unknown().transform(() => [])]).default(() => [
|
|
2376
2455
|
PostPurchaseBlock.parse({ settings: {}, styles: {}, type: BlockType.timer }),
|
|
2377
2456
|
PostPurchaseBlock.parse({ settings: {}, styles: {}, type: BlockType.callout_banner }),
|
|
2378
2457
|
PostPurchaseBlock.parse({ type: BlockType.product_information })
|
|
2379
2458
|
]),
|
|
2380
|
-
columnLayout:
|
|
2381
|
-
discount:
|
|
2459
|
+
columnLayout: import_zod16.z.boolean().optional(),
|
|
2460
|
+
discount: import_zod16.z.object({
|
|
2382
2461
|
amount: strictNumber.default(30),
|
|
2383
|
-
shouldShowSavingText:
|
|
2384
|
-
type:
|
|
2462
|
+
shouldShowSavingText: import_zod16.z.boolean().optional().default(true),
|
|
2463
|
+
type: import_zod16.z.enum(["none", "fixed_amount", "percentage"]).default("none")
|
|
2385
2464
|
}),
|
|
2386
|
-
discountedFrom:
|
|
2387
|
-
endpoint:
|
|
2388
|
-
integrations:
|
|
2389
|
-
judgeme:
|
|
2390
|
-
junip:
|
|
2391
|
-
klaviyo:
|
|
2392
|
-
loox:
|
|
2393
|
-
okendo:
|
|
2394
|
-
opinew:
|
|
2395
|
-
reviewsio:
|
|
2396
|
-
stamped:
|
|
2397
|
-
yotpo:
|
|
2465
|
+
discountedFrom: import_zod16.z.enum(["price", "compare_at_price"]).optional().default("price"),
|
|
2466
|
+
endpoint: import_zod16.z.string().optional(),
|
|
2467
|
+
integrations: import_zod16.z.object({
|
|
2468
|
+
judgeme: import_zod16.z.boolean().default(false),
|
|
2469
|
+
junip: import_zod16.z.boolean().optional().default(false),
|
|
2470
|
+
klaviyo: import_zod16.z.boolean().default(false),
|
|
2471
|
+
loox: import_zod16.z.boolean().default(false),
|
|
2472
|
+
okendo: import_zod16.z.boolean().default(false),
|
|
2473
|
+
opinew: import_zod16.z.boolean().optional().default(false),
|
|
2474
|
+
reviewsio: import_zod16.z.boolean().optional().default(false),
|
|
2475
|
+
stamped: import_zod16.z.boolean().default(false),
|
|
2476
|
+
yotpo: import_zod16.z.boolean().default(false)
|
|
2398
2477
|
}),
|
|
2399
|
-
key:
|
|
2400
|
-
language:
|
|
2401
|
-
description:
|
|
2402
|
-
descriptionEnabled:
|
|
2403
|
-
descriptionRte:
|
|
2404
|
-
content:
|
|
2405
|
-
type:
|
|
2478
|
+
key: import_zod16.z.string().optional(),
|
|
2479
|
+
language: import_zod16.z.object({
|
|
2480
|
+
description: import_zod16.z.union([import_zod16.z.string(), import_zod16.z.unknown().transform(() => "")]).default(""),
|
|
2481
|
+
descriptionEnabled: import_zod16.z.boolean().optional().default(false),
|
|
2482
|
+
descriptionRte: import_zod16.z.object({
|
|
2483
|
+
content: import_zod16.z.array(import_zod16.z.unknown()),
|
|
2484
|
+
type: import_zod16.z.string()
|
|
2406
2485
|
}).optional(),
|
|
2407
|
-
descriptionSpacing:
|
|
2408
|
-
displayCtaPrice:
|
|
2409
|
-
global:
|
|
2410
|
-
declineAll:
|
|
2411
|
-
declineThisOffer:
|
|
2412
|
-
free:
|
|
2413
|
-
notAvailable:
|
|
2414
|
-
payNow:
|
|
2415
|
-
payNowUpgradeToSubscription:
|
|
2416
|
-
quantity:
|
|
2486
|
+
descriptionSpacing: import_zod16.z.enum(["none", "xtight", "tight", "default", "loose", "xloose"]).optional(),
|
|
2487
|
+
displayCtaPrice: import_zod16.z.boolean().default(true),
|
|
2488
|
+
global: import_zod16.z.object({
|
|
2489
|
+
declineAll: import_zod16.z.string().optional().default("Decline All"),
|
|
2490
|
+
declineThisOffer: import_zod16.z.string().default("Decline this offer"),
|
|
2491
|
+
free: import_zod16.z.string().optional().default("Free"),
|
|
2492
|
+
notAvailable: import_zod16.z.string().optional().default("Not available"),
|
|
2493
|
+
payNow: import_zod16.z.string().default("Pay Now"),
|
|
2494
|
+
payNowUpgradeToSubscription: import_zod16.z.string().optional().default("Upgrade to Subscription"),
|
|
2495
|
+
quantity: import_zod16.z.string().default("Quantity"),
|
|
2417
2496
|
/** This isn't configurable in the admin-nextjs editor */
|
|
2418
|
-
recurringShipping:
|
|
2419
|
-
recurringSubtotal:
|
|
2420
|
-
reviewsPlural:
|
|
2421
|
-
reviewsSingular:
|
|
2422
|
-
save:
|
|
2423
|
-
shipping:
|
|
2424
|
-
subscriptionOption:
|
|
2425
|
-
subtotal:
|
|
2426
|
-
taxes:
|
|
2427
|
-
total:
|
|
2497
|
+
recurringShipping: import_zod16.z.string().optional().default("Recurring shipping"),
|
|
2498
|
+
recurringSubtotal: import_zod16.z.string().default("Recurring subtotal"),
|
|
2499
|
+
reviewsPlural: import_zod16.z.string().optional().default("Reviews"),
|
|
2500
|
+
reviewsSingular: import_zod16.z.string().optional().default("Review"),
|
|
2501
|
+
save: import_zod16.z.union([import_zod16.z.string(), import_zod16.z.unknown().transform(() => "Save")]).optional().default("Save"),
|
|
2502
|
+
shipping: import_zod16.z.string().default("Shipping"),
|
|
2503
|
+
subscriptionOption: import_zod16.z.string().optional().default("Subscribe and Save"),
|
|
2504
|
+
subtotal: import_zod16.z.string().default("Subtotal"),
|
|
2505
|
+
taxes: import_zod16.z.string().default("Taxes"),
|
|
2506
|
+
total: import_zod16.z.string().default("Total")
|
|
2428
2507
|
}).optional().default(() => ({
|
|
2429
2508
|
declineAll: "Decline All",
|
|
2430
2509
|
declineThisOffer: "Decline this offer",
|
|
@@ -2445,70 +2524,70 @@ var PostPurchaseSettings = import_zod15.z.object({
|
|
|
2445
2524
|
taxes: "Taxes",
|
|
2446
2525
|
total: "Total"
|
|
2447
2526
|
})),
|
|
2448
|
-
globalTranslation:
|
|
2527
|
+
globalTranslation: import_zod16.z.string().optional().default("english")
|
|
2449
2528
|
}),
|
|
2450
|
-
metafields:
|
|
2529
|
+
metafields: import_zod16.z.boolean().default(false),
|
|
2451
2530
|
/** This isn't configurable in the admin-nextjs editor */
|
|
2452
|
-
offer:
|
|
2453
|
-
count:
|
|
2531
|
+
offer: import_zod16.z.object({
|
|
2532
|
+
count: import_zod16.z.number().default(1)
|
|
2454
2533
|
}),
|
|
2455
|
-
offersLayout:
|
|
2456
|
-
itemsPerPage:
|
|
2457
|
-
type:
|
|
2534
|
+
offersLayout: import_zod16.z.object({
|
|
2535
|
+
itemsPerPage: import_zod16.z.number().optional(),
|
|
2536
|
+
type: import_zod16.z.enum(["list", "grid", "carousel"]).default("list")
|
|
2458
2537
|
}).optional().default({
|
|
2459
2538
|
type: "list"
|
|
2460
2539
|
}),
|
|
2461
2540
|
/** This isn't configurable in the admin-nextjs editor */
|
|
2462
|
-
previewMode:
|
|
2463
|
-
productLimit:
|
|
2464
|
-
productOptions:
|
|
2541
|
+
previewMode: import_zod16.z.boolean().default(false),
|
|
2542
|
+
productLimit: import_zod16.z.number().optional().default(1),
|
|
2543
|
+
productOptions: import_zod16.z.object({
|
|
2465
2544
|
/** This isn't configurable in the admin-nextjs editor */
|
|
2466
|
-
hideOutOfStockVariants:
|
|
2467
|
-
matchVariant:
|
|
2468
|
-
showDeclineAll:
|
|
2469
|
-
showShipping:
|
|
2470
|
-
showSubtotal:
|
|
2471
|
-
showTaxes:
|
|
2472
|
-
showTotal:
|
|
2473
|
-
showVariantSelectors:
|
|
2474
|
-
variantSelectorDisplayMode:
|
|
2545
|
+
hideOutOfStockVariants: import_zod16.z.boolean().optional().default(false),
|
|
2546
|
+
matchVariant: import_zod16.z.boolean().optional().default(true),
|
|
2547
|
+
showDeclineAll: import_zod16.z.enum(["above", "below", "both", "none"]).optional(),
|
|
2548
|
+
showShipping: import_zod16.z.boolean().optional().default(true),
|
|
2549
|
+
showSubtotal: import_zod16.z.boolean().optional().default(true),
|
|
2550
|
+
showTaxes: import_zod16.z.boolean().optional().default(true),
|
|
2551
|
+
showTotal: import_zod16.z.boolean().optional().default(true),
|
|
2552
|
+
showVariantSelectors: import_zod16.z.boolean().optional().default(true),
|
|
2553
|
+
variantSelectorDisplayMode: import_zod16.z.enum(["separate", "single"]).optional().default("separate")
|
|
2475
2554
|
}),
|
|
2476
|
-
productType:
|
|
2477
|
-
productTypeSelector:
|
|
2478
|
-
quantityInputs:
|
|
2479
|
-
defaultQuantity:
|
|
2480
|
-
enabled:
|
|
2481
|
-
maxValue:
|
|
2482
|
-
minValue:
|
|
2555
|
+
productType: import_zod16.z.union([import_zod16.z.enum(["one-time", "subscription", "both"]), import_zod16.z.literal("").transform(() => "one-time")]).default("one-time"),
|
|
2556
|
+
productTypeSelector: import_zod16.z.enum(["dropdown", "radio"]).optional().default("radio"),
|
|
2557
|
+
quantityInputs: import_zod16.z.object({
|
|
2558
|
+
defaultQuantity: import_zod16.z.union([import_zod16.z.number(), import_zod16.z.null().transform(() => 1)]).default(1),
|
|
2559
|
+
enabled: import_zod16.z.boolean().default(true),
|
|
2560
|
+
maxValue: import_zod16.z.union([import_zod16.z.number(), import_zod16.z.null().transform(() => 15)]).default(15),
|
|
2561
|
+
minValue: import_zod16.z.union([import_zod16.z.number().min(0), import_zod16.z.unknown().transform(() => 0)]).default(1)
|
|
2483
2562
|
}),
|
|
2484
|
-
shipping:
|
|
2563
|
+
shipping: import_zod16.z.object({
|
|
2485
2564
|
amount: strictNumber.default(10),
|
|
2486
2565
|
/** This isn't configurable in the admin-nextjs editor */
|
|
2487
|
-
enabled:
|
|
2488
|
-
title:
|
|
2489
|
-
type:
|
|
2566
|
+
enabled: import_zod16.z.boolean().default(true),
|
|
2567
|
+
title: import_zod16.z.string().optional().default("Shipping Fees"),
|
|
2568
|
+
type: import_zod16.z.enum(["free", "fixed_amount"]).default("free")
|
|
2490
2569
|
}),
|
|
2491
|
-
styles:
|
|
2492
|
-
starColor:
|
|
2493
|
-
starSize:
|
|
2494
|
-
starStrokeColor:
|
|
2495
|
-
strokeWidth:
|
|
2570
|
+
styles: import_zod16.z.object({
|
|
2571
|
+
starColor: import_zod16.z.string().optional().default("#fadb14"),
|
|
2572
|
+
starSize: import_zod16.z.union([import_zod16.z.enum(["small", "medium", "large"]), import_zod16.z.unknown().transform(() => "large")]).optional().default("large"),
|
|
2573
|
+
starStrokeColor: import_zod16.z.string().optional().default("#fadb14"),
|
|
2574
|
+
strokeWidth: import_zod16.z.string().optional().default("1")
|
|
2496
2575
|
}).optional(),
|
|
2497
|
-
subImages:
|
|
2498
|
-
subscription:
|
|
2499
|
-
discount:
|
|
2576
|
+
subImages: import_zod16.z.number().nullish().default(8),
|
|
2577
|
+
subscription: import_zod16.z.object({
|
|
2578
|
+
discount: import_zod16.z.object({
|
|
2500
2579
|
amount: strictNumber.default(30),
|
|
2501
|
-
shouldShowSavingText:
|
|
2502
|
-
type:
|
|
2580
|
+
shouldShowSavingText: import_zod16.z.boolean().optional().default(true),
|
|
2581
|
+
type: import_zod16.z.enum(["none", "fixed_amount", "percentage"]).default("none")
|
|
2503
2582
|
}),
|
|
2504
|
-
shipping:
|
|
2583
|
+
shipping: import_zod16.z.object({
|
|
2505
2584
|
amount: strictNumber.default(1),
|
|
2506
2585
|
/** This isn't configurable in the admin-nextjs editor */
|
|
2507
|
-
enabled:
|
|
2586
|
+
enabled: import_zod16.z.boolean().default(true),
|
|
2508
2587
|
/** This isn't configurable in the admin-nextjs editor */
|
|
2509
2588
|
recurringAmount: strictNumber.default(2),
|
|
2510
|
-
shippingTitle:
|
|
2511
|
-
type:
|
|
2589
|
+
shippingTitle: import_zod16.z.string().default("Shipping Fees"),
|
|
2590
|
+
type: import_zod16.z.enum(["free", "fixed_amount"]).default("free")
|
|
2512
2591
|
})
|
|
2513
2592
|
}).optional().default({
|
|
2514
2593
|
discount: {
|
|
@@ -2526,15 +2605,15 @@ var PostPurchaseSettings = import_zod15.z.object({
|
|
|
2526
2605
|
type: "free"
|
|
2527
2606
|
}
|
|
2528
2607
|
}),
|
|
2529
|
-
subscriptionIsDefault:
|
|
2608
|
+
subscriptionIsDefault: import_zod16.z.boolean().optional(),
|
|
2530
2609
|
/** This isn't configurable in the admin-nextjs editor */
|
|
2531
|
-
template:
|
|
2532
|
-
type:
|
|
2533
|
-
upgradeToSubscription:
|
|
2534
|
-
acceptButtonText:
|
|
2535
|
-
allow:
|
|
2536
|
-
emailRefundNotice:
|
|
2537
|
-
errorBannerText:
|
|
2610
|
+
template: import_zod16.z.string().optional().default(""),
|
|
2611
|
+
type: import_zod16.z.literal("shopify_post_purchase_extension").default("shopify_post_purchase_extension"),
|
|
2612
|
+
upgradeToSubscription: import_zod16.z.object({
|
|
2613
|
+
acceptButtonText: import_zod16.z.string().optional().default("Upgrade"),
|
|
2614
|
+
allow: import_zod16.z.boolean().optional().default(false),
|
|
2615
|
+
emailRefundNotice: import_zod16.z.boolean().optional().default(false),
|
|
2616
|
+
errorBannerText: import_zod16.z.string().optional().default("This subscription cannot be added - limit one per order")
|
|
2538
2617
|
}).optional().default(() => ({
|
|
2539
2618
|
acceptButtonText: "Upgrade",
|
|
2540
2619
|
allow: false,
|
|
@@ -2543,91 +2622,43 @@ var PostPurchaseSettings = import_zod15.z.object({
|
|
|
2543
2622
|
}))
|
|
2544
2623
|
});
|
|
2545
2624
|
|
|
2546
|
-
// src/schema/postPurchaseChoice.ts
|
|
2547
|
-
var PostPurchaseChoice = import_zod16.z.discriminatedUnion("mode", [
|
|
2548
|
-
import_zod16.z.object({ mode: import_zod16.z.literal("one-time") }).strict(),
|
|
2549
|
-
import_zod16.z.object({ mode: import_zod16.z.literal("subscription"), sellingPlanId: PostPurchasePlanOption.shape.id }).strict()
|
|
2550
|
-
]);
|
|
2551
|
-
var PostPurchaseOptions = import_zod16.z.object({
|
|
2552
|
-
defaultChoice: PostPurchaseChoice,
|
|
2553
|
-
modes: import_zod16.z.array(import_zod16.z.enum(["one-time", "subscription"])).min(1).max(2),
|
|
2554
|
-
selector: PostPurchaseSettings.shape.productTypeSelector
|
|
2555
|
-
});
|
|
2556
|
-
|
|
2557
|
-
// src/schema/postPurchaseEligibility.ts
|
|
2558
|
-
var import_zod17 = require("zod");
|
|
2559
|
-
var PostPurchaseSkipReasonSchema = import_zod17.z.enum(["empty", "no-eligible-subscription"]);
|
|
2560
|
-
|
|
2561
|
-
// src/schema/postPurchaseExitPolicy.ts
|
|
2562
|
-
var import_zod18 = require("zod");
|
|
2563
|
-
var EXIT_DELAY_MAX_MS = 60 * 60 * 1e3;
|
|
2564
|
-
var ExitPolicySchema = import_zod18.z.discriminatedUnion("status", [
|
|
2565
|
-
import_zod18.z.strictObject({ status: import_zod18.z.literal("unavailable") }),
|
|
2566
|
-
import_zod18.z.strictObject({
|
|
2567
|
-
delayMs: import_zod18.z.number().int().nonnegative().max(EXIT_DELAY_MAX_MS),
|
|
2568
|
-
source: import_zod18.z.enum(["admitted", "selected-flow"]),
|
|
2569
|
-
status: import_zod18.z.literal("available")
|
|
2570
|
-
})
|
|
2571
|
-
]);
|
|
2572
|
-
|
|
2573
|
-
// src/schema/postPurchaseProduct.ts
|
|
2574
|
-
var import_zod24 = require("zod");
|
|
2575
|
-
|
|
2576
|
-
// src/schema/postPurchaseProductDisplay.ts
|
|
2577
|
-
var import_zod21 = require("zod");
|
|
2578
|
-
|
|
2579
|
-
// src/schema/postPurchaseProductGallery.ts
|
|
2580
|
-
var import_zod19 = require("zod");
|
|
2581
|
-
var PostPurchaseProductGallery = import_zod19.z.object({
|
|
2582
|
-
images: import_zod19.z.array(
|
|
2583
|
-
import_zod19.z.object({
|
|
2584
|
-
description: import_zod19.z.string(),
|
|
2585
|
-
id: import_zod19.z.number().int().positive(),
|
|
2586
|
-
source: import_zod19.z.string(),
|
|
2587
|
-
thumbnail: import_zod19.z.string()
|
|
2588
|
-
})
|
|
2589
|
-
),
|
|
2590
|
-
selectedImageId: import_zod19.z.number().int().positive().optional()
|
|
2591
|
-
});
|
|
2592
|
-
|
|
2593
2625
|
// src/schema/postPurchaseProductReviews.ts
|
|
2594
|
-
var
|
|
2595
|
-
|
|
2596
|
-
|
|
2597
|
-
import_zod20.z.string().regex(/^\d+(?:\.\d+)?$/).transform(Number)
|
|
2626
|
+
var decimal = import_zod17.z.union([
|
|
2627
|
+
import_zod17.z.number(),
|
|
2628
|
+
import_zod17.z.string().regex(/^\d+(?:\.\d+)?$/).transform(Number)
|
|
2598
2629
|
]);
|
|
2599
|
-
var PostPurchaseCommonReviewRating =
|
|
2630
|
+
var PostPurchaseCommonReviewRating = import_zod17.z.object({ value: decimal.pipe(import_zod17.z.number().min(0).max(5)) });
|
|
2600
2631
|
var PostPurchaseKlaviyoReviewRating = PostPurchaseCommonReviewRating.extend({
|
|
2601
2632
|
// Legacy validates key presence, then displays the raw value on five stars without rescaling.
|
|
2602
|
-
scale_max:
|
|
2603
|
-
scale_min:
|
|
2633
|
+
scale_max: import_zod17.z.unknown().nonoptional(),
|
|
2634
|
+
scale_min: import_zod17.z.unknown().nonoptional()
|
|
2604
2635
|
});
|
|
2605
|
-
var PostPurchaseReviewCount =
|
|
2636
|
+
var PostPurchaseReviewCount = import_zod17.z.string().regex(/^\d+(?:\.\d+)?$/).transform(Number).pipe(import_zod17.z.number().int().nonnegative());
|
|
2606
2637
|
var PostPurchaseReviewStyles = PostPurchaseSettings.shape.styles.unwrap().extend({
|
|
2607
|
-
strokeWidth: decimal.pipe(
|
|
2638
|
+
strokeWidth: decimal.pipe(import_zod17.z.number().nonnegative()).default(1)
|
|
2608
2639
|
}).prefault({});
|
|
2609
|
-
var PostPurchaseProductReviews =
|
|
2610
|
-
color:
|
|
2611
|
-
rating:
|
|
2612
|
-
reviewCount:
|
|
2613
|
-
reviewsPlural:
|
|
2614
|
-
reviewsSingular:
|
|
2615
|
-
size:
|
|
2616
|
-
strokeColor:
|
|
2617
|
-
strokeWidth:
|
|
2640
|
+
var PostPurchaseProductReviews = import_zod17.z.object({
|
|
2641
|
+
color: import_zod17.z.string(),
|
|
2642
|
+
rating: import_zod17.z.number().positive().max(5),
|
|
2643
|
+
reviewCount: import_zod17.z.number().int().nonnegative(),
|
|
2644
|
+
reviewsPlural: import_zod17.z.string(),
|
|
2645
|
+
reviewsSingular: import_zod17.z.string(),
|
|
2646
|
+
size: import_zod17.z.enum(["small", "medium", "large"]),
|
|
2647
|
+
strokeColor: import_zod17.z.string(),
|
|
2648
|
+
strokeWidth: import_zod17.z.number().nonnegative()
|
|
2618
2649
|
});
|
|
2619
2650
|
|
|
2620
2651
|
// src/schema/postPurchaseProductDisplay.ts
|
|
2621
2652
|
var language = PostPurchaseSettings.shape.language;
|
|
2622
|
-
var PostPurchasePrimaryImageSource =
|
|
2653
|
+
var PostPurchasePrimaryImageSource = import_zod18.z.string().default(
|
|
2623
2654
|
"https://cdn.shopify.com/shopifycloud/shopify/assets/no-image-2048-5e88c1b20e087fb7bbe9a3771824e743c244f437e4f8ba93bbf7b11b53f7824c.gif"
|
|
2624
2655
|
);
|
|
2625
|
-
var PostPurchaseProductDisplay =
|
|
2656
|
+
var PostPurchaseProductDisplay = import_zod18.z.object({
|
|
2626
2657
|
descriptionDocument: TiptapDocument.optional(),
|
|
2627
2658
|
discountedFrom: PostPurchaseSettings.shape.discountedFrom,
|
|
2628
2659
|
gallery: PostPurchaseProductGallery.optional(),
|
|
2629
2660
|
language: language.pick({ description: true, descriptionEnabled: true }),
|
|
2630
|
-
primaryImage:
|
|
2661
|
+
primaryImage: import_zod18.z.object({ description: import_zod18.z.string(), source: import_zod18.z.string() }),
|
|
2631
2662
|
productOptions: PostPurchaseSettings.shape.productOptions.pick({
|
|
2632
2663
|
showDeclineAll: true,
|
|
2633
2664
|
showShipping: true,
|
|
@@ -2642,10 +2673,10 @@ var PostPurchaseProductDisplay = import_zod21.z.object({
|
|
|
2642
2673
|
});
|
|
2643
2674
|
|
|
2644
2675
|
// src/schema/postPurchaseProductSource.ts
|
|
2645
|
-
var
|
|
2646
|
-
var PostPurchaseAmount =
|
|
2647
|
-
var PostPurchaseProductId =
|
|
2648
|
-
var PostPurchaseVariantId =
|
|
2676
|
+
var import_zod19 = require("zod");
|
|
2677
|
+
var PostPurchaseAmount = import_zod19.z.string().regex(/^\d+(?:\.\d+)?$/).refine((value) => Number.isFinite(Number(value)));
|
|
2678
|
+
var PostPurchaseProductId = import_zod19.z.number().int().positive();
|
|
2679
|
+
var PostPurchaseVariantId = import_zod19.z.number().int().positive();
|
|
2649
2680
|
var ProductBase = OfferProduct.pick({ description: true, id: true, image: true, title: true }).extend({
|
|
2650
2681
|
description: OfferProduct.shape.description.nullable(),
|
|
2651
2682
|
id: PostPurchaseProductId
|
|
@@ -2653,56 +2684,65 @@ var ProductBase = OfferProduct.pick({ description: true, id: true, image: true,
|
|
|
2653
2684
|
var SourceVariant = OfferProduct.shape.variants.element.pick({ id: true, title: true }).extend({
|
|
2654
2685
|
compareAtPrice: PostPurchaseAmount.nullable(),
|
|
2655
2686
|
id: PostPurchaseVariantId,
|
|
2656
|
-
imageId:
|
|
2657
|
-
inventoryManagement:
|
|
2658
|
-
inventoryPolicy:
|
|
2659
|
-
inventoryQuantity:
|
|
2660
|
-
option1:
|
|
2661
|
-
option2:
|
|
2662
|
-
option3:
|
|
2687
|
+
imageId: import_zod19.z.number().int().nonnegative().nullish(),
|
|
2688
|
+
inventoryManagement: import_zod19.z.string().nullable(),
|
|
2689
|
+
inventoryPolicy: import_zod19.z.string(),
|
|
2690
|
+
inventoryQuantity: import_zod19.z.number(),
|
|
2691
|
+
option1: import_zod19.z.unknown().optional(),
|
|
2692
|
+
option2: import_zod19.z.unknown().optional(),
|
|
2693
|
+
option3: import_zod19.z.unknown().optional(),
|
|
2663
2694
|
price: PostPurchaseAmount,
|
|
2664
2695
|
productId: PostPurchaseProductId,
|
|
2665
|
-
sellingPlanAllocations:
|
|
2696
|
+
sellingPlanAllocations: import_zod19.z.unknown().optional()
|
|
2666
2697
|
});
|
|
2667
2698
|
var Product2 = ProductBase.extend({
|
|
2668
|
-
images:
|
|
2669
|
-
|
|
2699
|
+
images: import_zod19.z.array(
|
|
2700
|
+
import_zod19.z.object({ alt: import_zod19.z.string().optional().catch(void 0), id: import_zod19.z.number().int().positive(), src: import_zod19.z.string() })
|
|
2670
2701
|
).nullish(),
|
|
2671
|
-
metadata:
|
|
2672
|
-
productQuantity:
|
|
2673
|
-
|
|
2674
|
-
|
|
2702
|
+
metadata: import_zod19.z.object({
|
|
2703
|
+
productQuantity: import_zod19.z.union([
|
|
2704
|
+
import_zod19.z.number().int().positive(),
|
|
2705
|
+
import_zod19.z.string().regex(/^[1-9]\d*$/).transform(Number)
|
|
2675
2706
|
]).optional()
|
|
2676
2707
|
}).optional(),
|
|
2677
|
-
metafields:
|
|
2678
|
-
options:
|
|
2679
|
-
productGroupVariants:
|
|
2680
|
-
selectedVariant:
|
|
2681
|
-
sellingPlanGroups:
|
|
2708
|
+
metafields: import_zod19.z.unknown().optional(),
|
|
2709
|
+
options: import_zod19.z.unknown().optional(),
|
|
2710
|
+
productGroupVariants: import_zod19.z.array(import_zod19.z.unknown()).default([]),
|
|
2711
|
+
selectedVariant: import_zod19.z.unknown().optional(),
|
|
2712
|
+
sellingPlanGroups: import_zod19.z.array(
|
|
2682
2713
|
OfferProduct.shape.sellingPlanGroups.unwrap().element.extend({
|
|
2683
|
-
discountAmount:
|
|
2684
|
-
discountType:
|
|
2685
|
-
id:
|
|
2686
|
-
requiresSellingPlan:
|
|
2687
|
-
sellingPlans:
|
|
2714
|
+
discountAmount: import_zod19.z.unknown().optional(),
|
|
2715
|
+
discountType: import_zod19.z.unknown().optional(),
|
|
2716
|
+
id: import_zod19.z.unknown().optional(),
|
|
2717
|
+
requiresSellingPlan: import_zod19.z.boolean().default(false),
|
|
2718
|
+
sellingPlans: import_zod19.z.unknown().optional()
|
|
2688
2719
|
})
|
|
2689
2720
|
).default([]),
|
|
2690
|
-
variants:
|
|
2721
|
+
variants: import_zod19.z.array(SourceVariant)
|
|
2691
2722
|
});
|
|
2692
|
-
var PostPurchaseProductSource =
|
|
2693
|
-
data:
|
|
2694
|
-
metadata:
|
|
2723
|
+
var PostPurchaseProductSource = import_zod19.z.object({
|
|
2724
|
+
data: import_zod19.z.array(Product2),
|
|
2725
|
+
metadata: import_zod19.z.object({ widget: import_zod19.z.record(import_zod19.z.string(), import_zod19.z.unknown()).default({}) }).default({ widget: {} })
|
|
2695
2726
|
});
|
|
2696
2727
|
|
|
2697
2728
|
// src/schema/postPurchaseSubscription.ts
|
|
2698
|
-
var
|
|
2699
|
-
|
|
2729
|
+
var import_zod21 = require("zod");
|
|
2730
|
+
|
|
2731
|
+
// src/schema/postPurchasePlanAdjustment.ts
|
|
2732
|
+
var import_zod20 = require("zod");
|
|
2733
|
+
var PostPurchasePlanAdjustment = import_zod20.z.object({
|
|
2734
|
+
amount: PostPurchaseDiscount.shape.amount,
|
|
2735
|
+
type: import_zod20.z.enum(["percentage", "fixed_amount", "price"])
|
|
2736
|
+
}).refine(({ amount: amount2, type }) => type === "price" || validPostPurchaseDiscount({ amount: amount2, type }));
|
|
2737
|
+
|
|
2738
|
+
// src/schema/postPurchaseSubscription.ts
|
|
2739
|
+
var PostPurchaseSubscriptionTerms = import_zod21.z.object({
|
|
2700
2740
|
adjustment: PostPurchasePlanAdjustment.optional(),
|
|
2701
|
-
initialShippingPrice:
|
|
2702
|
-
intervalLabel:
|
|
2703
|
-
name:
|
|
2704
|
-
recurringShippingPrice:
|
|
2705
|
-
shippingOption:
|
|
2741
|
+
initialShippingPrice: import_zod21.z.number().nonnegative(),
|
|
2742
|
+
intervalLabel: import_zod21.z.string().min(1),
|
|
2743
|
+
name: import_zod21.z.string().min(1),
|
|
2744
|
+
recurringShippingPrice: import_zod21.z.number().nonnegative(),
|
|
2745
|
+
shippingOption: import_zod21.z.object({ presentmentTitle: import_zod21.z.string(), title: import_zod21.z.string() })
|
|
2706
2746
|
});
|
|
2707
2747
|
|
|
2708
2748
|
// src/schema/postPurchaseProduct.ts
|
|
@@ -2712,88 +2752,464 @@ var PostPurchaseVariant = OfferProduct.shape.variants.element.pick({ id: true, t
|
|
|
2712
2752
|
id: PostPurchaseVariantId,
|
|
2713
2753
|
price: PostPurchaseAmount
|
|
2714
2754
|
});
|
|
2715
|
-
var PreparedPostPurchaseProduct =
|
|
2755
|
+
var PreparedPostPurchaseProduct = import_zod22.z.object({
|
|
2716
2756
|
display: PostPurchaseProductDisplay,
|
|
2717
|
-
labels:
|
|
2757
|
+
labels: import_zod22.z.object({
|
|
2718
2758
|
declineAll: global.declineAll,
|
|
2719
|
-
free:
|
|
2720
|
-
payNow:
|
|
2721
|
-
quantity:
|
|
2759
|
+
free: import_zod22.z.string(),
|
|
2760
|
+
payNow: import_zod22.z.string(),
|
|
2761
|
+
quantity: import_zod22.z.string(),
|
|
2722
2762
|
recurringShipping: global.recurringShipping,
|
|
2723
2763
|
recurringSubtotal: global.recurringSubtotal,
|
|
2724
|
-
save:
|
|
2725
|
-
shipping:
|
|
2726
|
-
subtotal:
|
|
2727
|
-
taxes:
|
|
2728
|
-
total:
|
|
2764
|
+
save: import_zod22.z.string(),
|
|
2765
|
+
shipping: import_zod22.z.string(),
|
|
2766
|
+
subtotal: import_zod22.z.string(),
|
|
2767
|
+
taxes: import_zod22.z.string(),
|
|
2768
|
+
total: import_zod22.z.string()
|
|
2729
2769
|
}),
|
|
2730
2770
|
product: OfferProduct.pick({ description: true, id: true, image: true, title: true }).extend({
|
|
2731
2771
|
description: OfferProduct.shape.description.nullable(),
|
|
2732
2772
|
id: PostPurchaseProductId,
|
|
2733
2773
|
variant: PostPurchaseVariant
|
|
2734
2774
|
}),
|
|
2735
|
-
selection:
|
|
2775
|
+
selection: import_zod22.z.object({
|
|
2736
2776
|
productId: PostPurchaseProductId,
|
|
2737
|
-
quantity:
|
|
2738
|
-
sellingPlanId:
|
|
2777
|
+
quantity: import_zod22.z.number().int().positive(),
|
|
2778
|
+
sellingPlanId: import_zod22.z.number().int().positive().optional(),
|
|
2739
2779
|
variantId: PostPurchaseVariantId
|
|
2740
2780
|
}),
|
|
2741
|
-
status:
|
|
2742
|
-
terms:
|
|
2781
|
+
status: import_zod22.z.literal("prepared"),
|
|
2782
|
+
terms: import_zod22.z.object({
|
|
2743
2783
|
discount: PostPurchaseDiscount,
|
|
2744
|
-
shipping:
|
|
2745
|
-
amount:
|
|
2746
|
-
title:
|
|
2747
|
-
type:
|
|
2784
|
+
shipping: import_zod22.z.object({
|
|
2785
|
+
amount: import_zod22.z.number().nonnegative(),
|
|
2786
|
+
title: import_zod22.z.string(),
|
|
2787
|
+
type: import_zod22.z.enum(["free", "fixed_amount"])
|
|
2748
2788
|
}),
|
|
2749
2789
|
subscription: PostPurchaseSubscriptionTerms.optional()
|
|
2750
2790
|
})
|
|
2751
2791
|
});
|
|
2752
|
-
var PostPurchasePreparation =
|
|
2792
|
+
var PostPurchasePreparation = import_zod22.z.discriminatedUnion("status", [
|
|
2753
2793
|
PreparedPostPurchaseProduct,
|
|
2754
|
-
|
|
2794
|
+
import_zod22.z.object({ reason: import_zod22.z.string(), status: import_zod22.z.literal("unsupported") })
|
|
2755
2795
|
]);
|
|
2756
2796
|
|
|
2757
|
-
// src/schema/
|
|
2758
|
-
var
|
|
2759
|
-
|
|
2760
|
-
|
|
2761
|
-
|
|
2797
|
+
// src/schema/postPurchaseProductCalculation.ts
|
|
2798
|
+
var import_zod23 = require("zod");
|
|
2799
|
+
var MoneyBag = import_zod23.z.object({
|
|
2800
|
+
presentmentMoney: import_zod23.z.object({
|
|
2801
|
+
amount: PostPurchaseAmount,
|
|
2802
|
+
currencyCode: import_zod23.z.string().regex(/^[A-Z]{3}$/)
|
|
2803
|
+
})
|
|
2804
|
+
});
|
|
2805
|
+
var PostPurchaseProductCalculation = import_zod23.z.object({
|
|
2806
|
+
calculatedPurchase: import_zod23.z.object({
|
|
2807
|
+
addedShippingLines: import_zod23.z.array(import_zod23.z.object({ priceSet: MoneyBag })),
|
|
2808
|
+
addedTaxLines: import_zod23.z.array(import_zod23.z.object({ priceSet: MoneyBag })),
|
|
2809
|
+
totalOutstandingSet: MoneyBag,
|
|
2810
|
+
updatedLineItems: import_zod23.z.array(
|
|
2811
|
+
import_zod23.z.object({
|
|
2812
|
+
priceSet: import_zod23.z.unknown().optional(),
|
|
2813
|
+
productId: import_zod23.z.number().int().positive(),
|
|
2814
|
+
sellingPlanId: import_zod23.z.unknown().optional(),
|
|
2815
|
+
variantId: import_zod23.z.number().int().positive()
|
|
2816
|
+
})
|
|
2817
|
+
)
|
|
2818
|
+
}),
|
|
2819
|
+
errors: import_zod23.z.array(import_zod23.z.unknown()).length(0),
|
|
2820
|
+
status: import_zod23.z.literal("processed")
|
|
2821
|
+
});
|
|
2822
|
+
var Minor = import_zod23.z.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER);
|
|
2823
|
+
var PostPurchaseProductCosts = import_zod23.z.object({
|
|
2824
|
+
currencyCode: MoneyBag.shape.presentmentMoney.shape.currencyCode,
|
|
2825
|
+
recurringDisplay: import_zod23.z.object({ shippingMinor: Minor, subtotalMinor: Minor, totalMinor: Minor }).optional(),
|
|
2826
|
+
shippingMinor: Minor,
|
|
2827
|
+
subtotalMinor: Minor,
|
|
2828
|
+
taxesMinor: Minor,
|
|
2829
|
+
totalMinor: Minor
|
|
2830
|
+
});
|
|
2831
|
+
var ChangesetDiscount = import_zod23.z.object({
|
|
2832
|
+
title: import_zod23.z.string(),
|
|
2833
|
+
value: import_zod23.z.number().nonnegative(),
|
|
2834
|
+
valueType: import_zod23.z.enum(["percentage", "fixed_amount"])
|
|
2835
|
+
}).optional();
|
|
2836
|
+
var PostPurchaseProductChangeset = import_zod23.z.object({
|
|
2837
|
+
changes: import_zod23.z.array(
|
|
2838
|
+
import_zod23.z.union([
|
|
2839
|
+
import_zod23.z.object({
|
|
2840
|
+
discount: ChangesetDiscount,
|
|
2841
|
+
quantity: import_zod23.z.number().int().positive(),
|
|
2842
|
+
type: import_zod23.z.literal("add_variant"),
|
|
2843
|
+
variantId: import_zod23.z.number().int().positive()
|
|
2844
|
+
}),
|
|
2845
|
+
import_zod23.z.object({ price: import_zod23.z.number().nonnegative(), title: import_zod23.z.string(), type: import_zod23.z.literal("add_shipping_line") }),
|
|
2846
|
+
PostPurchaseSubscriptionTerms.pick({
|
|
2847
|
+
initialShippingPrice: true,
|
|
2848
|
+
recurringShippingPrice: true,
|
|
2849
|
+
shippingOption: true
|
|
2850
|
+
}).extend({
|
|
2851
|
+
discount: ChangesetDiscount,
|
|
2852
|
+
quantity: import_zod23.z.number().int().positive(),
|
|
2853
|
+
sellingPlanId: import_zod23.z.number().int().positive(),
|
|
2854
|
+
type: import_zod23.z.literal("add_subscription"),
|
|
2855
|
+
variantId: import_zod23.z.number().int().positive()
|
|
2856
|
+
})
|
|
2857
|
+
])
|
|
2858
|
+
)
|
|
2859
|
+
});
|
|
2762
2860
|
|
|
2763
|
-
// src/schema/
|
|
2764
|
-
var
|
|
2861
|
+
// src/schema/postPurchaseAdmission.ts
|
|
2862
|
+
var PurchaseExpectedSchema = import_zod24.z.object({
|
|
2863
|
+
buyerConsentToSubscriptions: import_zod24.z.boolean().optional(),
|
|
2864
|
+
changeset: PostPurchaseProductChangeset.extend({
|
|
2865
|
+
changes: PostPurchaseProductChangeset.shape.changes.min(1).max(2)
|
|
2866
|
+
}),
|
|
2867
|
+
entry: DecisionEntrySchema,
|
|
2868
|
+
member: PostPurchaseMemberIdentity.optional(),
|
|
2869
|
+
progressRevision: import_zod24.z.number().int().nonnegative().optional(),
|
|
2870
|
+
selection: PreparedPostPurchaseProduct.shape.selection
|
|
2871
|
+
}).refine(
|
|
2872
|
+
({ member, progressRevision }) => !member || progressRevision !== void 0,
|
|
2873
|
+
"Captured member requires progress"
|
|
2874
|
+
).refine(({ buyerConsentToSubscriptions: consent, changeset, selection: selection2 }) => {
|
|
2875
|
+
const [change, shipping] = changeset.changes;
|
|
2876
|
+
if (selection2.sellingPlanId === void 0)
|
|
2877
|
+
return consent !== true && change?.type === "add_variant" && change.variantId === selection2.variantId && change.quantity === selection2.quantity && (shipping === void 0 || shipping.type === "add_shipping_line");
|
|
2878
|
+
return consent === true && changeset.changes.length === 1 && change.type === "add_subscription" && change.sellingPlanId === selection2.sellingPlanId && change.variantId === selection2.variantId && change.quantity === selection2.quantity;
|
|
2879
|
+
}, "Selection, change and buyer consent must agree");
|
|
2880
|
+
var PurchaseRequestSchema = DecideRequestSchema.extend({
|
|
2881
|
+
expected: PurchaseExpectedSchema,
|
|
2882
|
+
requestId: import_zod24.z.uuid()
|
|
2883
|
+
}).strict();
|
|
2884
|
+
var PurchaseReceiptSchema = import_zod24.z.object({
|
|
2885
|
+
admittedAt: PostPurchaseTimestampSchema,
|
|
2886
|
+
changesetToken: import_zod24.z.string().min(1),
|
|
2887
|
+
operationId: import_zod24.z.uuid(),
|
|
2888
|
+
requiresSubscriptionConsent: import_zod24.z.boolean(),
|
|
2889
|
+
selection: PreparedPostPurchaseProduct.shape.selection
|
|
2890
|
+
}).refine(
|
|
2891
|
+
({ requiresSubscriptionConsent, selection: selection2 }) => requiresSubscriptionConsent === (selection2.sellingPlanId !== void 0),
|
|
2892
|
+
"Receipt consent must match its selected plan"
|
|
2893
|
+
);
|
|
2894
|
+
var PurchaseResponseSchema = import_zod24.z.object({ data: PurchaseReceiptSchema, successful: import_zod24.z.literal(true) });
|
|
2895
|
+
|
|
2896
|
+
// src/schema/postPurchaseAcceptedEvent.ts
|
|
2897
|
+
var EventCalculationSchema = PostPurchaseProductCosts.pick({ currencyCode: true, totalMinor: true }).strict();
|
|
2898
|
+
var AcceptedEventOutcomeSchema = import_zod25.z.enum(["acknowledged", "rejected", "skipped", "unknown"]);
|
|
2899
|
+
var AttemptProgressSchema = import_zod25.z.strictObject({
|
|
2900
|
+
attemptedAt: PostPurchaseTimestampSchema,
|
|
2901
|
+
reportedCalculation: EventCalculationSchema,
|
|
2902
|
+
status: import_zod25.z.literal("attempted")
|
|
2903
|
+
});
|
|
2904
|
+
var AcceptedEventAttemptProgressSchema = AttemptProgressSchema.extend({
|
|
2905
|
+
operationId: PurchaseReceiptSchema.shape.operationId
|
|
2906
|
+
});
|
|
2907
|
+
var AcceptedEventResultProgressSchema = AttemptProgressSchema.extend({
|
|
2908
|
+
finishedAt: PostPurchaseTimestampSchema,
|
|
2909
|
+
status: AcceptedEventOutcomeSchema
|
|
2910
|
+
}).extend({ operationId: PurchaseReceiptSchema.shape.operationId });
|
|
2911
|
+
var AcceptedEventRequestSchema = DecideRequestSchema.extend({
|
|
2912
|
+
operationId: PurchaseReceiptSchema.shape.operationId,
|
|
2913
|
+
reportedCalculation: EventCalculationSchema
|
|
2914
|
+
}).strict();
|
|
2915
|
+
var AcceptedEventResponseSchema = import_zod25.z.object({
|
|
2916
|
+
data: import_zod25.z.union([AcceptedEventAttemptProgressSchema, AcceptedEventResultProgressSchema]),
|
|
2917
|
+
successful: import_zod25.z.literal(true)
|
|
2918
|
+
});
|
|
2765
2919
|
|
|
2766
|
-
// src/schema/
|
|
2920
|
+
// src/schema/postPurchaseAcceptedMetafield.ts
|
|
2767
2921
|
var import_zod26 = require("zod");
|
|
2922
|
+
var AcceptedMetafieldOutcomeSchema = import_zod26.z.enum(["acknowledged", "rejected", "unknown"]);
|
|
2923
|
+
var AcceptedMetafieldRequestSchema = DecideRequestSchema.extend({
|
|
2924
|
+
operationId: PurchaseReceiptSchema.shape.operationId
|
|
2925
|
+
}).strict();
|
|
2926
|
+
var AcceptedMetafieldResultSchema = import_zod26.z.strictObject({
|
|
2927
|
+
operationId: PurchaseReceiptSchema.shape.operationId,
|
|
2928
|
+
status: import_zod26.z.union([AcceptedMetafieldOutcomeSchema, import_zod26.z.enum(["attempted", "unavailable"])])
|
|
2929
|
+
});
|
|
2930
|
+
var AcceptedMetafieldResponseSchema = import_zod26.z.strictObject({
|
|
2931
|
+
data: AcceptedMetafieldResultSchema,
|
|
2932
|
+
successful: import_zod26.z.literal(true)
|
|
2933
|
+
});
|
|
2934
|
+
|
|
2935
|
+
// src/schema/postPurchaseAnalytics.ts
|
|
2936
|
+
var import_zod27 = require("zod");
|
|
2937
|
+
var PurchaseAnalyticsRequestSchema = AcceptedEventRequestSchema;
|
|
2938
|
+
var PurchaseAnalyticsStatusSchema = import_zod27.z.enum(["http-acknowledged", "unavailable"]);
|
|
2939
|
+
var PurchaseAnalyticsResponseSchema = import_zod27.z.object({
|
|
2940
|
+
data: import_zod27.z.object({ operationId: PurchaseReceiptSchema.shape.operationId, status: PurchaseAnalyticsStatusSchema }),
|
|
2941
|
+
successful: import_zod27.z.literal(true)
|
|
2942
|
+
});
|
|
2943
|
+
|
|
2944
|
+
// src/schema/postPurchaseChoice.ts
|
|
2945
|
+
var import_zod29 = require("zod");
|
|
2946
|
+
|
|
2947
|
+
// src/schema/postPurchasePlanCatalog.ts
|
|
2948
|
+
var import_zod28 = require("zod");
|
|
2949
|
+
var PostPurchasePlanOption = import_zod28.z.object({
|
|
2950
|
+
adjustment: PostPurchasePlanAdjustment.optional(),
|
|
2951
|
+
id: import_zod28.z.number().int().positive(),
|
|
2952
|
+
intervalFrequency: import_zod28.z.string().regex(/^[1-9]\d*$/).optional(),
|
|
2953
|
+
intervalLabel: import_zod28.z.string().min(1),
|
|
2954
|
+
name: import_zod28.z.string().min(1)
|
|
2955
|
+
});
|
|
2956
|
+
var PostPurchasePlanCatalog = import_zod28.z.object({
|
|
2957
|
+
plans: import_zod28.z.array(PostPurchasePlanOption),
|
|
2958
|
+
productId: import_zod28.z.number().int().positive(),
|
|
2959
|
+
requiresSellingPlan: import_zod28.z.boolean(),
|
|
2960
|
+
variantId: import_zod28.z.number().int().positive()
|
|
2961
|
+
});
|
|
2962
|
+
|
|
2963
|
+
// src/schema/postPurchaseChoice.ts
|
|
2964
|
+
var PostPurchaseChoice = import_zod29.z.discriminatedUnion("mode", [
|
|
2965
|
+
import_zod29.z.object({ mode: import_zod29.z.literal("one-time") }).strict(),
|
|
2966
|
+
import_zod29.z.object({ mode: import_zod29.z.literal("subscription"), sellingPlanId: PostPurchasePlanOption.shape.id }).strict()
|
|
2967
|
+
]);
|
|
2968
|
+
var PostPurchaseOptions = import_zod29.z.object({
|
|
2969
|
+
defaultChoice: PostPurchaseChoice,
|
|
2970
|
+
modes: import_zod29.z.array(import_zod29.z.enum(["one-time", "subscription"])).min(1).max(2),
|
|
2971
|
+
selector: PostPurchaseSettings.shape.productTypeSelector
|
|
2972
|
+
});
|
|
2973
|
+
|
|
2974
|
+
// src/schema/postPurchaseClassification.ts
|
|
2975
|
+
var import_zod30 = require("zod");
|
|
2976
|
+
var ClassificationAttemptProgressSchema = import_zod30.z.strictObject({
|
|
2977
|
+
attemptedAt: PostPurchaseTimestampSchema,
|
|
2978
|
+
operationId: PurchaseReceiptSchema.shape.operationId,
|
|
2979
|
+
status: import_zod30.z.literal("attempted")
|
|
2980
|
+
});
|
|
2981
|
+
var ClassificationResultProgressSchema = ClassificationAttemptProgressSchema.extend({
|
|
2982
|
+
finishedAt: PostPurchaseTimestampSchema,
|
|
2983
|
+
status: AcceptedEventOutcomeSchema
|
|
2984
|
+
});
|
|
2985
|
+
var ClassificationProgressSchema = import_zod30.z.union([
|
|
2986
|
+
ClassificationAttemptProgressSchema,
|
|
2987
|
+
ClassificationResultProgressSchema,
|
|
2988
|
+
import_zod30.z.strictObject({ status: import_zod30.z.literal("unavailable") })
|
|
2989
|
+
]).nullable();
|
|
2990
|
+
|
|
2991
|
+
// src/schema/postPurchaseDecline.ts
|
|
2992
|
+
var import_zod34 = require("zod");
|
|
2993
|
+
|
|
2994
|
+
// src/schema/postPurchaseProgress.ts
|
|
2995
|
+
var import_zod32 = require("zod");
|
|
2996
|
+
|
|
2997
|
+
// src/schema/postPurchaseDeclineDelivery.ts
|
|
2998
|
+
var import_zod31 = require("zod");
|
|
2999
|
+
var AttemptSchema = import_zod31.z.strictObject({
|
|
3000
|
+
attemptedAt: PostPurchaseTimestampSchema,
|
|
3001
|
+
status: import_zod31.z.enum(["attempted", "unavailable"])
|
|
3002
|
+
});
|
|
3003
|
+
var DeclineDeliveryProgressSchema = import_zod31.z.union([
|
|
3004
|
+
AttemptSchema,
|
|
3005
|
+
AttemptSchema.extend({
|
|
3006
|
+
finishedAt: PostPurchaseTimestampSchema,
|
|
3007
|
+
status: AcceptedEventOutcomeSchema
|
|
3008
|
+
})
|
|
3009
|
+
]);
|
|
3010
|
+
|
|
3011
|
+
// src/schema/postPurchaseProgress.ts
|
|
3012
|
+
var PostPurchaseProgressSchema = import_zod32.z.object({
|
|
3013
|
+
closedAt: PostPurchaseTimestampSchema.nullable(),
|
|
3014
|
+
deadline: PostPurchaseTimestampSchema,
|
|
3015
|
+
entry: DecisionEntrySchema,
|
|
3016
|
+
entryRevision: import_zod32.z.number().int().nonnegative(),
|
|
3017
|
+
members: import_zod32.z.array(
|
|
3018
|
+
PostPurchaseMemberIdentity.extend({
|
|
3019
|
+
declineDelivery: DeclineDeliveryProgressSchema.optional(),
|
|
3020
|
+
status: import_zod32.z.enum(["unhandled", "accepted", "declined"])
|
|
3021
|
+
}).strict()
|
|
3022
|
+
),
|
|
3023
|
+
revision: import_zod32.z.number().int().nonnegative()
|
|
3024
|
+
}).strict();
|
|
2768
3025
|
|
|
2769
3026
|
// src/schema/postPurchaseVariantCatalog.ts
|
|
2770
|
-
var
|
|
2771
|
-
var PostPurchaseVariantSelector =
|
|
3027
|
+
var import_zod33 = require("zod");
|
|
3028
|
+
var PostPurchaseVariantSelector = import_zod33.z.object({ variantId: PostPurchaseVariantId }).strict();
|
|
2772
3029
|
var PostPurchaseVariantOption = OfferProduct.shape.options.element.extend({
|
|
2773
|
-
id:
|
|
2774
|
-
position:
|
|
3030
|
+
id: import_zod33.z.number().int().positive(),
|
|
3031
|
+
position: import_zod33.z.number().int().min(1).max(3)
|
|
2775
3032
|
});
|
|
2776
3033
|
var PostPurchaseVariantValues = OfferProduct.shape.variants.element.pick({
|
|
2777
3034
|
option1: true,
|
|
2778
3035
|
option2: true,
|
|
2779
3036
|
option3: true
|
|
2780
3037
|
});
|
|
2781
|
-
var PostPurchaseVariantCatalog =
|
|
3038
|
+
var PostPurchaseVariantCatalog = import_zod33.z.object({
|
|
2782
3039
|
displayMode: PostPurchaseSettings.shape.productOptions.shape.variantSelectorDisplayMode,
|
|
2783
|
-
options:
|
|
3040
|
+
options: import_zod33.z.array(PostPurchaseVariantOption),
|
|
2784
3041
|
productId: PostPurchaseProductId,
|
|
2785
3042
|
showSelectors: PostPurchaseSettings.shape.productOptions.shape.showVariantSelectors,
|
|
2786
|
-
variants:
|
|
3043
|
+
variants: import_zod33.z.array(
|
|
2787
3044
|
PostPurchaseVariantValues.partial().extend({
|
|
2788
|
-
available:
|
|
3045
|
+
available: import_zod33.z.boolean(),
|
|
2789
3046
|
id: PostPurchaseVariantId,
|
|
2790
|
-
imageId:
|
|
3047
|
+
imageId: import_zod33.z.number().int().nonnegative().nullish(),
|
|
2791
3048
|
title: OfferProduct.shape.variants.element.shape.title
|
|
2792
3049
|
})
|
|
2793
3050
|
)
|
|
2794
3051
|
});
|
|
2795
3052
|
|
|
3053
|
+
// src/schema/postPurchaseDecline.ts
|
|
3054
|
+
var OfferDeclineRequestSchema = DecideRequestSchema.extend({
|
|
3055
|
+
entryRevision: PostPurchaseProgressSchema.shape.entryRevision,
|
|
3056
|
+
productId: PostPurchaseProgressSchema.shape.members.element.shape.productId,
|
|
3057
|
+
progressRevision: PostPurchaseProgressSchema.shape.revision,
|
|
3058
|
+
selectedProductId: PostPurchaseProgressSchema.shape.members.element.shape.productId.optional(),
|
|
3059
|
+
variant: PostPurchaseVariantSelector.optional()
|
|
3060
|
+
}).strict().refine(
|
|
3061
|
+
({ selectedProductId, variant: variant2 }) => selectedProductId === void 0 || !!variant2,
|
|
3062
|
+
"Selected merchandise requires a variant"
|
|
3063
|
+
);
|
|
3064
|
+
var RecordedOfferDeclineSchema = PostPurchaseProgressSchema.shape.members.element.omit({ declineDelivery: true, status: true }).extend({ entry: DecisionEntrySchema.strict(), entryRevision: PostPurchaseProgressSchema.shape.entryRevision }).strict();
|
|
3065
|
+
var OfferDeclineResponseSchema = import_zod34.z.object({
|
|
3066
|
+
data: import_zod34.z.object({ decline: RecordedOfferDeclineSchema, progress: PostPurchaseProgressSchema }),
|
|
3067
|
+
successful: import_zod34.z.literal(true)
|
|
3068
|
+
});
|
|
3069
|
+
|
|
3070
|
+
// src/schema/postPurchaseEligibility.ts
|
|
3071
|
+
var import_zod35 = require("zod");
|
|
3072
|
+
var PostPurchaseSkipReasonSchema = import_zod35.z.enum(["empty", "no-eligible-subscription"]);
|
|
3073
|
+
|
|
3074
|
+
// src/schema/postPurchaseExitPolicy.ts
|
|
3075
|
+
var import_zod36 = require("zod");
|
|
3076
|
+
var EXIT_DELAY_MAX_MS = 60 * 60 * 1e3;
|
|
3077
|
+
var ExitPolicySchema = import_zod36.z.discriminatedUnion("status", [
|
|
3078
|
+
import_zod36.z.strictObject({ status: import_zod36.z.literal("unavailable") }),
|
|
3079
|
+
import_zod36.z.strictObject({
|
|
3080
|
+
delayMs: import_zod36.z.number().int().nonnegative().max(EXIT_DELAY_MAX_MS),
|
|
3081
|
+
source: import_zod36.z.enum(["admitted", "selected-flow"]),
|
|
3082
|
+
status: import_zod36.z.literal("available")
|
|
3083
|
+
})
|
|
3084
|
+
]);
|
|
3085
|
+
|
|
3086
|
+
// src/schema/postPurchaseFinish.ts
|
|
3087
|
+
var import_zod41 = require("zod");
|
|
3088
|
+
|
|
3089
|
+
// src/schema/postPurchaseFollowups.ts
|
|
3090
|
+
var import_zod39 = require("zod");
|
|
3091
|
+
|
|
3092
|
+
// src/schema/postPurchaseHealthProgress.ts
|
|
3093
|
+
var import_zod37 = require("zod");
|
|
3094
|
+
var HealthScheduleSchema = import_zod37.z.strictObject({
|
|
3095
|
+
checkoutToken: DecideRequestSchema.shape.checkoutToken,
|
|
3096
|
+
healthScheduledAt: PostPurchaseTimestampSchema,
|
|
3097
|
+
operationId: PurchaseReceiptSchema.shape.operationId,
|
|
3098
|
+
orderId: PostPurchaseOrderIdSchema,
|
|
3099
|
+
removePartialOrder: import_zod37.z.boolean(),
|
|
3100
|
+
sessionId: import_zod37.z.string().regex(/^[a-f0-9]{64}$/),
|
|
3101
|
+
shop: DecideRequestSchema.shape.shop
|
|
3102
|
+
});
|
|
3103
|
+
var HealthSchedulingResponseSchema = import_zod37.z.object({
|
|
3104
|
+
data: import_zod37.z.object({
|
|
3105
|
+
callbackStatus: import_zod37.z.enum(["pending", "attempted", "returned", "unknown"]),
|
|
3106
|
+
facts: HealthScheduleSchema,
|
|
3107
|
+
scheduling: import_zod37.z.union([
|
|
3108
|
+
import_zod37.z.strictObject({ recordedAt: PostPurchaseTimestampSchema, status: import_zod37.z.literal("verified") }),
|
|
3109
|
+
import_zod37.z.strictObject({ status: import_zod37.z.enum(["unavailable", "unverified"]) })
|
|
3110
|
+
])
|
|
3111
|
+
}),
|
|
3112
|
+
successful: import_zod37.z.literal(true)
|
|
3113
|
+
});
|
|
3114
|
+
|
|
3115
|
+
// src/schema/postPurchaseObservation.ts
|
|
3116
|
+
var import_zod38 = require("zod");
|
|
3117
|
+
var PurchaseObservationSchema = import_zod38.z.union([
|
|
3118
|
+
import_zod38.z.object({
|
|
3119
|
+
changesetApplicationsRemaining: import_zod38.z.number().int().nonnegative(),
|
|
3120
|
+
errors: import_zod38.z.array(
|
|
3121
|
+
import_zod38.z.object({
|
|
3122
|
+
code: import_zod38.z.enum([
|
|
3123
|
+
"payment_required",
|
|
3124
|
+
"insufficient_inventory",
|
|
3125
|
+
"changeset_already_applied",
|
|
3126
|
+
"unsupported_payment_method",
|
|
3127
|
+
"invalid_request",
|
|
3128
|
+
"server_error",
|
|
3129
|
+
"buyer_consent_required",
|
|
3130
|
+
"subscription_vaulting_error",
|
|
3131
|
+
"subscription_contract_creation_error",
|
|
3132
|
+
"subscription_no_shipping_address_error",
|
|
3133
|
+
"subscription_limit_error",
|
|
3134
|
+
"order_released_error"
|
|
3135
|
+
]),
|
|
3136
|
+
message: import_zod38.z.string()
|
|
3137
|
+
}).strict()
|
|
3138
|
+
),
|
|
3139
|
+
status: import_zod38.z.enum(["processed", "partially_processed", "unprocessed"])
|
|
3140
|
+
}).strict(),
|
|
3141
|
+
import_zod38.z.object({ reason: import_zod38.z.literal("application-error"), status: import_zod38.z.literal("unknown") }).strict()
|
|
3142
|
+
]);
|
|
3143
|
+
var RecordedPurchaseObservationSchema = import_zod38.z.object({
|
|
3144
|
+
observation: PurchaseObservationSchema,
|
|
3145
|
+
recordedAt: PostPurchaseTimestampSchema
|
|
3146
|
+
}).strict();
|
|
3147
|
+
var PurchaseObservationRequestSchema = DecideRequestSchema.extend({
|
|
3148
|
+
observation: PurchaseObservationSchema,
|
|
3149
|
+
operationId: import_zod38.z.uuid()
|
|
3150
|
+
}).strict();
|
|
3151
|
+
var PurchaseObservationResponseSchema = import_zod38.z.object({
|
|
3152
|
+
data: RecordedPurchaseObservationSchema.extend({ operationId: import_zod38.z.uuid() }),
|
|
3153
|
+
successful: import_zod38.z.literal(true)
|
|
3154
|
+
});
|
|
3155
|
+
|
|
3156
|
+
// src/schema/postPurchaseFollowups.ts
|
|
3157
|
+
var RequiredHealthSchema = import_zod39.z.union([
|
|
3158
|
+
HealthSchedulingResponseSchema.shape.data,
|
|
3159
|
+
import_zod39.z.strictObject({ status: import_zod39.z.literal("unavailable") })
|
|
3160
|
+
]);
|
|
3161
|
+
var AcceptedFollowupsResponseSchema = import_zod39.z.object({
|
|
3162
|
+
data: import_zod39.z.object({
|
|
3163
|
+
acceptedEvent: import_zod39.z.union([
|
|
3164
|
+
AcceptedEventResponseSchema.shape.data,
|
|
3165
|
+
import_zod39.z.strictObject({ status: import_zod39.z.literal("unavailable") })
|
|
3166
|
+
]),
|
|
3167
|
+
acceptedMetafield: AcceptedMetafieldResultSchema,
|
|
3168
|
+
health: RequiredHealthSchema,
|
|
3169
|
+
purchase: PurchaseObservationResponseSchema.shape.data
|
|
3170
|
+
}),
|
|
3171
|
+
successful: import_zod39.z.literal(true)
|
|
3172
|
+
});
|
|
3173
|
+
|
|
3174
|
+
// src/schema/postPurchaseSessionClose.ts
|
|
3175
|
+
var import_zod40 = require("zod");
|
|
3176
|
+
var SessionClosureSchema = import_zod40.z.object({ closedAt: PostPurchaseTimestampSchema, status: import_zod40.z.literal("closed") });
|
|
3177
|
+
var SessionCloseRequestSchema = DecideRequestSchema.strict();
|
|
3178
|
+
var SessionCloseResponseSchema = import_zod40.z.object({ data: SessionClosureSchema, successful: import_zod40.z.literal(true) });
|
|
3179
|
+
|
|
3180
|
+
// src/schema/postPurchaseFinish.ts
|
|
3181
|
+
var FinishedPurchaseSchema = import_zod41.z.union([
|
|
3182
|
+
import_zod41.z.strictObject({ status: import_zod41.z.literal("none") }),
|
|
3183
|
+
import_zod41.z.strictObject({
|
|
3184
|
+
operationId: PurchaseReceiptSchema.shape.operationId,
|
|
3185
|
+
status: import_zod41.z.union([
|
|
3186
|
+
import_zod41.z.literal("pending"),
|
|
3187
|
+
...PurchaseObservationSchema.options.map((option) => option.shape.status)
|
|
3188
|
+
])
|
|
3189
|
+
})
|
|
3190
|
+
]);
|
|
3191
|
+
var SessionFinishRequestSchema = DecideRequestSchema.strict();
|
|
3192
|
+
var SessionFinishResponseSchema = import_zod41.z.object({
|
|
3193
|
+
data: SessionClosureSchema.extend({
|
|
3194
|
+
classification: ClassificationProgressSchema,
|
|
3195
|
+
exitPolicy: ExitPolicySchema,
|
|
3196
|
+
health: RequiredHealthSchema.nullable(),
|
|
3197
|
+
purchase: FinishedPurchaseSchema
|
|
3198
|
+
}),
|
|
3199
|
+
successful: import_zod41.z.literal(true)
|
|
3200
|
+
});
|
|
3201
|
+
|
|
3202
|
+
// src/schema/postPurchaseQuantity.ts
|
|
3203
|
+
var import_zod64 = require("zod");
|
|
3204
|
+
|
|
3205
|
+
// src/schema/postPurchaseProductCollectionView.ts
|
|
3206
|
+
var import_zod63 = require("zod");
|
|
3207
|
+
|
|
3208
|
+
// src/schema/postPurchaseProductView.ts
|
|
3209
|
+
var import_zod62 = require("zod");
|
|
3210
|
+
|
|
2796
3211
|
// src/schema/postPurchaseGroupCatalog.ts
|
|
3212
|
+
var import_zod42 = require("zod");
|
|
2797
3213
|
var productId = PreparedPostPurchaseProduct.shape.selection.shape.productId;
|
|
2798
3214
|
var source = PostPurchaseProductSource.shape.data.element;
|
|
2799
3215
|
var PostPurchaseGroupDescription = source.pick({ description: true, id: true, image: true, images: true, title: true }).extend({
|
|
@@ -2801,17 +3217,17 @@ var PostPurchaseGroupDescription = source.pick({ description: true, id: true, im
|
|
|
2801
3217
|
image: source.shape.image.default(null),
|
|
2802
3218
|
options: PostPurchaseVariantCatalog.shape.options.default([])
|
|
2803
3219
|
});
|
|
2804
|
-
var PostPurchaseGroupCatalog =
|
|
3220
|
+
var PostPurchaseGroupCatalog = import_zod42.z.object({
|
|
2805
3221
|
memberProductId: productId,
|
|
2806
|
-
options:
|
|
3222
|
+
options: import_zod42.z.array(import_zod42.z.object({ productId, title: import_zod42.z.string(), variantCatalog: PostPurchaseVariantCatalog }))
|
|
2807
3223
|
});
|
|
2808
|
-
var PostPurchaseGroupSelection =
|
|
3224
|
+
var PostPurchaseGroupSelection = import_zod42.z.object({
|
|
2809
3225
|
memberProductId: productId,
|
|
2810
3226
|
productId
|
|
2811
3227
|
});
|
|
2812
3228
|
|
|
2813
3229
|
// src/schema/widgets/checkout-and-beyond/root.ts
|
|
2814
|
-
var
|
|
3230
|
+
var import_zod61 = require("zod");
|
|
2815
3231
|
|
|
2816
3232
|
// src/schema/widgets/checkout-and-beyond/constants.ts
|
|
2817
3233
|
var import_es_toolkit3 = require("es-toolkit");
|
|
@@ -2866,18 +3282,18 @@ var targetAreas = {
|
|
|
2866
3282
|
|
|
2867
3283
|
// src/schema/widgets/checkout-and-beyond/layout.ts
|
|
2868
3284
|
var import_uuid15 = require("uuid");
|
|
2869
|
-
var
|
|
3285
|
+
var import_zod60 = require("zod");
|
|
2870
3286
|
|
|
2871
3287
|
// src/schema/widgets/checkout-and-beyond/shared.ts
|
|
2872
|
-
var
|
|
3288
|
+
var import_zod59 = require("zod");
|
|
2873
3289
|
|
|
2874
3290
|
// src/schema/widgets/checkout-and-beyond/banner.ts
|
|
2875
|
-
var
|
|
2876
|
-
var CABBannerSection =
|
|
3291
|
+
var import_zod43 = require("zod");
|
|
3292
|
+
var CABBannerSection = import_zod43.z.lazy(
|
|
2877
3293
|
() => CABLayoutSection.omit({ sectionType: true }).extend({
|
|
2878
|
-
buttonField:
|
|
2879
|
-
color:
|
|
2880
|
-
dismissible:
|
|
3294
|
+
buttonField: import_zod43.z.enum(buttonFields).optional(),
|
|
3295
|
+
color: import_zod43.z.enum(bannerColors).default("info"),
|
|
3296
|
+
dismissible: import_zod43.z.boolean().default(true),
|
|
2881
3297
|
/**
|
|
2882
3298
|
* The `s-banner` heading — localized content (a buyer can see a merchant-composed banner). Absent OR
|
|
2883
3299
|
* blank ⇒ no heading; the renderer emits no heading slot for `''` rather than an empty one.
|
|
@@ -2893,18 +3309,18 @@ var CABBannerSection = import_zod27.z.lazy(
|
|
|
2893
3309
|
* not a 500. Nothing emits `heading` yet; the first converter that maps merchant banner copy into it
|
|
2894
3310
|
* either strips first or teaches `normalizeTextContent` to strip this field.
|
|
2895
3311
|
*/
|
|
2896
|
-
heading:
|
|
2897
|
-
sectionType:
|
|
3312
|
+
heading: import_zod43.z.record(import_zod43.z.string(), import_zod43.z.string().refine(checkForHTML, NO_HTML)).optional(),
|
|
3313
|
+
sectionType: import_zod43.z.literal(SectionType.banner).default(SectionType.banner)
|
|
2898
3314
|
})
|
|
2899
3315
|
);
|
|
2900
3316
|
|
|
2901
3317
|
// src/schema/widgets/checkout-and-beyond/button.ts
|
|
2902
3318
|
var import_uuid5 = require("uuid");
|
|
2903
|
-
var
|
|
3319
|
+
var import_zod45 = require("zod");
|
|
2904
3320
|
|
|
2905
3321
|
// src/schema/widgets/checkout-and-beyond/image.ts
|
|
2906
3322
|
var import_uuid4 = require("uuid");
|
|
2907
|
-
var
|
|
3323
|
+
var import_zod44 = require("zod");
|
|
2908
3324
|
|
|
2909
3325
|
// src/schema/widgets/checkout-and-beyond/icons.ts
|
|
2910
3326
|
var iconNames = [
|
|
@@ -2991,17 +3407,17 @@ var iconTones = ["auto", "critical", "custom", "info", "neutral", "success", "wa
|
|
|
2991
3407
|
var IconTone = freezeEnum(iconTones);
|
|
2992
3408
|
|
|
2993
3409
|
// src/schema/widgets/checkout-and-beyond/image.ts
|
|
2994
|
-
var CABImageSectionFields =
|
|
3410
|
+
var CABImageSectionFields = import_zod44.z.object({
|
|
2995
3411
|
...CABVariableFields,
|
|
2996
|
-
altText:
|
|
3412
|
+
altText: import_zod44.z.string().refine(checkForHTML, NO_HTML).default(""),
|
|
2997
3413
|
/**
|
|
2998
3414
|
* Image width÷height (e.g. `46` for the progress-bar fill); `null` renders at natural size. Any POSITIVE
|
|
2999
3415
|
* ratio — never limited to 1, but never `0`/negative either: a renderer dividing by it would get `Infinity`,
|
|
3000
3416
|
* and CSS `aspect-ratio` drops a negative value and silently reverts to natural size.
|
|
3001
3417
|
*/
|
|
3002
|
-
aspectRatio:
|
|
3003
|
-
border:
|
|
3004
|
-
buttonField:
|
|
3418
|
+
aspectRatio: import_zod44.z.number().positive().nullable().default(null),
|
|
3419
|
+
border: import_zod44.z.lazy(() => CABBorder),
|
|
3420
|
+
buttonField: import_zod44.z.enum(buttonFields).optional(),
|
|
3005
3421
|
/**
|
|
3006
3422
|
* `icon` renders `source` as a single `s-icon` by name (the uber-image path covers icons too), reading
|
|
3007
3423
|
* `iconSize`/`iconTone`. The other values are a harmless informational holdover from the previous
|
|
@@ -3020,29 +3436,29 @@ var CABImageSectionFields = import_zod28.z.object({
|
|
|
3020
3436
|
* behavior degraded gracefully and told us about it. The client-assembled half of the invariant was never
|
|
3021
3437
|
* the risky half.
|
|
3022
3438
|
*/
|
|
3023
|
-
category:
|
|
3439
|
+
category: import_zod44.z.enum(["gallery", "icon", "icons", "payment-methods", "secure-checkout"]).nullable().default(null),
|
|
3024
3440
|
/** `icon`-mode only: the `s-icon` `size`; `null` ⇒ the component default (`base`). Ignored by image treatments. */
|
|
3025
|
-
iconSize:
|
|
3441
|
+
iconSize: import_zod44.z.enum(iconSizes).nullable().default(null),
|
|
3026
3442
|
/** `icon`-mode only: the `s-icon` `tone`; `null` ⇒ the component default (`auto`). Ignored by image treatments. */
|
|
3027
|
-
iconTone:
|
|
3028
|
-
name:
|
|
3029
|
-
naturalHeight:
|
|
3030
|
-
naturalWidth:
|
|
3443
|
+
iconTone: import_zod44.z.enum(iconTones).nullable().default(null),
|
|
3444
|
+
name: import_zod44.z.string().optional(),
|
|
3445
|
+
naturalHeight: import_zod44.z.number().default(0),
|
|
3446
|
+
naturalWidth: import_zod44.z.number().default(0),
|
|
3031
3447
|
/**
|
|
3032
3448
|
* `contain` (the component default): dimensionless images render in s-image's 1/1 default frame, and
|
|
3033
3449
|
* `cover` would crop non-square art (payment badges lost their edges — 15993); `contain` letterboxes.
|
|
3034
3450
|
*/
|
|
3035
|
-
objectFit:
|
|
3036
|
-
sectionId:
|
|
3037
|
-
sectionType:
|
|
3451
|
+
objectFit: import_zod44.z.enum(objectFits).default(ObjectFit.contain),
|
|
3452
|
+
sectionId: import_zod44.z.uuid().default(() => (0, import_uuid4.v7)()),
|
|
3453
|
+
sectionType: import_zod44.z.literal(SectionType.image).default(SectionType.image),
|
|
3038
3454
|
/**
|
|
3039
3455
|
* An image URL or dynamic token, an empty default, or — when `category: 'icon'` — an icon NAME. Icon mode
|
|
3040
3456
|
* takes a name or `''` only, NOT a token: no renderer resolves a token to an icon today, so accepting one
|
|
3041
3457
|
* would promise a capability that doesn't exist. Widen the refine's carve-out to `DYNAMIC_TOKEN_REGEX` when a
|
|
3042
3458
|
* server-chosen tier icon actually needs it.
|
|
3043
3459
|
*/
|
|
3044
|
-
source:
|
|
3045
|
-
width:
|
|
3460
|
+
source: import_zod44.z.union([import_zod44.z.url(), import_zod44.z.literal(""), import_zod44.z.string().regex(DYNAMIC_TOKEN_REGEX), import_zod44.z.enum(iconNames)]).default(""),
|
|
3461
|
+
width: import_zod44.z.number().default(100)
|
|
3046
3462
|
});
|
|
3047
3463
|
var iconNameSet = new Set(iconNames);
|
|
3048
3464
|
var isIconName = (source2) => iconNameSet.has(source2);
|
|
@@ -3062,35 +3478,35 @@ var CABImageSection = CABImageSectionFields.superRefine(({ category, source: sou
|
|
|
3062
3478
|
});
|
|
3063
3479
|
|
|
3064
3480
|
// src/schema/widgets/checkout-and-beyond/button.ts
|
|
3065
|
-
var CABButtonContent =
|
|
3066
|
-
() =>
|
|
3481
|
+
var CABButtonContent = import_zod45.z.lazy(
|
|
3482
|
+
() => import_zod45.z.discriminatedUnion("sectionType", [CABImageSection, CABLayoutSection, CABTextSection])
|
|
3067
3483
|
);
|
|
3068
|
-
var CABButtonSection =
|
|
3484
|
+
var CABButtonSection = import_zod45.z.object({
|
|
3069
3485
|
...CABVariableFields,
|
|
3070
|
-
action:
|
|
3071
|
-
buttonStyle:
|
|
3072
|
-
custom:
|
|
3073
|
-
color:
|
|
3074
|
-
height:
|
|
3075
|
-
width:
|
|
3486
|
+
action: import_zod45.z.union([import_zod45.z.literal(""), import_zod45.z.enum(buttonActions)]).default(""),
|
|
3487
|
+
buttonStyle: import_zod45.z.enum(buttonStyles).default(ButtonStyle.primary),
|
|
3488
|
+
custom: import_zod45.z.object({
|
|
3489
|
+
color: import_zod45.z.string().regex(HEX_COLOR_REGEX).default("#005bd3"),
|
|
3490
|
+
height: import_zod45.z.number().default(52),
|
|
3491
|
+
width: import_zod45.z.number().default(300)
|
|
3076
3492
|
}).default({
|
|
3077
3493
|
color: "#005bd3",
|
|
3078
3494
|
height: 52,
|
|
3079
3495
|
width: 300
|
|
3080
3496
|
}),
|
|
3081
|
-
disableDowngrade:
|
|
3082
|
-
name:
|
|
3083
|
-
optionId:
|
|
3084
|
-
popover:
|
|
3085
|
-
alignment:
|
|
3086
|
-
position:
|
|
3497
|
+
disableDowngrade: import_zod45.z.boolean().default(false),
|
|
3498
|
+
name: import_zod45.z.string().optional(),
|
|
3499
|
+
optionId: import_zod45.z.number().optional(),
|
|
3500
|
+
popover: import_zod45.z.object({
|
|
3501
|
+
alignment: import_zod45.z.enum(textAlignments).default(TextAlignment.center),
|
|
3502
|
+
position: import_zod45.z.enum(popoverPositions).default(PopoverPosition.blockStart)
|
|
3087
3503
|
}).optional().default(() => ({
|
|
3088
3504
|
alignment: TextAlignment.center,
|
|
3089
3505
|
position: PopoverPosition.blockStart
|
|
3090
3506
|
})),
|
|
3091
|
-
sectionId:
|
|
3092
|
-
sections:
|
|
3093
|
-
sectionType:
|
|
3507
|
+
sectionId: import_zod45.z.uuid().default(() => (0, import_uuid5.v7)()),
|
|
3508
|
+
sections: import_zod45.z.union([import_zod45.z.array(CABButtonContent), import_zod45.z.strictObject({}).transform(() => [])]).default(() => []),
|
|
3509
|
+
sectionType: import_zod45.z.literal(SectionType.button).default(SectionType.button),
|
|
3094
3510
|
/**
|
|
3095
3511
|
* The smart-cart tier this button acts on (`addGift`/`removeGift`): scopes the click to one tier's gift. The
|
|
3096
3512
|
* client resolves the tier's gift (productId) from the progress-bar context by this `tierId` — the button node
|
|
@@ -3105,91 +3521,91 @@ var CABButtonSection = import_zod29.z.object({
|
|
|
3105
3521
|
* lookup finds no tier and the click resolves to nothing. Safe to bound — the field is new, so there are no
|
|
3106
3522
|
* stored payloads to grandfather, and the producer is client code, not a merchant form.
|
|
3107
3523
|
*/
|
|
3108
|
-
tier:
|
|
3524
|
+
tier: import_zod45.z.object({ tierId: import_zod45.z.string().min(1) }).optional(),
|
|
3109
3525
|
/** Fire-and-forget pixel POSTed when the button is clicked (e.g. a Monetize decline). */
|
|
3110
|
-
trackingUrl:
|
|
3526
|
+
trackingUrl: import_zod45.z.string().optional(),
|
|
3111
3527
|
/**
|
|
3112
3528
|
* Secondary effects applied to in-scope variables on click, alongside (never instead of) the primary
|
|
3113
3529
|
* `action` — an `addToOrder` button can also flip a variable. Applied in array order.
|
|
3114
3530
|
*/
|
|
3115
|
-
variableEffects:
|
|
3531
|
+
variableEffects: import_zod45.z.array(CABVariableEffect).optional()
|
|
3116
3532
|
});
|
|
3117
3533
|
|
|
3118
3534
|
// src/schema/widgets/checkout-and-beyond/carousel.ts
|
|
3119
|
-
var
|
|
3535
|
+
var import_zod50 = require("zod");
|
|
3120
3536
|
|
|
3121
3537
|
// src/schema/widgets/checkout-and-beyond/offers.ts
|
|
3122
|
-
var
|
|
3538
|
+
var import_zod49 = require("zod");
|
|
3123
3539
|
|
|
3124
3540
|
// src/schema/widgets/checkout-and-beyond/dataSource.ts
|
|
3125
3541
|
var import_uuid6 = require("uuid");
|
|
3126
|
-
var
|
|
3127
|
-
var CABDiscount =
|
|
3128
|
-
amount:
|
|
3129
|
-
discountedBy:
|
|
3130
|
-
discountedFrom:
|
|
3131
|
-
type:
|
|
3132
|
-
});
|
|
3133
|
-
var CABIntegrations =
|
|
3134
|
-
judgeme:
|
|
3135
|
-
junip:
|
|
3136
|
-
klaviyo:
|
|
3137
|
-
loox:
|
|
3138
|
-
okendo:
|
|
3139
|
-
opinew:
|
|
3140
|
-
reviewsio:
|
|
3141
|
-
stamped:
|
|
3142
|
-
yotpo:
|
|
3143
|
-
});
|
|
3144
|
-
var CABDataSourceSection =
|
|
3145
|
-
dataSourceId:
|
|
3146
|
-
dataSourcePath:
|
|
3542
|
+
var import_zod46 = require("zod");
|
|
3543
|
+
var CABDiscount = import_zod46.z.object({
|
|
3544
|
+
amount: import_zod46.z.union([import_zod46.z.number(), import_zod46.z.string()]).catch(0),
|
|
3545
|
+
discountedBy: import_zod46.z.string().optional(),
|
|
3546
|
+
discountedFrom: import_zod46.z.enum(discountSources).optional().catch(void 0),
|
|
3547
|
+
type: import_zod46.z.enum(discountTypes).catch("none")
|
|
3548
|
+
});
|
|
3549
|
+
var CABIntegrations = import_zod46.z.object({
|
|
3550
|
+
judgeme: import_zod46.z.boolean().default(false),
|
|
3551
|
+
junip: import_zod46.z.boolean().default(false),
|
|
3552
|
+
klaviyo: import_zod46.z.boolean().default(false),
|
|
3553
|
+
loox: import_zod46.z.boolean().default(false),
|
|
3554
|
+
okendo: import_zod46.z.boolean().default(false),
|
|
3555
|
+
opinew: import_zod46.z.boolean().default(false),
|
|
3556
|
+
reviewsio: import_zod46.z.boolean().default(false),
|
|
3557
|
+
stamped: import_zod46.z.boolean().default(false),
|
|
3558
|
+
yotpo: import_zod46.z.boolean().default(false)
|
|
3559
|
+
});
|
|
3560
|
+
var CABDataSourceSection = import_zod46.z.object({
|
|
3561
|
+
dataSourceId: import_zod46.z.number().nullable().default(null),
|
|
3562
|
+
dataSourcePath: import_zod46.z.string().default(DEFAULT_ENDPOINTS[0].value),
|
|
3147
3563
|
discount: CABDiscount.optional(),
|
|
3148
3564
|
integrations: CABIntegrations.optional(),
|
|
3149
|
-
limit:
|
|
3150
|
-
matchVariant:
|
|
3151
|
-
matchVariantOutOfStock:
|
|
3152
|
-
name:
|
|
3153
|
-
productType:
|
|
3154
|
-
sectionId:
|
|
3155
|
-
sectionType:
|
|
3565
|
+
limit: import_zod46.z.number().default(1),
|
|
3566
|
+
matchVariant: import_zod46.z.boolean().default(false),
|
|
3567
|
+
matchVariantOutOfStock: import_zod46.z.boolean().default(false),
|
|
3568
|
+
name: import_zod46.z.string().default(DEFAULT_ENDPOINTS[0].label),
|
|
3569
|
+
productType: import_zod46.z.enum(productTypes).optional(),
|
|
3570
|
+
sectionId: import_zod46.z.uuid().default(() => (0, import_uuid6.v7)()),
|
|
3571
|
+
sectionType: import_zod46.z.literal(SectionType.dataSource).default(SectionType.dataSource),
|
|
3156
3572
|
/** Default subscribe-vs-one-time for `productType: both` (legacy `subscription_is_default`). */
|
|
3157
|
-
subscriptionIsDefault:
|
|
3158
|
-
treatAsGwp:
|
|
3573
|
+
subscriptionIsDefault: import_zod46.z.boolean().default(false),
|
|
3574
|
+
treatAsGwp: import_zod46.z.boolean().default(false)
|
|
3159
3575
|
});
|
|
3160
3576
|
|
|
3161
3577
|
// src/schema/widgets/checkout-and-beyond/products.ts
|
|
3162
3578
|
var import_uuid8 = require("uuid");
|
|
3163
|
-
var
|
|
3579
|
+
var import_zod48 = require("zod");
|
|
3164
3580
|
|
|
3165
3581
|
// src/schema/widgets/checkout-and-beyond/product.ts
|
|
3166
3582
|
var import_uuid7 = require("uuid");
|
|
3167
|
-
var
|
|
3168
|
-
var CABVariantContent =
|
|
3169
|
-
() =>
|
|
3583
|
+
var import_zod47 = require("zod");
|
|
3584
|
+
var CABVariantContent = import_zod47.z.lazy(
|
|
3585
|
+
() => import_zod47.z.discriminatedUnion("sectionType", [CABButtonSection, CABTextSection])
|
|
3170
3586
|
);
|
|
3171
|
-
var CABProductSection =
|
|
3587
|
+
var CABProductSection = import_zod47.z.object({
|
|
3172
3588
|
...CABVariableFields,
|
|
3173
|
-
name:
|
|
3174
|
-
productId:
|
|
3175
|
-
sectionId:
|
|
3176
|
-
sections:
|
|
3177
|
-
sectionType:
|
|
3178
|
-
selectors:
|
|
3179
|
-
variantMode:
|
|
3589
|
+
name: import_zod47.z.string().optional(),
|
|
3590
|
+
productId: import_zod47.z.number().nullable().default(null),
|
|
3591
|
+
sectionId: import_zod47.z.uuid().default(() => (0, import_uuid7.v7)()),
|
|
3592
|
+
sections: import_zod47.z.union([import_zod47.z.array(CABVariantContent), import_zod47.z.strictObject({}).transform(() => [])]).default(() => []),
|
|
3593
|
+
sectionType: import_zod47.z.literal(SectionType.product).default(SectionType.product),
|
|
3594
|
+
selectors: import_zod47.z.record(import_zod47.z.string(), import_zod47.z.enum(variantSelectors).default(VariantSelector.menu)).default(() => ({})),
|
|
3595
|
+
variantMode: import_zod47.z.enum(variantModes).default(VariantMode.multiple)
|
|
3180
3596
|
});
|
|
3181
3597
|
|
|
3182
3598
|
// src/schema/widgets/checkout-and-beyond/products.ts
|
|
3183
|
-
var CABProductsSection =
|
|
3599
|
+
var CABProductsSection = import_zod48.z.object({
|
|
3184
3600
|
...CABVariableFields,
|
|
3185
|
-
name:
|
|
3186
|
-
sectionId:
|
|
3187
|
-
sections:
|
|
3188
|
-
sectionType:
|
|
3601
|
+
name: import_zod48.z.string().optional(),
|
|
3602
|
+
sectionId: import_zod48.z.uuid().default(() => (0, import_uuid8.v7)()),
|
|
3603
|
+
sections: import_zod48.z.union([import_zod48.z.array(import_zod48.z.lazy(() => CABProductSection)), import_zod48.z.strictObject({}).transform(() => [])]).default(() => []),
|
|
3604
|
+
sectionType: import_zod48.z.literal(SectionType.products).default(SectionType.products)
|
|
3189
3605
|
});
|
|
3190
3606
|
|
|
3191
3607
|
// src/schema/widgets/checkout-and-beyond/offers.ts
|
|
3192
|
-
var CABOffersSection =
|
|
3608
|
+
var CABOffersSection = import_zod49.z.lazy(
|
|
3193
3609
|
() => CABLayoutSection.omit({ sections: true, sectionType: true }).extend({
|
|
3194
3610
|
/**
|
|
3195
3611
|
* A rule between consecutive cards in the vertical list — legacy checkout-offers' `<Divider />`,
|
|
@@ -3197,8 +3613,8 @@ var CABOffersSection = import_zod33.z.lazy(
|
|
|
3197
3613
|
* run of products). Optional, not defaulted: only the v1 converter sets it (REB-24265); a
|
|
3198
3614
|
* hand-built tree keeps React CAB's dividerless rendering.
|
|
3199
3615
|
*/
|
|
3200
|
-
divider:
|
|
3201
|
-
sections:
|
|
3616
|
+
divider: import_zod49.z.boolean().optional(),
|
|
3617
|
+
sections: import_zod49.z.union([import_zod49.z.array(import_zod49.z.lazy(() => CABSection)), import_zod49.z.strictObject({}).transform(() => [])]).default(() => [
|
|
3202
3618
|
CABBannerSection.parse({
|
|
3203
3619
|
buttonField: "undoAddToOrder",
|
|
3204
3620
|
color: "success",
|
|
@@ -3212,77 +3628,77 @@ var CABOffersSection = import_zod33.z.lazy(
|
|
|
3212
3628
|
CABDataSourceSection.parse({}),
|
|
3213
3629
|
CABProductsSection.parse({})
|
|
3214
3630
|
]),
|
|
3215
|
-
sectionType:
|
|
3631
|
+
sectionType: import_zod49.z.literal(SectionType.offers).default(SectionType.offers)
|
|
3216
3632
|
})
|
|
3217
3633
|
);
|
|
3218
3634
|
|
|
3219
3635
|
// src/schema/widgets/checkout-and-beyond/carousel.ts
|
|
3220
|
-
var CABCarouselSection =
|
|
3636
|
+
var CABCarouselSection = import_zod50.z.lazy(
|
|
3221
3637
|
() => CABLayoutSection.omit({ sections: true, sectionType: true }).extend({
|
|
3222
|
-
autoAdvanceInterval:
|
|
3223
|
-
itemsAtOnce:
|
|
3638
|
+
autoAdvanceInterval: import_zod50.z.number().default(0),
|
|
3639
|
+
itemsAtOnce: import_zod50.z.number().min(1).default(1),
|
|
3224
3640
|
/** Card arrangement for the offers child (`horizontal` = side-by-side) — NOT the carousel's own `direction`. */
|
|
3225
|
-
offersDirection:
|
|
3226
|
-
sections:
|
|
3227
|
-
sectionType:
|
|
3641
|
+
offersDirection: import_zod50.z.enum(offersDirections).default("vertical"),
|
|
3642
|
+
sections: import_zod50.z.union([import_zod50.z.array(import_zod50.z.lazy(() => CABSection)), import_zod50.z.strictObject({}).transform(() => [])]).default(() => [CABOffersSection.parse({})]),
|
|
3643
|
+
sectionType: import_zod50.z.literal(SectionType.carousel).default(SectionType.carousel)
|
|
3228
3644
|
})
|
|
3229
3645
|
);
|
|
3230
3646
|
|
|
3231
3647
|
// src/schema/widgets/checkout-and-beyond/cartLine.ts
|
|
3232
|
-
var
|
|
3233
|
-
var CABCartLineSection =
|
|
3648
|
+
var import_zod51 = require("zod");
|
|
3649
|
+
var CABCartLineSection = import_zod51.z.lazy(
|
|
3234
3650
|
() => CABLayoutSection.omit({ sections: true, sectionType: true }).extend({
|
|
3235
|
-
sections:
|
|
3236
|
-
sectionType:
|
|
3651
|
+
sections: import_zod51.z.union([import_zod51.z.array(import_zod51.z.lazy(() => CABSection)), import_zod51.z.strictObject({}).transform(() => [])]).default(() => [CABButtonSection.parse({ action: ButtonAction.switchToSubscription })]),
|
|
3652
|
+
sectionType: import_zod51.z.literal(SectionType.cartLine).default(SectionType.cartLine)
|
|
3237
3653
|
})
|
|
3238
3654
|
);
|
|
3239
3655
|
|
|
3240
3656
|
// src/schema/widgets/checkout-and-beyond/discount.ts
|
|
3241
3657
|
var import_uuid9 = require("uuid");
|
|
3242
|
-
var
|
|
3243
|
-
var CABDiscountSection =
|
|
3658
|
+
var import_zod52 = require("zod");
|
|
3659
|
+
var CABDiscountSection = import_zod52.z.object({
|
|
3244
3660
|
...CABVariableFields,
|
|
3245
|
-
amount:
|
|
3246
|
-
discountedBy:
|
|
3247
|
-
discountedFrom:
|
|
3248
|
-
message:
|
|
3249
|
-
name:
|
|
3250
|
-
quantity:
|
|
3251
|
-
sectionId:
|
|
3252
|
-
sectionType:
|
|
3253
|
-
type:
|
|
3661
|
+
amount: import_zod52.z.union([import_zod52.z.number(), import_zod52.z.string()]).catch(0),
|
|
3662
|
+
discountedBy: import_zod52.z.string().optional(),
|
|
3663
|
+
discountedFrom: import_zod52.z.enum(discountSources).optional().catch(void 0),
|
|
3664
|
+
message: import_zod52.z.string().optional(),
|
|
3665
|
+
name: import_zod52.z.string().optional(),
|
|
3666
|
+
quantity: import_zod52.z.number().default(1),
|
|
3667
|
+
sectionId: import_zod52.z.uuid().default(() => (0, import_uuid9.v7)()),
|
|
3668
|
+
sectionType: import_zod52.z.literal(SectionType.discount).default(SectionType.discount),
|
|
3669
|
+
type: import_zod52.z.enum(discountTypes).catch("none")
|
|
3254
3670
|
});
|
|
3255
3671
|
|
|
3256
3672
|
// src/schema/widgets/checkout-and-beyond/monetize.ts
|
|
3257
3673
|
var import_uuid10 = require("uuid");
|
|
3258
|
-
var
|
|
3259
|
-
var CABMonetizeAds =
|
|
3260
|
-
requestId:
|
|
3674
|
+
var import_zod53 = require("zod");
|
|
3675
|
+
var CABMonetizeAds = import_zod53.z.object({
|
|
3676
|
+
requestId: import_zod53.z.string().optional(),
|
|
3261
3677
|
/** Defaulted here, never in the beacon: absence of information is `ads` itself being absent. */
|
|
3262
|
-
testing:
|
|
3678
|
+
testing: import_zod53.z.boolean().default(false)
|
|
3263
3679
|
});
|
|
3264
|
-
var CABMonetizeSection =
|
|
3680
|
+
var CABMonetizeSection = import_zod53.z.object({
|
|
3265
3681
|
...CABVariableFields,
|
|
3266
3682
|
ads: CABMonetizeAds.optional(),
|
|
3267
|
-
name:
|
|
3683
|
+
name: import_zod53.z.string().optional(),
|
|
3268
3684
|
/**
|
|
3269
3685
|
* Server-hydrated offer cards (inline hydration): when `/cab/sections` was asked with a `monetize`
|
|
3270
3686
|
* context block, the composed cards ride the marker itself — `[]` means "hydrated, no fill" (render
|
|
3271
3687
|
* nothing, skip the fetch); ABSENT means "not hydrated" (the client fetches via `/cab/monetize`).
|
|
3272
3688
|
*/
|
|
3273
|
-
offers:
|
|
3689
|
+
offers: import_zod53.z.array(import_zod53.z.lazy(() => CABSection)).optional(),
|
|
3274
3690
|
/** 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. */
|
|
3275
|
-
privacyPolicyUrl:
|
|
3276
|
-
sectionId:
|
|
3277
|
-
sectionType:
|
|
3691
|
+
privacyPolicyUrl: import_zod53.z.string().optional(),
|
|
3692
|
+
sectionId: import_zod53.z.uuid().default(() => (0, import_uuid10.v7)()),
|
|
3693
|
+
sectionType: import_zod53.z.literal(SectionType.monetize).default(SectionType.monetize),
|
|
3278
3694
|
/** Ads-taxonomy sub-vertical id (the widget's `sub_vertical` setting); paired with `vertical`. */
|
|
3279
|
-
subVertical:
|
|
3695
|
+
subVertical: import_zod53.z.string().optional(),
|
|
3280
3696
|
/** Ads-taxonomy vertical id (the widget's `vertical` setting) — with `subVertical`, the admin Monetize editor's two configurables. */
|
|
3281
|
-
vertical:
|
|
3697
|
+
vertical: import_zod53.z.string().optional()
|
|
3282
3698
|
});
|
|
3283
3699
|
|
|
3284
3700
|
// src/schema/widgets/checkout-and-beyond/progressBar.ts
|
|
3285
|
-
var
|
|
3701
|
+
var import_zod54 = require("zod");
|
|
3286
3702
|
|
|
3287
3703
|
// src/schema/widgets/checkout-and-beyond/giftLabels.ts
|
|
3288
3704
|
var GIFT_LABELS = {
|
|
@@ -3401,34 +3817,34 @@ var GIFT_LABELS = {
|
|
|
3401
3817
|
};
|
|
3402
3818
|
|
|
3403
3819
|
// src/schema/widgets/checkout-and-beyond/progressBar.ts
|
|
3404
|
-
var CABProgressTierExclusion =
|
|
3405
|
-
collectionIds:
|
|
3406
|
-
productIds:
|
|
3407
|
-
tags:
|
|
3408
|
-
type:
|
|
3820
|
+
var CABProgressTierExclusion = import_zod54.z.object({
|
|
3821
|
+
collectionIds: import_zod54.z.array(import_zod54.z.number().int().positive()).default(() => []),
|
|
3822
|
+
productIds: import_zod54.z.array(import_zod54.z.number().int().positive()).default(() => []),
|
|
3823
|
+
tags: import_zod54.z.array(import_zod54.z.string().min(1)).default(() => []),
|
|
3824
|
+
type: import_zod54.z.enum(progressTierExclusionTypes)
|
|
3409
3825
|
});
|
|
3410
|
-
var CABProgressTier =
|
|
3826
|
+
var CABProgressTier = import_zod54.z.object({
|
|
3411
3827
|
/**
|
|
3412
3828
|
* Order-discount tiers only (onsite `discount`): the reward the order-discount Function applies at
|
|
3413
3829
|
* cart time, carried so the client can resolve the `{{discountAmount}}` token in this tier's copy.
|
|
3414
3830
|
* `fixedAmount`: shop-currency CENTS (FX-scaled by the client, like {@link CABProgressTier.threshold});
|
|
3415
3831
|
* `percentage`: the whole-percent number rendered raw (`{n}%`). Absent on non-discount tiers.
|
|
3416
3832
|
*/
|
|
3417
|
-
discount:
|
|
3833
|
+
discount: import_zod54.z.object({ amount: import_zod54.z.number().nonnegative(), type: import_zod54.z.enum(["fixedAmount", "percentage"]) }).optional(),
|
|
3418
3834
|
/**
|
|
3419
3835
|
* Per-tier exclusion rules (onsite `exclusions` when `exclusions_enabled`): lines they match don't count
|
|
3420
3836
|
* toward this tier. Empty (the default, and the converter's output for a disabled or ruleless tier) means
|
|
3421
3837
|
* the tier measures the plain bar-level adjusted progress. Consumers read ONLY the list named by the rule's
|
|
3422
3838
|
* `type` — the converter leaves the other two at `[]`, so a populated off-type list never reaches the tree.
|
|
3423
3839
|
*/
|
|
3424
|
-
exclusions:
|
|
3840
|
+
exclusions: import_zod54.z.array(CABProgressTierExclusion).default(() => []),
|
|
3425
3841
|
/**
|
|
3426
3842
|
* Smart-cart product (gift) tiers only (onsite `filter_oos_variants`): when set, the client drops this
|
|
3427
3843
|
* tier entirely once its gift has NO in-stock eligible variant — the milestone, fill slot and gift
|
|
3428
3844
|
* controls all disappear, mirroring onsite removing the tier from `bar.tiers` before it renders. Absent
|
|
3429
3845
|
* on shipping/discount/decorative tiers and left off by default (the tier renders regardless of stock).
|
|
3430
3846
|
*/
|
|
3431
|
-
filterOosVariants:
|
|
3847
|
+
filterOosVariants: import_zod54.z.boolean().default(false),
|
|
3432
3848
|
/**
|
|
3433
3849
|
* Smart-cart product (gift) tiers only: the reward unlocked at this tier. The client enriches
|
|
3434
3850
|
* `productId`/`variantIds` to live variants (availability, price) and adds the chosen one to the cart
|
|
@@ -3436,10 +3852,10 @@ var CABProgressTier = import_zod38.z.object({
|
|
|
3436
3852
|
* tiers and on tiers with no configured product. Cart add/remove is a later stage; carried here so the
|
|
3437
3853
|
* tree is complete.
|
|
3438
3854
|
*/
|
|
3439
|
-
gift:
|
|
3440
|
-
productId:
|
|
3441
|
-
title:
|
|
3442
|
-
variantIds:
|
|
3855
|
+
gift: import_zod54.z.object({
|
|
3856
|
+
productId: import_zod54.z.number().int().positive(),
|
|
3857
|
+
title: import_zod54.z.string().optional(),
|
|
3858
|
+
variantIds: import_zod54.z.array(import_zod54.z.number().int().positive()).default(() => [])
|
|
3443
3859
|
}).optional(),
|
|
3444
3860
|
/**
|
|
3445
3861
|
* The step-row icon's square size in PIXELS (onsite `product_tier_element_size`, an admin px string the
|
|
@@ -3459,7 +3875,7 @@ var CABProgressTier = import_zod38.z.object({
|
|
|
3459
3875
|
* renderer never spells a fallback), which also makes a tree authored before this field render at
|
|
3460
3876
|
* React's size rather than the old hardcoded 20.
|
|
3461
3877
|
*/
|
|
3462
|
-
iconSizePx:
|
|
3878
|
+
iconSizePx: import_zod54.z.number().int().min(1).max(64).default(18),
|
|
3463
3879
|
/**
|
|
3464
3880
|
* The step-row label at this tier's slot (onsite `getTierLabel`): the merchant custom label, else the
|
|
3465
3881
|
* type default — 'Free Shipping' or '{n}% Discount'. A PRODUCT tier gets NO converter label: its name is
|
|
@@ -3469,35 +3885,35 @@ var CABProgressTier = import_zod38.z.object({
|
|
|
3469
3885
|
* turns a blank label into an absent key, and a client-authored blank means the same thing — the renderer
|
|
3470
3886
|
* emits no caption slot rather than an empty one). Plain text — a compact icon+label.
|
|
3471
3887
|
*/
|
|
3472
|
-
label:
|
|
3888
|
+
label: import_zod54.z.record(import_zod54.z.string(), import_zod54.z.string()).optional(),
|
|
3473
3889
|
/**
|
|
3474
3890
|
* Smart-cart product (gift) tiers only (onsite `product_tier_image`): show the gift's product image in
|
|
3475
3891
|
* the step-row slot instead of the generic bag icon. The converter can't supply the image URL (config
|
|
3476
3892
|
* carries only product IDs), so the client resolves it (authoritative Shopify featured image, React
|
|
3477
3893
|
* parity) and falls back to the bag icon when the flag is off or no image resolves. Default false.
|
|
3478
3894
|
*/
|
|
3479
|
-
productTierImage:
|
|
3895
|
+
productTierImage: import_zod54.z.boolean().default(false),
|
|
3480
3896
|
/**
|
|
3481
3897
|
* The tier's goal, measured per `unit`. `currency` (default): SHOP-currency cents — the canonical
|
|
3482
3898
|
* fallback: when the buyer's presentment currency has no entry in `thresholds`, the client
|
|
3483
3899
|
* multiplies this by the live FX rate (converter maps the v1 `unlock_price`, e.g. `75` → `7500`).
|
|
3484
3900
|
* `item`: a raw item count — no cents, no FX, no `thresholds` overrides.
|
|
3485
3901
|
*/
|
|
3486
|
-
threshold:
|
|
3902
|
+
threshold: import_zod54.z.number().int().nonnegative(),
|
|
3487
3903
|
/**
|
|
3488
3904
|
* Per-presentment-currency goal overrides — lowercased ISO currency code → cents (e.g. `{ cad: 9900 }`).
|
|
3489
3905
|
* When the buyer's currency has an entry, the client uses it verbatim INSTEAD of FX-converting
|
|
3490
3906
|
* `threshold`, so merchants show intentional, clean per-market amounts (Shopify Markets) rather than a
|
|
3491
3907
|
* converted base. Defaults to `{}` — no overrides means always fall back to `threshold`.
|
|
3492
3908
|
*/
|
|
3493
|
-
thresholds:
|
|
3909
|
+
thresholds: import_zod54.z.record(import_zod54.z.string(), import_zod54.z.number().int().nonnegative()).default(() => ({})),
|
|
3494
3910
|
/**
|
|
3495
3911
|
* Smart-cart tier identifier, mirrored onto the gift cart line's `_tier` attribute so the client can
|
|
3496
3912
|
* match an in-cart gift back to its tier (add on reach, remove on downgrade/decline). Absent on the
|
|
3497
3913
|
* shipping bar (single unlabeled tier, no gift).
|
|
3498
3914
|
*/
|
|
3499
|
-
tierId:
|
|
3500
|
-
tierType:
|
|
3915
|
+
tierId: import_zod54.z.string().optional(),
|
|
3916
|
+
tierType: import_zod54.z.enum(progressTierTypes).default(ProgressTierType.shipping),
|
|
3501
3917
|
/**
|
|
3502
3918
|
* What this tier's progress is measured in — PER TIER (onsite's `unlock_condition_type` model, NOT
|
|
3503
3919
|
* the React port's bar-level `tiers[0]` shortcut). `currency` compares money cents against the
|
|
@@ -3508,9 +3924,9 @@ var CABProgressTier = import_zod38.z.object({
|
|
|
3508
3924
|
* count carries no injected noun (no English `item`/`items` inflection on localized copy); merchant
|
|
3509
3925
|
* template text supplies grammatically-neutral wording around the token.
|
|
3510
3926
|
*/
|
|
3511
|
-
unit:
|
|
3927
|
+
unit: import_zod54.z.enum(progressTierUnits).default(ProgressTierUnit.currency)
|
|
3512
3928
|
});
|
|
3513
|
-
var CABProgressBarSection =
|
|
3929
|
+
var CABProgressBarSection = import_zod54.z.lazy(
|
|
3514
3930
|
() => CABLayoutSection.omit({ sectionType: true }).extend({
|
|
3515
3931
|
/**
|
|
3516
3932
|
* The onsite bar id (smart-cart TPB bars only). The client mirrors it to the cart's `_barId` attribute
|
|
@@ -3519,35 +3935,35 @@ var CABProgressBarSection = import_zod38.z.lazy(
|
|
|
3519
3935
|
* checkout reaches the extension without it, so the client writes it or the tier gift's 100% discount
|
|
3520
3936
|
* (and any tier order discount) never applies. Absent on the v1 shipping bar (no gift tiers, no id).
|
|
3521
3937
|
*/
|
|
3522
|
-
barId:
|
|
3938
|
+
barId: import_zod54.z.string().optional(),
|
|
3523
3939
|
/** Empty = shown everywhere; otherwise uppercase ISO country codes. */
|
|
3524
|
-
countryCodes:
|
|
3940
|
+
countryCodes: import_zod54.z.array(import_zod54.z.string().transform((code) => code.trim().toUpperCase())).default(() => []),
|
|
3525
3941
|
/**
|
|
3526
3942
|
* Uppercase ISO codes where a higher-precedence geo bar applies, so this (default, non-geo) bar is
|
|
3527
3943
|
* hidden there — replicates React `getbar`'s geo-match-over-default precedence. Empty = never excluded.
|
|
3528
3944
|
*/
|
|
3529
|
-
excludeCountryCodes:
|
|
3945
|
+
excludeCountryCodes: import_zod54.z.array(import_zod54.z.string().transform((code) => code.trim().toUpperCase())).default(() => []),
|
|
3530
3946
|
/**
|
|
3531
3947
|
* Measure progress against the PRE-discount subtotal (onsite `exclude_discount_in_subtotal`, and
|
|
3532
3948
|
* forced on for bars with a discount tier so its own reward can't un-reach the tier). The client
|
|
3533
3949
|
* adds the cart's discount allocations back to the live subtotal.
|
|
3534
3950
|
*/
|
|
3535
|
-
excludeDiscountInSubtotal:
|
|
3951
|
+
excludeDiscountInSubtotal: import_zod54.z.boolean().default(false),
|
|
3536
3952
|
/** Variant ids the client subtracts from the adjusted subtotal (React `bar.excluded_products`). */
|
|
3537
|
-
excludedVariantIds:
|
|
3953
|
+
excludedVariantIds: import_zod54.z.array(import_zod54.z.number().int().positive()).default(() => []),
|
|
3538
3954
|
/**
|
|
3539
3955
|
* When the cart holds a subscription item, treat the bar as reached regardless of subtotal (React
|
|
3540
3956
|
* `free_shipping_on_subscription(s)`). `freeShippingOnAll` is already a zero-threshold tier instead.
|
|
3541
3957
|
*/
|
|
3542
|
-
freeShippingOnSubscription:
|
|
3958
|
+
freeShippingOnSubscription: import_zod54.z.boolean().default(false),
|
|
3543
3959
|
/** Localized heading over the gift controls (onsite `gift_area_title`, default 'FREE GIFTS'). */
|
|
3544
|
-
giftAreaTitle:
|
|
3960
|
+
giftAreaTitle: import_zod54.z.record(import_zod54.z.string(), import_zod54.z.string()).default(() => ({ en: "FREE GIFTS" })),
|
|
3545
3961
|
/** Localized gift-control labels (add/remove/heading); a tier's gift `title` beats `yourGift`. */
|
|
3546
|
-
giftLabels:
|
|
3547
|
-
addGift:
|
|
3548
|
-
remove:
|
|
3549
|
-
selectOptions:
|
|
3550
|
-
yourGift:
|
|
3962
|
+
giftLabels: import_zod54.z.object({
|
|
3963
|
+
addGift: import_zod54.z.record(import_zod54.z.string(), import_zod54.z.string()).default(() => ({ ...GIFT_LABELS.addGift })),
|
|
3964
|
+
remove: import_zod54.z.record(import_zod54.z.string(), import_zod54.z.string()).default(() => ({ ...GIFT_LABELS.remove })),
|
|
3965
|
+
selectOptions: import_zod54.z.record(import_zod54.z.string(), import_zod54.z.string()).default(() => ({ ...GIFT_LABELS.selectOptions })),
|
|
3966
|
+
yourGift: import_zod54.z.record(import_zod54.z.string(), import_zod54.z.string()).default(() => ({ ...GIFT_LABELS.yourGift }))
|
|
3551
3967
|
}).default(() => ({
|
|
3552
3968
|
addGift: { ...GIFT_LABELS.addGift },
|
|
3553
3969
|
remove: { ...GIFT_LABELS.remove },
|
|
@@ -3555,38 +3971,38 @@ var CABProgressBarSection = import_zod38.z.lazy(
|
|
|
3555
3971
|
yourGift: { ...GIFT_LABELS.yourGift }
|
|
3556
3972
|
})),
|
|
3557
3973
|
/** The bar's a11y label; the merchant names it in the editor, else this default (React parity). */
|
|
3558
|
-
name:
|
|
3974
|
+
name: import_zod54.z.string().default("Order progress"),
|
|
3559
3975
|
/**
|
|
3560
3976
|
* Bar fill color. An explicit (widget-authored) value is used verbatim; when absent the server
|
|
3561
3977
|
* fills it with the live shop theme's `buttonBackground` (React `useRebuyTheme` parity). Still
|
|
3562
3978
|
* absent after that ⇒ the theme fetch failed and the client renders its platform-default bar —
|
|
3563
3979
|
* optional, not defaulted, so "merchant chose no color" stays distinguishable from any real value.
|
|
3564
3980
|
*/
|
|
3565
|
-
progressColor:
|
|
3566
|
-
sectionType:
|
|
3981
|
+
progressColor: import_zod54.z.string().optional(),
|
|
3982
|
+
sectionType: import_zod54.z.literal(SectionType.progressBar).default(SectionType.progressBar),
|
|
3567
3983
|
/**
|
|
3568
3984
|
* The bar's milestones in the merchant's CONFIGURED order — the renderer does NOT sort them (022
|
|
3569
3985
|
* O-B2: sorting by resolved threshold reversed configured milestones on out-of-order or mixed-unit
|
|
3570
3986
|
* count-vs-cents bars). Drives the fill (even slot per tier) and, for smart-cart product tiers, the
|
|
3571
3987
|
* gift add/remove. The visual tier display lives in `sections` (composable), NOT here.
|
|
3572
3988
|
*/
|
|
3573
|
-
tiers:
|
|
3989
|
+
tiers: import_zod54.z.union([import_zod54.z.array(CABProgressTier), import_zod54.z.strictObject({}).transform(() => [])]).default(() => [])
|
|
3574
3990
|
})
|
|
3575
3991
|
);
|
|
3576
3992
|
|
|
3577
3993
|
// src/schema/widgets/checkout-and-beyond/quantity.ts
|
|
3578
3994
|
var import_uuid11 = require("uuid");
|
|
3579
|
-
var
|
|
3580
|
-
var CABQuantitySection =
|
|
3995
|
+
var import_zod55 = require("zod");
|
|
3996
|
+
var CABQuantitySection = import_zod55.z.object({
|
|
3581
3997
|
...CABVariableFields,
|
|
3582
|
-
errorMessages:
|
|
3583
|
-
|
|
3584
|
-
|
|
3998
|
+
errorMessages: import_zod55.z.record(
|
|
3999
|
+
import_zod55.z.string(),
|
|
4000
|
+
import_zod55.z.object({
|
|
3585
4001
|
/** `{{step}}` is interpolated at render — the off-increment message React never gave a merchant key. */
|
|
3586
|
-
increment:
|
|
3587
|
-
max:
|
|
3588
|
-
min:
|
|
3589
|
-
neg:
|
|
4002
|
+
increment: import_zod55.z.string().optional(),
|
|
4003
|
+
max: import_zod55.z.string().optional(),
|
|
4004
|
+
min: import_zod55.z.string().optional(),
|
|
4005
|
+
neg: import_zod55.z.string().optional()
|
|
3590
4006
|
})
|
|
3591
4007
|
).default({
|
|
3592
4008
|
en: {
|
|
@@ -3596,18 +4012,18 @@ var CABQuantitySection = import_zod39.z.object({
|
|
|
3596
4012
|
neg: "Quantity cannot be negative"
|
|
3597
4013
|
}
|
|
3598
4014
|
}),
|
|
3599
|
-
inputType:
|
|
3600
|
-
max:
|
|
3601
|
-
min:
|
|
4015
|
+
inputType: import_zod55.z.enum(quantityInputs).default(QuantityInput.select),
|
|
4016
|
+
max: import_zod55.z.number().min(1).max(100).default(10),
|
|
4017
|
+
min: import_zod55.z.number().min(1).default(1),
|
|
3602
4018
|
/** The a11y label for the quantity control; the merchant names it in the editor, else this default. */
|
|
3603
|
-
name:
|
|
3604
|
-
sectionId:
|
|
3605
|
-
sectionType:
|
|
4019
|
+
name: import_zod55.z.string().default("Quantity"),
|
|
4020
|
+
sectionId: import_zod55.z.uuid().default(() => (0, import_uuid11.v7)()),
|
|
4021
|
+
sectionType: import_zod55.z.literal(SectionType.quantity).default(SectionType.quantity)
|
|
3606
4022
|
});
|
|
3607
4023
|
|
|
3608
4024
|
// src/schema/widgets/checkout-and-beyond/reviews.ts
|
|
3609
4025
|
var import_uuid12 = require("uuid");
|
|
3610
|
-
var
|
|
4026
|
+
var import_zod56 = require("zod");
|
|
3611
4027
|
|
|
3612
4028
|
// src/schema/widgets/checkout-and-beyond/reviewLabels.ts
|
|
3613
4029
|
var REVIEW_LABELS = {
|
|
@@ -3670,68 +4086,68 @@ var REVIEW_LABELS = {
|
|
|
3670
4086
|
};
|
|
3671
4087
|
|
|
3672
4088
|
// src/schema/widgets/checkout-and-beyond/reviews.ts
|
|
3673
|
-
var CABReviewsSection =
|
|
4089
|
+
var CABReviewsSection = import_zod56.z.object({
|
|
3674
4090
|
...CABVariableFields,
|
|
3675
|
-
color:
|
|
4091
|
+
color: import_zod56.z.string().default("#fadb14"),
|
|
3676
4092
|
/**
|
|
3677
4093
|
* Localized review-count templates (`{{reviewCount}}`), one/other plural forms; the client picks the
|
|
3678
4094
|
* form via `Intl.PluralRules`. Defaults here (schema-first) so every tree localizes without converter
|
|
3679
4095
|
* or merchant work.
|
|
3680
4096
|
*/
|
|
3681
|
-
countLabels:
|
|
3682
|
-
one:
|
|
3683
|
-
other:
|
|
4097
|
+
countLabels: import_zod56.z.object({
|
|
4098
|
+
one: import_zod56.z.record(import_zod56.z.string(), import_zod56.z.string()).default(() => ({ ...REVIEW_LABELS.one })),
|
|
4099
|
+
other: import_zod56.z.record(import_zod56.z.string(), import_zod56.z.string()).default(() => ({ ...REVIEW_LABELS.other }))
|
|
3684
4100
|
}).default(() => ({ one: { ...REVIEW_LABELS.one }, other: { ...REVIEW_LABELS.other } })),
|
|
3685
|
-
name:
|
|
3686
|
-
sectionId:
|
|
3687
|
-
sectionType:
|
|
3688
|
-
size:
|
|
4101
|
+
name: import_zod56.z.string().optional(),
|
|
4102
|
+
sectionId: import_zod56.z.uuid().default(() => (0, import_uuid12.v7)()),
|
|
4103
|
+
sectionType: import_zod56.z.literal(SectionType.reviews).default(SectionType.reviews),
|
|
4104
|
+
size: import_zod56.z.enum(reviewsSizes).default(ReviewsSize.default),
|
|
3689
4105
|
/**
|
|
3690
4106
|
* Star outline color, interpolated into a style by the renderer, so it is hex-constrained like
|
|
3691
4107
|
* `CABButtonSection.color`. The legacy source (`PostPurchaseSettings.styles.starStrokeColor`) is a free
|
|
3692
4108
|
* string: its converter must validate and fall back to this default rather than let one odd value drop
|
|
3693
4109
|
* the whole reviews section.
|
|
3694
4110
|
*/
|
|
3695
|
-
strokeColor:
|
|
4111
|
+
strokeColor: import_zod56.z.string().regex(HEX_COLOR_REGEX).default("#fadb14"),
|
|
3696
4112
|
/** Star outline width in px; `0` draws no outline. The legacy `styles.strokeWidth` is a STRING ('1') — its converter coerces. */
|
|
3697
|
-
strokeWidth:
|
|
4113
|
+
strokeWidth: import_zod56.z.number().nonnegative().default(0)
|
|
3698
4114
|
});
|
|
3699
4115
|
|
|
3700
4116
|
// src/schema/widgets/checkout-and-beyond/separator.ts
|
|
3701
4117
|
var import_uuid13 = require("uuid");
|
|
3702
|
-
var
|
|
3703
|
-
var CABSeparatorSection =
|
|
4118
|
+
var import_zod57 = require("zod");
|
|
4119
|
+
var CABSeparatorSection = import_zod57.z.object({
|
|
3704
4120
|
...CABVariableFields,
|
|
3705
|
-
sectionId:
|
|
3706
|
-
sectionType:
|
|
4121
|
+
sectionId: import_zod57.z.uuid().default(() => (0, import_uuid13.v7)()),
|
|
4122
|
+
sectionType: import_zod57.z.literal(SectionType.separator).default(SectionType.separator)
|
|
3707
4123
|
});
|
|
3708
4124
|
|
|
3709
4125
|
// src/schema/widgets/checkout-and-beyond/variants.ts
|
|
3710
4126
|
var import_compat5 = require("es-toolkit/compat");
|
|
3711
4127
|
var import_uuid14 = require("uuid");
|
|
3712
|
-
var
|
|
3713
|
-
var CABVariantsSection =
|
|
4128
|
+
var import_zod58 = require("zod");
|
|
4129
|
+
var CABVariantsSection = import_zod58.z.object({
|
|
3714
4130
|
...CABVariableFields,
|
|
3715
|
-
hideOutOfStockVariants:
|
|
3716
|
-
name:
|
|
3717
|
-
sectionId:
|
|
3718
|
-
sectionType:
|
|
3719
|
-
selector:
|
|
3720
|
-
variantMode:
|
|
4131
|
+
hideOutOfStockVariants: import_zod58.z.boolean().default(false),
|
|
4132
|
+
name: import_zod58.z.string().optional(),
|
|
4133
|
+
sectionId: import_zod58.z.uuid().default(() => (0, import_uuid14.v7)()),
|
|
4134
|
+
sectionType: import_zod58.z.literal(SectionType.variants).default(SectionType.variants),
|
|
4135
|
+
selector: import_zod58.z.enum((0, import_compat5.slice)(variantSelectors, 0, 3)).default(VariantSelector.menu),
|
|
4136
|
+
variantMode: import_zod58.z.enum(variantModes).default(VariantMode.multiple)
|
|
3721
4137
|
});
|
|
3722
4138
|
|
|
3723
4139
|
// src/schema/widgets/checkout-and-beyond/shared.ts
|
|
3724
|
-
var CABBorder =
|
|
3725
|
-
radius:
|
|
3726
|
-
style:
|
|
3727
|
-
width:
|
|
4140
|
+
var CABBorder = import_zod59.z.object({
|
|
4141
|
+
radius: import_zod59.z.enum(borderRadii).default(BorderRadius.base),
|
|
4142
|
+
style: import_zod59.z.enum(borderStyles).default(BorderStyle.none),
|
|
4143
|
+
width: import_zod59.z.enum(borderWidths).default(BorderWidth.base)
|
|
3728
4144
|
}).default({
|
|
3729
4145
|
radius: BorderRadius.base,
|
|
3730
4146
|
style: BorderStyle.none,
|
|
3731
4147
|
width: BorderWidth.base
|
|
3732
4148
|
});
|
|
3733
|
-
var CABSection =
|
|
3734
|
-
() =>
|
|
4149
|
+
var CABSection = import_zod59.z.lazy(
|
|
4150
|
+
() => import_zod59.z.discriminatedUnion("sectionType", [
|
|
3735
4151
|
CABBannerSection,
|
|
3736
4152
|
CABButtonSection,
|
|
3737
4153
|
CABCarouselSection,
|
|
@@ -3754,41 +4170,41 @@ var CABSection = import_zod43.z.lazy(
|
|
|
3754
4170
|
);
|
|
3755
4171
|
|
|
3756
4172
|
// src/schema/widgets/checkout-and-beyond/layout.ts
|
|
3757
|
-
var GridItem =
|
|
3758
|
-
var CABLayoutWrapping =
|
|
3759
|
-
breakAt:
|
|
3760
|
-
maxPerLine:
|
|
4173
|
+
var GridItem = import_zod60.z.union([import_zod60.z.literal("auto"), import_zod60.z.literal("fill"), import_zod60.z.string().regex(/^\d+%$/), import_zod60.z.number()]);
|
|
4174
|
+
var CABLayoutWrapping = import_zod60.z.object({
|
|
4175
|
+
breakAt: import_zod60.z.number().positive(),
|
|
4176
|
+
maxPerLine: import_zod60.z.number().int().positive()
|
|
3761
4177
|
});
|
|
3762
|
-
var CABLayoutSection =
|
|
4178
|
+
var CABLayoutSection = import_zod60.z.object({
|
|
3763
4179
|
...CABVariableFields,
|
|
3764
|
-
alignment:
|
|
3765
|
-
horizontal:
|
|
3766
|
-
vertical:
|
|
4180
|
+
alignment: import_zod60.z.object({
|
|
4181
|
+
horizontal: import_zod60.z.enum(horizontalAlignments).default(HorizontalAlignment.start),
|
|
4182
|
+
vertical: import_zod60.z.enum(verticalAlignments).default(VerticalAlignment.top)
|
|
3767
4183
|
}).default({
|
|
3768
4184
|
horizontal: HorizontalAlignment.start,
|
|
3769
4185
|
vertical: VerticalAlignment.top
|
|
3770
4186
|
}),
|
|
3771
|
-
border:
|
|
3772
|
-
buttonField:
|
|
3773
|
-
direction:
|
|
4187
|
+
border: import_zod60.z.lazy(() => CABBorder),
|
|
4188
|
+
buttonField: import_zod60.z.enum(buttonFields).optional(),
|
|
4189
|
+
direction: import_zod60.z.enum(directions).default(Direction.rows),
|
|
3774
4190
|
/**
|
|
3775
4191
|
* Platform chrome around the section, not a layout behavior: `callout` is a subdued box with block borders
|
|
3776
4192
|
* (the legacy post-purchase callout banner), `offer-content` the post-purchase offer's own content card.
|
|
3777
4193
|
*/
|
|
3778
|
-
frame:
|
|
3779
|
-
grid:
|
|
3780
|
-
columns:
|
|
3781
|
-
rows:
|
|
4194
|
+
frame: import_zod60.z.enum(layoutFrames).optional(),
|
|
4195
|
+
grid: import_zod60.z.object({
|
|
4196
|
+
columns: import_zod60.z.union([import_zod60.z.array(GridItem), import_zod60.z.undefined()]).default(() => ["auto"]),
|
|
4197
|
+
rows: import_zod60.z.union([import_zod60.z.array(GridItem), import_zod60.z.undefined()]).default(() => ["auto"])
|
|
3782
4198
|
}).default({ columns: ["auto"], rows: ["auto"] }).optional(),
|
|
3783
|
-
name:
|
|
3784
|
-
padding:
|
|
3785
|
-
sectionId:
|
|
3786
|
-
sections:
|
|
3787
|
-
sectionType:
|
|
3788
|
-
spacing:
|
|
4199
|
+
name: import_zod60.z.string().optional(),
|
|
4200
|
+
padding: import_zod60.z.enum(spacings).default(Spacing.none),
|
|
4201
|
+
sectionId: import_zod60.z.uuid().default(() => (0, import_uuid15.v7)()),
|
|
4202
|
+
sections: import_zod60.z.union([import_zod60.z.array(import_zod60.z.lazy(() => CABSection)), import_zod60.z.strictObject({}).transform(() => [])]).default(() => []),
|
|
4203
|
+
sectionType: import_zod60.z.literal(SectionType.layout).default(SectionType.layout),
|
|
4204
|
+
spacing: import_zod60.z.enum(spacings).default(Spacing.base),
|
|
3789
4205
|
/** Fire-and-forget impression pixel POSTed once when the section is shown (e.g. a Monetize offer view). */
|
|
3790
|
-
viewUrl:
|
|
3791
|
-
width:
|
|
4206
|
+
viewUrl: import_zod60.z.string().optional(),
|
|
4207
|
+
width: import_zod60.z.number().default(100),
|
|
3792
4208
|
wrapping: CABLayoutWrapping.optional()
|
|
3793
4209
|
});
|
|
3794
4210
|
|
|
@@ -3810,8 +4226,8 @@ var UI_LABELS = {
|
|
|
3810
4226
|
};
|
|
3811
4227
|
|
|
3812
4228
|
// src/schema/widgets/checkout-and-beyond/root.ts
|
|
3813
|
-
var localized = (fallback) =>
|
|
3814
|
-
var CABUILabels =
|
|
4229
|
+
var localized = (fallback) => import_zod61.z.record(import_zod61.z.string(), import_zod61.z.string()).default(() => ({ ...fallback })).transform((labels) => Object.keys(labels).length > 0 ? labels : { ...fallback });
|
|
4230
|
+
var CABUILabels = import_zod61.z.object({
|
|
3815
4231
|
currentPage: localized(UI_LABELS.currentPage),
|
|
3816
4232
|
guest: localized(UI_LABELS.guest),
|
|
3817
4233
|
loadingOptions: localized(UI_LABELS.loadingOptions),
|
|
@@ -3836,47 +4252,47 @@ var CABUILabels = import_zod45.z.object({
|
|
|
3836
4252
|
subscriptionOptions: { ...UI_LABELS.subscriptionOptions },
|
|
3837
4253
|
updating: { ...UI_LABELS.updating }
|
|
3838
4254
|
}));
|
|
3839
|
-
var TargetArea =
|
|
3840
|
-
fill:
|
|
3841
|
-
flip:
|
|
3842
|
-
icon:
|
|
3843
|
-
label:
|
|
3844
|
-
width:
|
|
4255
|
+
var TargetArea = import_zod61.z.object({
|
|
4256
|
+
fill: import_zod61.z.boolean().optional(),
|
|
4257
|
+
flip: import_zod61.z.enum(["both", "horizontal", "vertical"]).optional(),
|
|
4258
|
+
icon: import_zod61.z.string(),
|
|
4259
|
+
label: import_zod61.z.string(),
|
|
4260
|
+
width: import_zod61.z.string()
|
|
3845
4261
|
}).default(targetAreas[EditorMode.checkoutExtension][1]);
|
|
3846
|
-
var CABTracking =
|
|
3847
|
-
enableAttribution:
|
|
3848
|
-
enableSource:
|
|
3849
|
-
enableWidget:
|
|
4262
|
+
var CABTracking = import_zod61.z.object({
|
|
4263
|
+
enableAttribution: import_zod61.z.boolean().nullish().transform((value) => value ?? true),
|
|
4264
|
+
enableSource: import_zod61.z.boolean().nullish().transform((value) => value ?? true),
|
|
4265
|
+
enableWidget: import_zod61.z.boolean().nullish().transform((value) => value ?? true)
|
|
3850
4266
|
}).nullish().transform((value) => value ?? { enableAttribution: true, enableSource: true, enableWidget: true });
|
|
3851
|
-
var CABExperiment =
|
|
3852
|
-
elementId:
|
|
3853
|
-
experimentId:
|
|
3854
|
-
experimentType:
|
|
3855
|
-
selectedId:
|
|
4267
|
+
var CABExperiment = import_zod61.z.object({
|
|
4268
|
+
elementId: import_zod61.z.number(),
|
|
4269
|
+
experimentId: import_zod61.z.number(),
|
|
4270
|
+
experimentType: import_zod61.z.string(),
|
|
4271
|
+
selectedId: import_zod61.z.number()
|
|
3856
4272
|
});
|
|
3857
4273
|
var CABRootSection = CABLayoutSection.extend({
|
|
3858
|
-
editorMode:
|
|
4274
|
+
editorMode: import_zod61.z.enum(editorModes).default(EditorMode.checkoutExtension),
|
|
3859
4275
|
experiment: CABExperiment.optional(),
|
|
3860
4276
|
// Same rule as CABTracking above: the v1 converters pass raw legacy `previewMode` through, so a
|
|
3861
4277
|
// `null` must fall back rather than throw the widget; malformed values still throw.
|
|
3862
|
-
previewMode:
|
|
3863
|
-
storeId:
|
|
4278
|
+
previewMode: import_zod61.z.boolean().nullish().transform((value) => value ?? false),
|
|
4279
|
+
storeId: import_zod61.z.number().nullable().default(null),
|
|
3864
4280
|
targetArea: TargetArea.nullable(),
|
|
3865
4281
|
tracking: CABTracking,
|
|
3866
|
-
type:
|
|
4282
|
+
type: import_zod61.z.enum(widgetTypes).default(WidgetType.ui_extension_content_block),
|
|
3867
4283
|
uiLabels: CABUILabels,
|
|
3868
|
-
version:
|
|
3869
|
-
widgetId:
|
|
4284
|
+
version: import_zod61.z.literal(2).default(2),
|
|
4285
|
+
widgetId: import_zod61.z.number().nullable().default(null)
|
|
3870
4286
|
});
|
|
3871
4287
|
|
|
3872
4288
|
// src/schema/postPurchaseProductView.ts
|
|
3873
|
-
var PostPurchaseProductView =
|
|
3874
|
-
|
|
4289
|
+
var PostPurchaseProductView = import_zod62.z.union([
|
|
4290
|
+
import_zod62.z.object({
|
|
3875
4291
|
groupCatalog: PostPurchaseGroupCatalog.optional(),
|
|
3876
4292
|
initialVariant: PostPurchaseVariantSelector.optional(),
|
|
3877
4293
|
planCatalog: PostPurchasePlanCatalog.nullable().optional(),
|
|
3878
4294
|
preparation: PreparedPostPurchaseProduct.extend({
|
|
3879
|
-
display: PreparedPostPurchaseProduct.shape.display.extend({ description:
|
|
4295
|
+
display: PreparedPostPurchaseProduct.shape.display.extend({ description: import_zod62.z.string().nullable() }).refine(
|
|
3880
4296
|
({ description, descriptionDocument }) => description === null === (descriptionDocument !== void 0),
|
|
3881
4297
|
"Exactly one of the plain and rich descriptions is shown"
|
|
3882
4298
|
)
|
|
@@ -3885,33 +4301,38 @@ var PostPurchaseProductView = import_zod46.z.union([
|
|
|
3885
4301
|
sections: CABRootSection,
|
|
3886
4302
|
variantCatalog: PostPurchaseVariantCatalog.optional()
|
|
3887
4303
|
}),
|
|
3888
|
-
|
|
4304
|
+
import_zod62.z.object({
|
|
3889
4305
|
groupCatalog: PostPurchaseGroupCatalog.optional(),
|
|
3890
4306
|
initialVariant: PostPurchaseVariantSelector.optional(),
|
|
3891
4307
|
planCatalog: PostPurchasePlanCatalog.nullable().optional(),
|
|
3892
4308
|
preparation: PostPurchasePreparation.options[1],
|
|
3893
4309
|
purchaseOptions: PostPurchaseOptions.optional(),
|
|
3894
|
-
sections:
|
|
4310
|
+
sections: import_zod62.z.null(),
|
|
3895
4311
|
variantCatalog: PostPurchaseVariantCatalog.optional()
|
|
3896
4312
|
})
|
|
3897
4313
|
]);
|
|
3898
4314
|
|
|
3899
4315
|
// src/schema/postPurchaseProductCollectionView.ts
|
|
3900
|
-
var PostPurchaseProductCollectionView =
|
|
3901
|
-
members:
|
|
3902
|
-
|
|
4316
|
+
var PostPurchaseProductCollectionView = import_zod63.z.object({
|
|
4317
|
+
members: import_zod63.z.array(
|
|
4318
|
+
import_zod63.z.object({
|
|
3903
4319
|
productId: PostPurchaseProductId,
|
|
3904
|
-
productIndex:
|
|
4320
|
+
productIndex: import_zod63.z.number().int().nonnegative(),
|
|
3905
4321
|
view: PostPurchaseProductView
|
|
3906
4322
|
})
|
|
3907
4323
|
)
|
|
3908
4324
|
});
|
|
3909
|
-
var PostPurchaseCollectionChoice =
|
|
4325
|
+
var PostPurchaseCollectionChoice = import_zod63.z.object({
|
|
3910
4326
|
choice: PostPurchaseChoice.optional(),
|
|
3911
4327
|
productId: PostPurchaseProductId,
|
|
3912
4328
|
variantId: PostPurchaseVariantSelector.shape.variantId.optional()
|
|
3913
4329
|
}).strict();
|
|
3914
|
-
var PostPurchaseExcludedProductIds =
|
|
4330
|
+
var PostPurchaseExcludedProductIds = import_zod63.z.array(PostPurchaseProductId).default([]);
|
|
4331
|
+
var PostPurchaseMemberSelector = PostPurchaseProgressSchema.shape.members.element.pick({ productId: true }).extend({ progressRevision: PostPurchaseProgressSchema.shape.revision });
|
|
4332
|
+
var PostPurchaseMemberPointer = PostPurchaseProgressSchema.shape.members.element.omit({ status: true }).extend({
|
|
4333
|
+
entryRevision: PostPurchaseProgressSchema.shape.entryRevision,
|
|
4334
|
+
progressRevision: PostPurchaseProgressSchema.shape.revision
|
|
4335
|
+
});
|
|
3915
4336
|
|
|
3916
4337
|
// src/schema/postPurchaseQuantity.ts
|
|
3917
4338
|
var quantity = PreparedPostPurchaseProduct.shape.selection.shape.quantity;
|
|
@@ -3919,7 +4340,7 @@ var PostPurchaseQuantityChoice = PostPurchaseCollectionChoice.extend({ quantity:
|
|
|
3919
4340
|
var PostPurchaseQuantityPolicy = PostPurchaseSettings.shape.quantityInputs.omit({ defaultQuantity: true }).extend({
|
|
3920
4341
|
initialQuantity: quantity,
|
|
3921
4342
|
maxValue: quantity,
|
|
3922
|
-
minValue:
|
|
4343
|
+
minValue: import_zod64.z.literal(0).transform(() => 1).or(quantity)
|
|
3923
4344
|
}).refine(({ maxValue, minValue }) => minValue <= maxValue, "Quantity bounds are reversed");
|
|
3924
4345
|
|
|
3925
4346
|
// src/schema/postPurchaseGroup.ts
|
|
@@ -3927,73 +4348,106 @@ var PostPurchaseGroupChoice = PostPurchaseQuantityChoice.extend({
|
|
|
3927
4348
|
memberProductId: PreparedPostPurchaseProduct.shape.selection.shape.productId
|
|
3928
4349
|
});
|
|
3929
4350
|
|
|
3930
|
-
// src/schema/
|
|
3931
|
-
var
|
|
3932
|
-
var
|
|
3933
|
-
|
|
3934
|
-
|
|
3935
|
-
|
|
3936
|
-
|
|
3937
|
-
|
|
3938
|
-
|
|
4351
|
+
// src/schema/postPurchaseLifecycle.ts
|
|
4352
|
+
var import_zod65 = require("zod");
|
|
4353
|
+
var Presentation = import_zod65.z.strictObject({
|
|
4354
|
+
member: PostPurchaseMemberIdentity,
|
|
4355
|
+
selectedProductId: PostPurchaseMemberIdentity.shape.productId.optional(),
|
|
4356
|
+
variant: PostPurchaseVariantSelector
|
|
4357
|
+
});
|
|
4358
|
+
var LifecycleObservationRequestSchema = DecideRequestSchema.extend({
|
|
4359
|
+
entryRevision: PostPurchaseProgressSchema.shape.entryRevision,
|
|
4360
|
+
eventType: import_zod65.z.enum(["OFFER_VIEWED", "OFFER_TIMER_EXPIRED"]),
|
|
4361
|
+
presentation: Presentation.nullable(),
|
|
4362
|
+
progressRevision: PostPurchaseProgressSchema.shape.revision,
|
|
4363
|
+
requestId: import_zod65.z.uuid()
|
|
4364
|
+
}).strict().refine(
|
|
4365
|
+
({ eventType, presentation }) => eventType !== "OFFER_VIEWED" || presentation !== null,
|
|
4366
|
+
"Viewed observations require a presented product"
|
|
4367
|
+
);
|
|
4368
|
+
var LifecycleObservationResponseSchema = import_zod65.z.object({
|
|
4369
|
+
data: import_zod65.z.strictObject({
|
|
4370
|
+
requestId: LifecycleObservationRequestSchema.shape.requestId,
|
|
4371
|
+
status: import_zod65.z.union([AcceptedEventOutcomeSchema, import_zod65.z.literal("unavailable")])
|
|
4372
|
+
}),
|
|
4373
|
+
successful: import_zod65.z.literal(true)
|
|
3939
4374
|
});
|
|
3940
|
-
|
|
3941
|
-
|
|
3942
|
-
|
|
3943
|
-
|
|
3944
|
-
|
|
3945
|
-
|
|
3946
|
-
|
|
3947
|
-
|
|
3948
|
-
|
|
4375
|
+
|
|
4376
|
+
// src/schema/postPurchaseOffer.ts
|
|
4377
|
+
var import_zod67 = require("zod");
|
|
4378
|
+
|
|
4379
|
+
// src/schema/postPurchaseSkipTrace.ts
|
|
4380
|
+
var import_zod66 = require("zod");
|
|
4381
|
+
var POST_PURCHASE_SKIP_LIMIT = 32;
|
|
4382
|
+
var PostPurchaseSkipTraceSchema = import_zod66.z.array(
|
|
4383
|
+
import_zod66.z.object({
|
|
4384
|
+
entry: DecisionEntrySchema,
|
|
4385
|
+
reason: PostPurchaseSkipReasonSchema
|
|
4386
|
+
})
|
|
4387
|
+
).max(POST_PURCHASE_SKIP_LIMIT);
|
|
4388
|
+
|
|
4389
|
+
// src/schema/postPurchaseOffer.ts
|
|
4390
|
+
var OfferPreparationRequestSchema = DecideRequestSchema.strict();
|
|
4391
|
+
var OfferPreparationResponseSchema = import_zod67.z.object({
|
|
4392
|
+
data: import_zod67.z.object({ attemptedSkips: PostPurchaseSkipTraceSchema.optional(), progress: PostPurchaseProgressSchema }),
|
|
4393
|
+
successful: import_zod67.z.literal(true)
|
|
3949
4394
|
});
|
|
3950
4395
|
|
|
3951
4396
|
// src/schema/postPurchaseOfferEligibility.ts
|
|
3952
|
-
var
|
|
4397
|
+
var import_zod68 = require("zod");
|
|
3953
4398
|
var selection = PreparedPostPurchaseProduct.shape.selection;
|
|
3954
|
-
var PostPurchaseOfferSkipReason =
|
|
3955
|
-
var PostPurchaseOfferEligibilityContext =
|
|
4399
|
+
var PostPurchaseOfferSkipReason = import_zod68.z.enum(["empty", "no-eligible-subscription"]);
|
|
4400
|
+
var PostPurchaseOfferEligibilityContext = import_zod68.z.object({
|
|
3956
4401
|
excludedProductIds: PostPurchaseExcludedProductIds,
|
|
3957
|
-
originalLineItems:
|
|
4402
|
+
originalLineItems: import_zod68.z.array(selection.pick({ productId: true, sellingPlanId: true, variantId: true }))
|
|
3958
4403
|
});
|
|
3959
|
-
var PostPurchaseOfferEligibility =
|
|
3960
|
-
|
|
3961
|
-
members:
|
|
3962
|
-
|
|
4404
|
+
var PostPurchaseOfferEligibility = import_zod68.z.discriminatedUnion("status", [
|
|
4405
|
+
import_zod68.z.object({
|
|
4406
|
+
members: import_zod68.z.array(
|
|
4407
|
+
import_zod68.z.object({ productId: selection.shape.productId, productIndex: import_zod68.z.number().int().nonnegative() })
|
|
3963
4408
|
),
|
|
3964
|
-
status:
|
|
4409
|
+
status: import_zod68.z.literal("retain")
|
|
3965
4410
|
}),
|
|
3966
|
-
|
|
3967
|
-
|
|
4411
|
+
import_zod68.z.object({ reason: PostPurchaseOfferSkipReason, status: import_zod68.z.literal("skip") }),
|
|
4412
|
+
import_zod68.z.object({ reason: import_zod68.z.literal("eligible-upgrade").optional(), status: import_zod68.z.literal("unavailable") })
|
|
3968
4413
|
]);
|
|
3969
4414
|
|
|
3970
4415
|
// src/schema/postPurchaseOfferPresentation.ts
|
|
3971
|
-
var
|
|
4416
|
+
var import_zod69 = require("zod");
|
|
3972
4417
|
var language2 = PostPurchaseSettings.shape.language.shape.global.unwrap().unwrap();
|
|
3973
|
-
var PostPurchaseOfferPresentation =
|
|
4418
|
+
var PostPurchaseOfferPresentation = import_zod69.z.strictObject({
|
|
3974
4419
|
labels: language2.pick({ declineAll: true, declineThisOffer: true }),
|
|
3975
4420
|
layout: PostPurchaseSettings.shape.offersLayout,
|
|
3976
4421
|
sections: CABRootSection.nullable(),
|
|
3977
4422
|
showDeclineAll: PostPurchaseSettings.shape.productOptions.shape.showDeclineAll
|
|
3978
4423
|
});
|
|
4424
|
+
var OfferPresentationRequestSchema = DecideRequestSchema.strict();
|
|
4425
|
+
var OfferPresentationResponseSchema = import_zod69.z.object({
|
|
4426
|
+
data: import_zod69.z.strictObject({
|
|
4427
|
+
presentation: PostPurchaseOfferPresentation.nullable(),
|
|
4428
|
+
progress: PostPurchaseProgressSchema.nullable(),
|
|
4429
|
+
serverNow: PostPurchaseTimestampSchema
|
|
4430
|
+
}),
|
|
4431
|
+
successful: import_zod69.z.literal(true)
|
|
4432
|
+
});
|
|
3979
4433
|
|
|
3980
4434
|
// src/schema/postPurchaseOrderDecision.ts
|
|
3981
|
-
var
|
|
3982
|
-
var OrderDecisionSchema =
|
|
3983
|
-
|
|
3984
|
-
|
|
4435
|
+
var import_zod70 = require("zod");
|
|
4436
|
+
var OrderDecisionSchema = import_zod70.z.discriminatedUnion("owner", [
|
|
4437
|
+
import_zod70.z.object({ owner: import_zod70.z.literal("session"), sessionId: import_zod70.z.string().regex(/^[a-f0-9]{64}$/) }),
|
|
4438
|
+
import_zod70.z.object({ owner: import_zod70.z.literal("release"), sessionId: import_zod70.z.null() })
|
|
3985
4439
|
]);
|
|
3986
4440
|
|
|
3987
4441
|
// src/schema/postPurchasePolicy.ts
|
|
3988
|
-
var
|
|
3989
|
-
var HoldSettingSchema =
|
|
3990
|
-
|
|
3991
|
-
|
|
4442
|
+
var import_zod71 = require("zod");
|
|
4443
|
+
var HoldSettingSchema = import_zod71.z.discriminatedUnion("enabled", [
|
|
4444
|
+
import_zod71.z.object({ durationMinutes: import_zod71.z.number().int().min(1).max(60), enabled: import_zod71.z.literal(true) }),
|
|
4445
|
+
import_zod71.z.object({ durationMinutes: import_zod71.z.null(), enabled: import_zod71.z.literal(false) })
|
|
3992
4446
|
]);
|
|
3993
|
-
var TimingSettingsSchema =
|
|
4447
|
+
var TimingSettingsSchema = import_zod71.z.object({ flowHold: HoldSettingSchema, shopHold: HoldSettingSchema });
|
|
3994
4448
|
var SessionPolicySchema = TimingSettingsSchema.extend({
|
|
3995
|
-
durationMinutes:
|
|
3996
|
-
source:
|
|
4449
|
+
durationMinutes: import_zod71.z.number().int().min(1).max(60).nullable(),
|
|
4450
|
+
source: import_zod71.z.enum(["shop", "flow", "native"])
|
|
3997
4451
|
}).refine(
|
|
3998
4452
|
(policy) => {
|
|
3999
4453
|
const expectedSource = policy.shopHold.enabled ? "shop" : policy.flowHold.enabled ? "flow" : "native";
|
|
@@ -4006,73 +4460,22 @@ var SessionPolicySchema = TimingSettingsSchema.extend({
|
|
|
4006
4460
|
}
|
|
4007
4461
|
);
|
|
4008
4462
|
|
|
4009
|
-
// src/schema/
|
|
4010
|
-
var
|
|
4011
|
-
var
|
|
4012
|
-
|
|
4013
|
-
|
|
4014
|
-
|
|
4015
|
-
|
|
4016
|
-
|
|
4017
|
-
|
|
4018
|
-
|
|
4019
|
-
|
|
4020
|
-
|
|
4021
|
-
totalOutstandingSet: MoneyBag,
|
|
4022
|
-
updatedLineItems: import_zod54.z.array(
|
|
4023
|
-
import_zod54.z.object({
|
|
4024
|
-
priceSet: import_zod54.z.unknown().optional(),
|
|
4025
|
-
productId: import_zod54.z.number().int().positive(),
|
|
4026
|
-
sellingPlanId: import_zod54.z.unknown().optional(),
|
|
4027
|
-
variantId: import_zod54.z.number().int().positive()
|
|
4028
|
-
})
|
|
4029
|
-
)
|
|
4030
|
-
}),
|
|
4031
|
-
errors: import_zod54.z.array(import_zod54.z.unknown()).length(0),
|
|
4032
|
-
status: import_zod54.z.literal("processed")
|
|
4033
|
-
});
|
|
4034
|
-
var Minor = import_zod54.z.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER);
|
|
4035
|
-
var PostPurchaseProductCosts = import_zod54.z.object({
|
|
4036
|
-
currencyCode: MoneyBag.shape.presentmentMoney.shape.currencyCode,
|
|
4037
|
-
recurringDisplay: import_zod54.z.object({ shippingMinor: Minor, subtotalMinor: Minor, totalMinor: Minor }).optional(),
|
|
4038
|
-
shippingMinor: Minor,
|
|
4039
|
-
subtotalMinor: Minor,
|
|
4040
|
-
taxesMinor: Minor,
|
|
4041
|
-
totalMinor: Minor
|
|
4042
|
-
});
|
|
4043
|
-
var ChangesetDiscount = import_zod54.z.object({
|
|
4044
|
-
title: import_zod54.z.string(),
|
|
4045
|
-
value: import_zod54.z.number().nonnegative(),
|
|
4046
|
-
valueType: import_zod54.z.enum(["percentage", "fixed_amount"])
|
|
4047
|
-
}).optional();
|
|
4048
|
-
var PostPurchaseProductChangeset = import_zod54.z.object({
|
|
4049
|
-
changes: import_zod54.z.array(
|
|
4050
|
-
import_zod54.z.union([
|
|
4051
|
-
import_zod54.z.object({
|
|
4052
|
-
discount: ChangesetDiscount,
|
|
4053
|
-
quantity: import_zod54.z.number().int().positive(),
|
|
4054
|
-
type: import_zod54.z.literal("add_variant"),
|
|
4055
|
-
variantId: import_zod54.z.number().int().positive()
|
|
4056
|
-
}),
|
|
4057
|
-
import_zod54.z.object({ price: import_zod54.z.number().nonnegative(), title: import_zod54.z.string(), type: import_zod54.z.literal("add_shipping_line") }),
|
|
4058
|
-
PostPurchaseSubscriptionTerms.pick({
|
|
4059
|
-
initialShippingPrice: true,
|
|
4060
|
-
recurringShippingPrice: true,
|
|
4061
|
-
shippingOption: true
|
|
4062
|
-
}).extend({
|
|
4063
|
-
discount: ChangesetDiscount,
|
|
4064
|
-
quantity: import_zod54.z.number().int().positive(),
|
|
4065
|
-
sellingPlanId: import_zod54.z.number().int().positive(),
|
|
4066
|
-
type: import_zod54.z.literal("add_subscription"),
|
|
4067
|
-
variantId: import_zod54.z.number().int().positive()
|
|
4068
|
-
})
|
|
4069
|
-
])
|
|
4070
|
-
)
|
|
4071
|
-
});
|
|
4463
|
+
// src/schema/postPurchasePreparationOptions.ts
|
|
4464
|
+
var import_zod72 = require("zod");
|
|
4465
|
+
var PostPurchasePreparationOptions = import_zod72.z.object({
|
|
4466
|
+
choice: PostPurchaseChoice.optional(),
|
|
4467
|
+
member: PostPurchaseMemberSelector.strict().optional(),
|
|
4468
|
+
quantity: PreparedPostPurchaseProduct.shape.selection.shape.quantity.optional(),
|
|
4469
|
+
selectedProductId: PostPurchaseProductId.optional(),
|
|
4470
|
+
variant: PostPurchaseVariantSelector.optional()
|
|
4471
|
+
}).strict().refine(
|
|
4472
|
+
({ member, quantity: quantity2, selectedProductId, variant: variant2 }) => !variant2 && quantity2 === void 0 && selectedProductId === void 0 || !!member,
|
|
4473
|
+
"Explicit selection requires a member"
|
|
4474
|
+
);
|
|
4072
4475
|
|
|
4073
4476
|
// src/schema/postPurchaseProductSettings.ts
|
|
4074
|
-
var
|
|
4075
|
-
var amount =
|
|
4477
|
+
var import_zod73 = require("zod");
|
|
4478
|
+
var amount = import_zod73.z.union([import_zod73.z.number().nonnegative(), PostPurchaseAmount.transform(Number)]);
|
|
4076
4479
|
var PostPurchaseProductSettings = PostPurchaseSettings.pick({
|
|
4077
4480
|
discountedFrom: true,
|
|
4078
4481
|
language: true,
|
|
@@ -4084,36 +4487,50 @@ var PostPurchaseProductSettings = PostPurchaseSettings.pick({
|
|
|
4084
4487
|
subscriptionIsDefault: true,
|
|
4085
4488
|
upgradeToSubscription: true
|
|
4086
4489
|
}).extend({
|
|
4087
|
-
advance:
|
|
4088
|
-
blocks:
|
|
4490
|
+
advance: import_zod73.z.unknown().default({}),
|
|
4491
|
+
blocks: import_zod73.z.array(import_zod73.z.unknown()).optional(),
|
|
4089
4492
|
discount: PostPurchaseSettings.shape.discount.extend({ amount: amount.default(30) }),
|
|
4090
|
-
integrations:
|
|
4493
|
+
integrations: import_zod73.z.unknown().default({}),
|
|
4091
4494
|
shipping: PostPurchaseSettings.shape.shipping.extend({ amount: amount.default(10) }),
|
|
4092
|
-
styles:
|
|
4495
|
+
styles: import_zod73.z.unknown().default({}),
|
|
4093
4496
|
subImages: PostPurchaseSettings.shape.subImages.catch(null),
|
|
4094
|
-
subscription:
|
|
4497
|
+
subscription: import_zod73.z.unknown().default(PostPurchaseSettings.shape.subscription.parse(void 0))
|
|
4498
|
+
});
|
|
4499
|
+
|
|
4500
|
+
// src/schema/postPurchaseRecovery.ts
|
|
4501
|
+
var import_zod74 = require("zod");
|
|
4502
|
+
var PurchaseRecoveryRequestSchema = DecideRequestSchema.strict();
|
|
4503
|
+
var PurchaseRecoveryResponseSchema = import_zod74.z.object({
|
|
4504
|
+
data: import_zod74.z.object({
|
|
4505
|
+
operation: import_zod74.z.object({
|
|
4506
|
+
observation: RecordedPurchaseObservationSchema.nullable(),
|
|
4507
|
+
operationId: PurchaseReceiptSchema.shape.operationId
|
|
4508
|
+
}).strict().nullable(),
|
|
4509
|
+
progress: PostPurchaseProgressSchema.nullable().optional()
|
|
4510
|
+
}),
|
|
4511
|
+
successful: import_zod74.z.literal(true)
|
|
4095
4512
|
});
|
|
4096
4513
|
|
|
4097
4514
|
// src/schema/postPurchaseSelection.ts
|
|
4098
|
-
var
|
|
4515
|
+
var import_zod75 = require("zod");
|
|
4099
4516
|
var SelectionClaimsSchema = DecideRequestSchema.extend({
|
|
4100
4517
|
appId: PostPurchaseAppIdSchema,
|
|
4101
4518
|
entry: DecisionEntrySchema,
|
|
4102
|
-
iss:
|
|
4103
|
-
purpose:
|
|
4519
|
+
iss: import_zod75.z.literal("rebuy-api"),
|
|
4520
|
+
purpose: import_zod75.z.literal("post-purchase-selection")
|
|
4104
4521
|
});
|
|
4105
4522
|
var SessionStartRequestSchema = DecideRequestSchema.extend({
|
|
4106
|
-
selectionToken:
|
|
4523
|
+
selectionToken: import_zod75.z.string().min(1).max(8192).optional()
|
|
4107
4524
|
}).strict();
|
|
4108
4525
|
|
|
4109
4526
|
// src/schema/postPurchaseSession.ts
|
|
4110
|
-
var
|
|
4527
|
+
var import_zod76 = require("zod");
|
|
4111
4528
|
var SessionIdentitySchema = DecideRequestSchema.extend({ appId: PostPurchaseAppIdSchema });
|
|
4112
|
-
var SessionOrderTimingSchema =
|
|
4529
|
+
var SessionOrderTimingSchema = import_zod76.z.object({
|
|
4113
4530
|
nativeDeadline: PostPurchaseTimestampSchema,
|
|
4114
4531
|
orderCreatedAt: PostPurchaseTimestampSchema,
|
|
4115
4532
|
orderId: PostPurchaseOrderIdSchema,
|
|
4116
|
-
timingSource:
|
|
4533
|
+
timingSource: import_zod76.z.literal("shopify-order-created-at")
|
|
4117
4534
|
});
|
|
4118
4535
|
var ReadySessionTimingSchema = SessionOrderTimingSchema.extend({
|
|
4119
4536
|
deadline: PostPurchaseTimestampSchema,
|
|
@@ -4130,39 +4547,33 @@ var ReadySessionTimingSchema = SessionOrderTimingSchema.extend({
|
|
|
4130
4547
|
message: "deadline must not exceed nativeDeadline",
|
|
4131
4548
|
path: ["deadline"]
|
|
4132
4549
|
});
|
|
4133
|
-
var SessionStartResponseSchema =
|
|
4134
|
-
data:
|
|
4135
|
-
phase:
|
|
4550
|
+
var SessionStartResponseSchema = import_zod76.z.object({
|
|
4551
|
+
data: import_zod76.z.object({
|
|
4552
|
+
phase: import_zod76.z.literal("render"),
|
|
4136
4553
|
serverNow: PostPurchaseTimestampSchema,
|
|
4137
4554
|
session: ReadySessionTimingSchema,
|
|
4138
|
-
workflowPhase:
|
|
4555
|
+
workflowPhase: import_zod76.z.literal("start")
|
|
4139
4556
|
}),
|
|
4140
|
-
successful:
|
|
4557
|
+
successful: import_zod76.z.literal(true)
|
|
4141
4558
|
});
|
|
4142
4559
|
|
|
4143
|
-
// src/schema/postPurchaseSessionClose.ts
|
|
4144
|
-
var import_zod58 = require("zod");
|
|
4145
|
-
var SessionClosureSchema = import_zod58.z.object({ closedAt: PostPurchaseTimestampSchema, status: import_zod58.z.literal("closed") });
|
|
4146
|
-
var SessionCloseRequestSchema = DecideRequestSchema.strict();
|
|
4147
|
-
var SessionCloseResponseSchema = import_zod58.z.object({ data: SessionClosureSchema, successful: import_zod58.z.literal(true) });
|
|
4148
|
-
|
|
4149
4560
|
// src/schema/postPurchaseShadow.ts
|
|
4150
|
-
var
|
|
4151
|
-
var PostPurchaseShadowSelectionSchema =
|
|
4152
|
-
|
|
4153
|
-
|
|
4561
|
+
var import_zod77 = require("zod");
|
|
4562
|
+
var PostPurchaseShadowSelectionSchema = import_zod77.z.discriminatedUnion("verdict", [
|
|
4563
|
+
import_zod77.z.object({ entry: DecisionEntrySchema, verdict: import_zod77.z.literal("render") }),
|
|
4564
|
+
import_zod77.z.object({ verdict: import_zod77.z.literal("skip") })
|
|
4154
4565
|
]);
|
|
4155
|
-
var PostPurchaseShadowReportFields =
|
|
4156
|
-
differences:
|
|
4566
|
+
var PostPurchaseShadowReportFields = import_zod77.z.object({
|
|
4567
|
+
differences: import_zod77.z.array(import_zod77.z.enum(["verdict", "entry", "targeting", "incomplete-capture", "unsupported-configuration"])).refine((differences) => new Set(differences).size === differences.length, {
|
|
4157
4568
|
message: "differences must not contain duplicate entries"
|
|
4158
4569
|
}),
|
|
4159
4570
|
legacySelection: PostPurchaseShadowSelectionSchema,
|
|
4160
|
-
phase:
|
|
4161
|
-
sampleId:
|
|
4571
|
+
phase: import_zod77.z.literal("shouldRender"),
|
|
4572
|
+
sampleId: import_zod77.z.string(),
|
|
4162
4573
|
serverSelection: PostPurchaseShadowSelectionSchema.optional(),
|
|
4163
|
-
status:
|
|
4164
|
-
targetingFlowIds:
|
|
4165
|
-
workflowPhase:
|
|
4574
|
+
status: import_zod77.z.enum(["match", "diverged", "incomplete"]),
|
|
4575
|
+
targetingFlowIds: import_zod77.z.array(import_zod77.z.number().int().positive()),
|
|
4576
|
+
workflowPhase: import_zod77.z.literal("decide")
|
|
4166
4577
|
});
|
|
4167
4578
|
var PostPurchaseShadowReportSchema = PostPurchaseShadowReportFields.refine(
|
|
4168
4579
|
(report) => report.status !== "match" || report.differences.length === 0,
|
|
@@ -4175,31 +4586,21 @@ var PostPurchaseShadowReportSchema = PostPurchaseShadowReportFields.refine(
|
|
|
4175
4586
|
path: ["status"]
|
|
4176
4587
|
});
|
|
4177
4588
|
|
|
4178
|
-
// src/schema/postPurchaseSkipTrace.ts
|
|
4179
|
-
var import_zod60 = require("zod");
|
|
4180
|
-
var POST_PURCHASE_SKIP_LIMIT = 32;
|
|
4181
|
-
var PostPurchaseSkipTraceSchema = import_zod60.z.array(
|
|
4182
|
-
import_zod60.z.object({
|
|
4183
|
-
entry: DecisionEntrySchema,
|
|
4184
|
-
reason: PostPurchaseSkipReasonSchema
|
|
4185
|
-
})
|
|
4186
|
-
).max(POST_PURCHASE_SKIP_LIMIT);
|
|
4187
|
-
|
|
4188
4589
|
// src/schema/postPurchaseSubscriptionDisplay.ts
|
|
4189
|
-
var
|
|
4190
|
-
var Minor2 =
|
|
4191
|
-
var PostPurchaseSubscriptionDisplay =
|
|
4590
|
+
var import_zod78 = require("zod");
|
|
4591
|
+
var Minor2 = import_zod78.z.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER);
|
|
4592
|
+
var PostPurchaseSubscriptionDisplay = import_zod78.z.object({
|
|
4192
4593
|
comparisonMinor: Minor2,
|
|
4193
|
-
currencyCode:
|
|
4594
|
+
currencyCode: import_zod78.z.string().regex(/^[A-Z]{3}$/),
|
|
4194
4595
|
priceMinor: Minor2,
|
|
4195
4596
|
savingMinor: Minor2,
|
|
4196
|
-
savingPercent:
|
|
4597
|
+
savingPercent: import_zod78.z.number().int().min(0).max(100)
|
|
4197
4598
|
});
|
|
4198
4599
|
|
|
4199
4600
|
// src/schema/postPurchaseSubscriptionProduct.ts
|
|
4200
|
-
var
|
|
4601
|
+
var import_zod79 = require("zod");
|
|
4201
4602
|
var PreparedPostPurchaseSubscription = PreparedPostPurchaseProduct.extend({
|
|
4202
|
-
selection: PreparedPostPurchaseProduct.shape.selection.extend({ sellingPlanId:
|
|
4603
|
+
selection: PreparedPostPurchaseProduct.shape.selection.extend({ sellingPlanId: import_zod79.z.number().int().positive() }),
|
|
4203
4604
|
terms: PreparedPostPurchaseProduct.shape.terms.extend({
|
|
4204
4605
|
subscription: PostPurchaseSubscriptionTerms
|
|
4205
4606
|
}).refine(
|
|
@@ -4211,94 +4612,109 @@ var readPostPurchaseSubscription = (prepared) => {
|
|
|
4211
4612
|
return PreparedPostPurchaseSubscription.parse(prepared);
|
|
4212
4613
|
};
|
|
4213
4614
|
|
|
4615
|
+
// src/schema/postPurchaseTransition.ts
|
|
4616
|
+
var import_zod80 = require("zod");
|
|
4617
|
+
var OfferTransitionRequestSchema = DecideRequestSchema.extend({
|
|
4618
|
+
entryRevision: PostPurchaseProgressSchema.shape.entryRevision,
|
|
4619
|
+
progressRevision: PostPurchaseProgressSchema.shape.revision
|
|
4620
|
+
}).strict();
|
|
4621
|
+
var OfferTransitionResponseSchema = import_zod80.z.object({
|
|
4622
|
+
data: import_zod80.z.object({
|
|
4623
|
+
attemptedSkips: PostPurchaseSkipTraceSchema.optional(),
|
|
4624
|
+
progress: PostPurchaseProgressSchema,
|
|
4625
|
+
status: import_zod80.z.enum(["advanced", "no-child", "unavailable"])
|
|
4626
|
+
}),
|
|
4627
|
+
successful: import_zod80.z.literal(true)
|
|
4628
|
+
});
|
|
4629
|
+
|
|
4214
4630
|
// src/schema/postPurchaseVariantDefault.ts
|
|
4215
|
-
var
|
|
4631
|
+
var import_zod81 = require("zod");
|
|
4216
4632
|
var values = PostPurchaseVariantValues.partial().extend({
|
|
4217
4633
|
option1: PostPurchaseVariantValues.shape.option1.nullish()
|
|
4218
4634
|
});
|
|
4219
4635
|
var variant = values.extend({
|
|
4220
4636
|
id: PostPurchaseVariantId,
|
|
4221
|
-
inventoryManagement:
|
|
4222
|
-
inventoryPolicy:
|
|
4223
|
-
inventoryQuantity:
|
|
4637
|
+
inventoryManagement: import_zod81.z.string().nullable(),
|
|
4638
|
+
inventoryPolicy: import_zod81.z.string(),
|
|
4639
|
+
inventoryQuantity: import_zod81.z.number()
|
|
4224
4640
|
});
|
|
4225
|
-
var options =
|
|
4226
|
-
var PostPurchaseVariantDefaultProduct =
|
|
4641
|
+
var options = import_zod81.z.array(PostPurchaseVariantOption.pick({ name: true, values: true }));
|
|
4642
|
+
var PostPurchaseVariantDefaultProduct = import_zod81.z.object({
|
|
4227
4643
|
id: PostPurchaseProductId,
|
|
4228
4644
|
options,
|
|
4229
4645
|
selectedVariant: variant.optional(),
|
|
4230
|
-
variants:
|
|
4646
|
+
variants: import_zod81.z.array(variant)
|
|
4231
4647
|
});
|
|
4232
4648
|
var PostPurchaseVariantDefaultSettings = PostPurchaseSettings.shape.productOptions.pick({
|
|
4233
4649
|
hideOutOfStockVariants: true,
|
|
4234
4650
|
matchVariant: true
|
|
4235
4651
|
});
|
|
4236
|
-
var PostPurchaseOrderAttributes =
|
|
4237
|
-
var PostPurchaseOriginalVariants =
|
|
4238
|
-
|
|
4652
|
+
var PostPurchaseOrderAttributes = import_zod81.z.record(import_zod81.z.string(), import_zod81.z.array(import_zod81.z.string())).default({});
|
|
4653
|
+
var PostPurchaseOriginalVariants = import_zod81.z.array(
|
|
4654
|
+
import_zod81.z.object({ productId: PostPurchaseProductId, variantId: PostPurchaseVariantId })
|
|
4239
4655
|
);
|
|
4240
|
-
var PostPurchaseAttributeProducts =
|
|
4241
|
-
|
|
4656
|
+
var PostPurchaseAttributeProducts = import_zod81.z.array(
|
|
4657
|
+
import_zod81.z.object({ id: PostPurchaseProductId, options, variants: import_zod81.z.array(values.extend({ id: PostPurchaseVariantId })) })
|
|
4242
4658
|
);
|
|
4243
4659
|
|
|
4244
4660
|
// src/schema/postPurchaseVariantDefaultContext.ts
|
|
4245
|
-
var
|
|
4246
|
-
var PostPurchaseVariantDefaultContext =
|
|
4247
|
-
enrichedLineItems:
|
|
4661
|
+
var import_zod82 = require("zod");
|
|
4662
|
+
var PostPurchaseVariantDefaultContext = import_zod82.z.object({
|
|
4663
|
+
enrichedLineItems: import_zod82.z.unknown().optional(),
|
|
4248
4664
|
originalVariants: PostPurchaseOriginalVariants
|
|
4249
4665
|
});
|
|
4250
4666
|
|
|
4251
4667
|
// src/schema/shopConfig.ts
|
|
4252
|
-
var
|
|
4253
|
-
var ShopConfig =
|
|
4254
|
-
activeExperiments:
|
|
4255
|
-
|
|
4256
|
-
data:
|
|
4257
|
-
|
|
4258
|
-
aliasName:
|
|
4259
|
-
cssInput:
|
|
4260
|
-
elementId:
|
|
4261
|
-
id:
|
|
4262
|
-
javascriptInput:
|
|
4263
|
-
traffic:
|
|
4668
|
+
var import_zod83 = require("zod");
|
|
4669
|
+
var ShopConfig = import_zod83.z.object({
|
|
4670
|
+
activeExperiments: import_zod83.z.array(
|
|
4671
|
+
import_zod83.z.object({
|
|
4672
|
+
data: import_zod83.z.array(
|
|
4673
|
+
import_zod83.z.object({
|
|
4674
|
+
aliasName: import_zod83.z.string(),
|
|
4675
|
+
cssInput: import_zod83.z.string().nullish(),
|
|
4676
|
+
elementId: import_zod83.z.coerce.number(),
|
|
4677
|
+
id: import_zod83.z.coerce.number(),
|
|
4678
|
+
javascriptInput: import_zod83.z.string().nullish(),
|
|
4679
|
+
traffic: import_zod83.z.coerce.number()
|
|
4264
4680
|
})
|
|
4265
4681
|
),
|
|
4266
|
-
id:
|
|
4267
|
-
name:
|
|
4268
|
-
pageTarget:
|
|
4269
|
-
pageTargetUrl:
|
|
4270
|
-
placeholderId:
|
|
4271
|
-
type:
|
|
4682
|
+
id: import_zod83.z.coerce.number(),
|
|
4683
|
+
name: import_zod83.z.string(),
|
|
4684
|
+
pageTarget: import_zod83.z.string().nullable(),
|
|
4685
|
+
pageTargetUrl: import_zod83.z.string().nullable(),
|
|
4686
|
+
placeholderId: import_zod83.z.coerce.number().nullable(),
|
|
4687
|
+
type: import_zod83.z.string()
|
|
4272
4688
|
})
|
|
4273
4689
|
),
|
|
4274
|
-
activePackages:
|
|
4275
|
-
|
|
4276
|
-
cancelledAt:
|
|
4277
|
-
id:
|
|
4278
|
-
installedAt:
|
|
4279
|
-
isActive:
|
|
4280
|
-
isBillable:
|
|
4281
|
-
packageId:
|
|
4282
|
-
packageName:
|
|
4283
|
-
shortName:
|
|
4284
|
-
trialDays:
|
|
4285
|
-
uninstalledAt:
|
|
4690
|
+
activePackages: import_zod83.z.array(
|
|
4691
|
+
import_zod83.z.object({
|
|
4692
|
+
cancelledAt: import_zod83.z.string().nullable(),
|
|
4693
|
+
id: import_zod83.z.number(),
|
|
4694
|
+
installedAt: import_zod83.z.string().nullable(),
|
|
4695
|
+
isActive: import_zod83.z.boolean(),
|
|
4696
|
+
isBillable: import_zod83.z.boolean(),
|
|
4697
|
+
packageId: import_zod83.z.number(),
|
|
4698
|
+
packageName: import_zod83.z.string(),
|
|
4699
|
+
shortName: import_zod83.z.string(),
|
|
4700
|
+
trialDays: import_zod83.z.number(),
|
|
4701
|
+
uninstalledAt: import_zod83.z.string().nullable()
|
|
4286
4702
|
})
|
|
4287
4703
|
),
|
|
4288
|
-
apiKey:
|
|
4289
|
-
billingVersion:
|
|
4290
|
-
cacheKey:
|
|
4291
|
-
carousel:
|
|
4292
|
-
currency:
|
|
4293
|
-
currencySymbol:
|
|
4294
|
-
domain:
|
|
4295
|
-
enabledJquery:
|
|
4296
|
-
enabledPresentmentCurrencies:
|
|
4297
|
-
hasSmartCollectionsEnabled:
|
|
4298
|
-
hasSmartSearchEnabled:
|
|
4299
|
-
id:
|
|
4300
|
-
integrations:
|
|
4301
|
-
|
|
4704
|
+
apiKey: import_zod83.z.string(),
|
|
4705
|
+
billingVersion: import_zod83.z.string().nullable(),
|
|
4706
|
+
cacheKey: import_zod83.z.coerce.number(),
|
|
4707
|
+
carousel: import_zod83.z.enum(["flickity", "splide"]),
|
|
4708
|
+
currency: import_zod83.z.string(),
|
|
4709
|
+
currencySymbol: import_zod83.z.string(),
|
|
4710
|
+
domain: import_zod83.z.string(),
|
|
4711
|
+
enabledJquery: import_zod83.z.boolean(),
|
|
4712
|
+
enabledPresentmentCurrencies: import_zod83.z.array(import_zod83.z.string()),
|
|
4713
|
+
hasSmartCollectionsEnabled: import_zod83.z.boolean(),
|
|
4714
|
+
hasSmartSearchEnabled: import_zod83.z.boolean(),
|
|
4715
|
+
id: import_zod83.z.coerce.number(),
|
|
4716
|
+
integrations: import_zod83.z.record(
|
|
4717
|
+
import_zod83.z.enum([
|
|
4302
4718
|
"attentive",
|
|
4303
4719
|
"judgeme",
|
|
4304
4720
|
"junip",
|
|
@@ -4311,170 +4727,170 @@ var ShopConfig = import_zod65.z.object({
|
|
|
4311
4727
|
"stamped",
|
|
4312
4728
|
"yotpo"
|
|
4313
4729
|
]),
|
|
4314
|
-
|
|
4730
|
+
import_zod83.z.union([import_zod83.z.boolean(), import_zod83.z.unknown()])
|
|
4315
4731
|
),
|
|
4316
|
-
markets:
|
|
4317
|
-
enabled:
|
|
4732
|
+
markets: import_zod83.z.object({
|
|
4733
|
+
enabled: import_zod83.z.boolean()
|
|
4318
4734
|
}),
|
|
4319
|
-
monetize:
|
|
4320
|
-
publisherKey:
|
|
4735
|
+
monetize: import_zod83.z.object({
|
|
4736
|
+
publisherKey: import_zod83.z.string().nullable()
|
|
4321
4737
|
}).nullish(),
|
|
4322
|
-
moneyFormat:
|
|
4323
|
-
myshopifyDomain:
|
|
4324
|
-
primaryLocale:
|
|
4325
|
-
productGroupsEnabled:
|
|
4326
|
-
rechargeCustomDomain:
|
|
4327
|
-
sellingPlansEnabled:
|
|
4328
|
-
shopId:
|
|
4329
|
-
shopifySellingPlansEnabled:
|
|
4330
|
-
shopName:
|
|
4331
|
-
storefrontAccessToken:
|
|
4332
|
-
useRebuyIcons:
|
|
4738
|
+
moneyFormat: import_zod83.z.string(),
|
|
4739
|
+
myshopifyDomain: import_zod83.z.string(),
|
|
4740
|
+
primaryLocale: import_zod83.z.string(),
|
|
4741
|
+
productGroupsEnabled: import_zod83.z.enum(["no", "yes"]).transform((value) => value === "yes"),
|
|
4742
|
+
rechargeCustomDomain: import_zod83.z.string().nullable(),
|
|
4743
|
+
sellingPlansEnabled: import_zod83.z.boolean(),
|
|
4744
|
+
shopId: import_zod83.z.number(),
|
|
4745
|
+
shopifySellingPlansEnabled: import_zod83.z.boolean(),
|
|
4746
|
+
shopName: import_zod83.z.string(),
|
|
4747
|
+
storefrontAccessToken: import_zod83.z.string().nullable(),
|
|
4748
|
+
useRebuyIcons: import_zod83.z.boolean()
|
|
4333
4749
|
});
|
|
4334
4750
|
|
|
4335
4751
|
// src/schema/userConfig.ts
|
|
4336
|
-
var
|
|
4337
|
-
var UserConfig =
|
|
4752
|
+
var import_zod84 = require("zod");
|
|
4753
|
+
var UserConfig = import_zod84.z.object({
|
|
4338
4754
|
shop: ShopConfig,
|
|
4339
4755
|
/**
|
|
4340
4756
|
* `.catch(undefined)` is the safety bar: smart-cart shape drift can NEVER fail `fetchUserConfig`,
|
|
4341
4757
|
* which resolves the apiKey for every offers/monetize/analytics/gift request.
|
|
4342
4758
|
*/
|
|
4343
4759
|
smartCart: SmartCartConfig.nullish().catch(void 0),
|
|
4344
|
-
smartFlows:
|
|
4760
|
+
smartFlows: import_zod84.z.array(import_zod84.z.unknown())
|
|
4345
4761
|
});
|
|
4346
4762
|
|
|
4347
4763
|
// src/schema/widgetData.ts
|
|
4348
|
-
var
|
|
4764
|
+
var import_zod93 = require("zod");
|
|
4349
4765
|
|
|
4350
4766
|
// src/schema/widgets/abTestingPlaceholder.ts
|
|
4351
|
-
var
|
|
4352
|
-
var ABTestingPlaceholder =
|
|
4353
|
-
type:
|
|
4767
|
+
var import_zod85 = require("zod");
|
|
4768
|
+
var ABTestingPlaceholder = import_zod85.z.looseObject({
|
|
4769
|
+
type: import_zod85.z.literal("placeholder")
|
|
4354
4770
|
});
|
|
4355
4771
|
|
|
4356
4772
|
// src/schema/widgets/checkoutExtension.ts
|
|
4357
|
-
var
|
|
4358
|
-
var CheckoutExtension =
|
|
4359
|
-
type:
|
|
4773
|
+
var import_zod86 = require("zod");
|
|
4774
|
+
var CheckoutExtension = import_zod86.z.looseObject({
|
|
4775
|
+
type: import_zod86.z.literal(WidgetType.shopify_checkout_extension).default(WidgetType.shopify_checkout_extension)
|
|
4360
4776
|
});
|
|
4361
4777
|
|
|
4362
4778
|
// src/schema/widgets/contentBlock.ts
|
|
4363
|
-
var
|
|
4364
|
-
var ContentBlockV1 =
|
|
4365
|
-
blockSpacing:
|
|
4366
|
-
imageBlocks:
|
|
4367
|
-
|
|
4368
|
-
|
|
4369
|
-
altText:
|
|
4370
|
-
description:
|
|
4371
|
-
id:
|
|
4372
|
-
imagePlacement:
|
|
4373
|
-
imageSize:
|
|
4374
|
-
imageUrl:
|
|
4375
|
-
textAlignment:
|
|
4779
|
+
var import_zod87 = require("zod");
|
|
4780
|
+
var ContentBlockV1 = import_zod87.z.object({
|
|
4781
|
+
blockSpacing: import_zod87.z.enum(spacings).optional(),
|
|
4782
|
+
imageBlocks: import_zod87.z.union([
|
|
4783
|
+
import_zod87.z.array(
|
|
4784
|
+
import_zod87.z.object({
|
|
4785
|
+
altText: import_zod87.z.string().nullable(),
|
|
4786
|
+
description: import_zod87.z.string().nullable(),
|
|
4787
|
+
id: import_zod87.z.uuid(),
|
|
4788
|
+
imagePlacement: import_zod87.z.enum(["top", "right", "bottom", "left"]),
|
|
4789
|
+
imageSize: import_zod87.z.number(),
|
|
4790
|
+
imageUrl: import_zod87.z.url(),
|
|
4791
|
+
textAlignment: import_zod87.z.enum(["left", "center", "right"]),
|
|
4376
4792
|
/** Inline scale only: an image caption can never be a block-level heading. */
|
|
4377
|
-
textSize:
|
|
4793
|
+
textSize: import_zod87.z.enum(inlineTextSizeNames)
|
|
4378
4794
|
})
|
|
4379
4795
|
),
|
|
4380
|
-
|
|
4796
|
+
import_zod87.z.strictObject({}).transform(() => [])
|
|
4381
4797
|
]).optional(),
|
|
4382
|
-
imageLayout:
|
|
4383
|
-
language:
|
|
4384
|
-
description:
|
|
4385
|
-
superTitle:
|
|
4386
|
-
title:
|
|
4798
|
+
imageLayout: import_zod87.z.enum(["row", "column"]).optional(),
|
|
4799
|
+
language: import_zod87.z.object({
|
|
4800
|
+
description: import_zod87.z.string(),
|
|
4801
|
+
superTitle: import_zod87.z.string(),
|
|
4802
|
+
title: import_zod87.z.string()
|
|
4387
4803
|
}),
|
|
4388
|
-
previewMode:
|
|
4389
|
-
type:
|
|
4390
|
-
version:
|
|
4804
|
+
previewMode: import_zod87.z.boolean(),
|
|
4805
|
+
type: import_zod87.z.literal(WidgetType.ui_extension_content_block).default(WidgetType.ui_extension_content_block),
|
|
4806
|
+
version: import_zod87.z.literal(1)
|
|
4391
4807
|
});
|
|
4392
|
-
var ContentBlock =
|
|
4808
|
+
var ContentBlock = import_zod87.z.discriminatedUnion("version", [
|
|
4393
4809
|
ContentBlockV1,
|
|
4394
4810
|
CABRootSection.extend({
|
|
4395
|
-
type:
|
|
4811
|
+
type: import_zod87.z.literal(WidgetType.ui_extension_content_block).default(WidgetType.ui_extension_content_block)
|
|
4396
4812
|
})
|
|
4397
4813
|
]);
|
|
4398
4814
|
|
|
4399
4815
|
// src/schema/widgets/giftWithPurchase.ts
|
|
4400
|
-
var
|
|
4401
|
-
var GiftWithPurchase =
|
|
4402
|
-
type:
|
|
4816
|
+
var import_zod88 = require("zod");
|
|
4817
|
+
var GiftWithPurchase = import_zod88.z.looseObject({
|
|
4818
|
+
type: import_zod88.z.literal(WidgetType.gift_with_purchase).default(WidgetType.gift_with_purchase)
|
|
4403
4819
|
});
|
|
4404
4820
|
|
|
4405
4821
|
// src/schema/widgets/lineItemEditor.ts
|
|
4406
|
-
var
|
|
4407
|
-
var LineItemEditorSwitchLanguageV1 =
|
|
4408
|
-
downgradeToOneTimeLabel:
|
|
4822
|
+
var import_zod89 = require("zod");
|
|
4823
|
+
var LineItemEditorSwitchLanguageV1 = import_zod89.z.object({
|
|
4824
|
+
downgradeToOneTimeLabel: import_zod89.z.string().optional(),
|
|
4409
4825
|
/** Frequency-option template (`{{frequency}}`/`{{interval}}`) for the plan select. */
|
|
4410
|
-
subscriptionOptionLabel:
|
|
4411
|
-
upgradeToSubscriptionLabel:
|
|
4412
|
-
upgradeToSubscriptionWithoutDiscountLabel:
|
|
4826
|
+
subscriptionOptionLabel: import_zod89.z.string().optional(),
|
|
4827
|
+
upgradeToSubscriptionLabel: import_zod89.z.string().optional(),
|
|
4828
|
+
upgradeToSubscriptionWithoutDiscountLabel: import_zod89.z.string().optional()
|
|
4413
4829
|
});
|
|
4414
|
-
var LineItemEditorV1 =
|
|
4830
|
+
var LineItemEditorV1 = import_zod89.z.object({
|
|
4415
4831
|
/** Legacy `getStyles` button style; the converter carries a valid kind, defaulting to `plain`. */
|
|
4416
|
-
button:
|
|
4417
|
-
previewMode:
|
|
4418
|
-
switchToSubscription:
|
|
4419
|
-
disableDowngrade:
|
|
4832
|
+
button: import_zod89.z.object({ kind: import_zod89.z.enum(["plain", "primary", "secondary"]).optional() }).optional(),
|
|
4833
|
+
previewMode: import_zod89.z.boolean().optional(),
|
|
4834
|
+
switchToSubscription: import_zod89.z.object({
|
|
4835
|
+
disableDowngrade: import_zod89.z.boolean().optional(),
|
|
4420
4836
|
language: LineItemEditorSwitchLanguageV1.optional()
|
|
4421
4837
|
}).optional(),
|
|
4422
|
-
switchToSubscriptionEnabled:
|
|
4423
|
-
tracking:
|
|
4424
|
-
enableAttribution:
|
|
4425
|
-
enableSource:
|
|
4426
|
-
enableWidget:
|
|
4838
|
+
switchToSubscriptionEnabled: import_zod89.z.boolean().optional(),
|
|
4839
|
+
tracking: import_zod89.z.object({
|
|
4840
|
+
enableAttribution: import_zod89.z.boolean().optional(),
|
|
4841
|
+
enableSource: import_zod89.z.boolean().optional(),
|
|
4842
|
+
enableWidget: import_zod89.z.boolean().optional()
|
|
4427
4843
|
}).optional(),
|
|
4428
|
-
type:
|
|
4429
|
-
version:
|
|
4844
|
+
type: import_zod89.z.literal(WidgetType.ui_extension_line_item_editor).default(WidgetType.ui_extension_line_item_editor),
|
|
4845
|
+
version: import_zod89.z.literal(1)
|
|
4430
4846
|
});
|
|
4431
|
-
var LineItemEditor =
|
|
4847
|
+
var LineItemEditor = import_zod89.z.discriminatedUnion("version", [
|
|
4432
4848
|
LineItemEditorV1,
|
|
4433
4849
|
CABRootSection.extend({
|
|
4434
|
-
type:
|
|
4850
|
+
type: import_zod89.z.literal(WidgetType.ui_extension_line_item_editor).default(WidgetType.ui_extension_line_item_editor)
|
|
4435
4851
|
})
|
|
4436
4852
|
]);
|
|
4437
4853
|
|
|
4438
4854
|
// src/schema/widgets/progressBar.ts
|
|
4439
|
-
var
|
|
4440
|
-
var ProgressBar =
|
|
4441
|
-
type:
|
|
4855
|
+
var import_zod90 = require("zod");
|
|
4856
|
+
var ProgressBar = import_zod90.z.looseObject({
|
|
4857
|
+
type: import_zod90.z.literal(WidgetType.ui_extension_progress_bar).default(WidgetType.ui_extension_progress_bar)
|
|
4442
4858
|
});
|
|
4443
4859
|
|
|
4444
4860
|
// src/schema/widgets/rebuyButton.ts
|
|
4445
|
-
var
|
|
4446
|
-
var RebuyButtonV1 =
|
|
4447
|
-
type:
|
|
4448
|
-
version:
|
|
4861
|
+
var import_zod91 = require("zod");
|
|
4862
|
+
var RebuyButtonV1 = import_zod91.z.looseObject({
|
|
4863
|
+
type: import_zod91.z.literal(WidgetType.ui_extension_button).default(WidgetType.ui_extension_button),
|
|
4864
|
+
version: import_zod91.z.literal(1)
|
|
4449
4865
|
});
|
|
4450
|
-
var RebuyButton =
|
|
4866
|
+
var RebuyButton = import_zod91.z.discriminatedUnion("version", [
|
|
4451
4867
|
RebuyButtonV1,
|
|
4452
4868
|
CABRootSection.extend({
|
|
4453
|
-
type:
|
|
4869
|
+
type: import_zod91.z.literal(WidgetType.ui_extension_button).default(WidgetType.ui_extension_button)
|
|
4454
4870
|
})
|
|
4455
4871
|
]);
|
|
4456
4872
|
|
|
4457
4873
|
// src/schema/widgets/rebuyMonetize.ts
|
|
4458
|
-
var
|
|
4459
|
-
var RebuyMonetize =
|
|
4460
|
-
type:
|
|
4874
|
+
var import_zod92 = require("zod");
|
|
4875
|
+
var RebuyMonetize = import_zod92.z.looseObject({
|
|
4876
|
+
type: import_zod92.z.literal(WidgetType.ui_extension_ad).default(WidgetType.ui_extension_ad)
|
|
4461
4877
|
});
|
|
4462
|
-
var RebuyMonetizeV1 =
|
|
4463
|
-
name:
|
|
4464
|
-
previewMode:
|
|
4878
|
+
var RebuyMonetizeV1 = import_zod92.z.object({
|
|
4879
|
+
name: import_zod92.z.string().nullable().optional(),
|
|
4880
|
+
previewMode: import_zod92.z.boolean().optional(),
|
|
4465
4881
|
/** Privacy Policy footer href → the marker section's `privacyPolicyUrl`. */
|
|
4466
|
-
privacyPolicyUrl:
|
|
4882
|
+
privacyPolicyUrl: import_zod92.z.string().nullable().optional(),
|
|
4467
4883
|
/** Ads-taxonomy sub-vertical id — one of the admin Monetize editor's two configurables. */
|
|
4468
|
-
subVertical:
|
|
4469
|
-
tracking:
|
|
4470
|
-
enableAttribution:
|
|
4471
|
-
enableSource:
|
|
4472
|
-
enableWidget:
|
|
4884
|
+
subVertical: import_zod92.z.string().nullable().optional(),
|
|
4885
|
+
tracking: import_zod92.z.object({
|
|
4886
|
+
enableAttribution: import_zod92.z.boolean().optional(),
|
|
4887
|
+
enableSource: import_zod92.z.boolean().optional(),
|
|
4888
|
+
enableWidget: import_zod92.z.boolean().optional()
|
|
4473
4889
|
}).optional(),
|
|
4474
|
-
type:
|
|
4475
|
-
version:
|
|
4890
|
+
type: import_zod92.z.literal(WidgetType.ui_extension_ad).default(WidgetType.ui_extension_ad),
|
|
4891
|
+
version: import_zod92.z.literal(1),
|
|
4476
4892
|
/** Ads-taxonomy vertical id — one of the admin Monetize editor's two configurables. */
|
|
4477
|
-
vertical:
|
|
4893
|
+
vertical: import_zod92.z.string().nullable().optional()
|
|
4478
4894
|
});
|
|
4479
4895
|
|
|
4480
4896
|
// src/schema/widgetData.ts
|
|
@@ -4488,7 +4904,7 @@ var extensionWidgetTypes = [
|
|
|
4488
4904
|
WidgetType.ui_extension_line_item_editor,
|
|
4489
4905
|
WidgetType.ui_extension_progress_bar
|
|
4490
4906
|
];
|
|
4491
|
-
var WidgetData =
|
|
4907
|
+
var WidgetData = import_zod93.z.discriminatedUnion("type", [
|
|
4492
4908
|
ABTestingPlaceholder,
|
|
4493
4909
|
CheckoutExtension,
|
|
4494
4910
|
ContentBlock,
|
|
@@ -4848,36 +5264,36 @@ var SWITCH_LABELS = {
|
|
|
4848
5264
|
};
|
|
4849
5265
|
|
|
4850
5266
|
// src/schema/widgets/post-purchase-offer/postPurchaseOffer.ts
|
|
4851
|
-
var
|
|
5267
|
+
var import_zod95 = require("zod");
|
|
4852
5268
|
|
|
4853
5269
|
// src/schema/widgets/post-purchase-offer/postPurchaseWidget.ts
|
|
4854
|
-
var
|
|
4855
|
-
var PostPurchaseWidgetLinkedFlow =
|
|
4856
|
-
id:
|
|
4857
|
-
name:
|
|
4858
|
-
});
|
|
4859
|
-
var PostPurchaseWidget =
|
|
4860
|
-
classification:
|
|
4861
|
-
createdAtTime:
|
|
4862
|
-
customEndpointName:
|
|
4863
|
-
id:
|
|
4864
|
-
lastViewed:
|
|
4865
|
-
linkedCustomEndpointId:
|
|
4866
|
-
linkedFlows:
|
|
4867
|
-
name:
|
|
4868
|
-
owner:
|
|
5270
|
+
var import_zod94 = require("zod");
|
|
5271
|
+
var PostPurchaseWidgetLinkedFlow = import_zod94.z.object({
|
|
5272
|
+
id: import_zod94.z.number(),
|
|
5273
|
+
name: import_zod94.z.string()
|
|
5274
|
+
});
|
|
5275
|
+
var PostPurchaseWidget = import_zod94.z.object({
|
|
5276
|
+
classification: import_zod94.z.literal("post_purchase_offer_page").default("post_purchase_offer_page"),
|
|
5277
|
+
createdAtTime: import_zod94.z.iso.datetime({ offset: true }).optional(),
|
|
5278
|
+
customEndpointName: import_zod94.z.string().nullish(),
|
|
5279
|
+
id: import_zod94.z.number().default(0),
|
|
5280
|
+
lastViewed: import_zod94.z.iso.datetime({ offset: true }).nullish(),
|
|
5281
|
+
linkedCustomEndpointId: import_zod94.z.number().nullish(),
|
|
5282
|
+
linkedFlows: import_zod94.z.array(PostPurchaseWidgetLinkedFlow).optional(),
|
|
5283
|
+
name: import_zod94.z.string().default(""),
|
|
5284
|
+
owner: import_zod94.z.number().nullish(),
|
|
4869
5285
|
settings: PostPurchaseSettings
|
|
4870
5286
|
});
|
|
4871
5287
|
|
|
4872
5288
|
// src/schema/widgets/post-purchase-offer/postPurchaseOffer.ts
|
|
4873
|
-
var PostPurchaseOffer =
|
|
4874
|
-
|
|
4875
|
-
errors:
|
|
4876
|
-
message:
|
|
4877
|
-
successful:
|
|
5289
|
+
var PostPurchaseOffer = import_zod95.z.discriminatedUnion("successful", [
|
|
5290
|
+
import_zod95.z.strictObject({
|
|
5291
|
+
errors: import_zod95.z.array(import_zod95.z.object({ message: import_zod95.z.string() })),
|
|
5292
|
+
message: import_zod95.z.string(),
|
|
5293
|
+
successful: import_zod95.z.literal(false)
|
|
4878
5294
|
}),
|
|
4879
|
-
|
|
4880
|
-
successful:
|
|
5295
|
+
import_zod95.z.strictObject({
|
|
5296
|
+
successful: import_zod95.z.literal(true),
|
|
4881
5297
|
widget: PostPurchaseWidget
|
|
4882
5298
|
})
|
|
4883
5299
|
]);
|
|
@@ -5952,6 +6368,46 @@ var convertOfferToV2 = ({ id, name, settings }) => {
|
|
|
5952
6368
|
});
|
|
5953
6369
|
};
|
|
5954
6370
|
|
|
6371
|
+
// src/pricing/postPurchaseChangeset.ts
|
|
6372
|
+
var postPurchaseChangeset = (prepared) => {
|
|
6373
|
+
const { selection: selection2, terms } = prepared;
|
|
6374
|
+
const subscription = readPostPurchaseSubscription(prepared);
|
|
6375
|
+
const { discount, shipping } = terms;
|
|
6376
|
+
const changesetDiscount = discount.type === "none" ? void 0 : {
|
|
6377
|
+
title: discount.title,
|
|
6378
|
+
value: discount.amount,
|
|
6379
|
+
valueType: discount.type
|
|
6380
|
+
};
|
|
6381
|
+
if (subscription) {
|
|
6382
|
+
const { initialShippingPrice, recurringShippingPrice, shippingOption } = subscription.terms.subscription;
|
|
6383
|
+
return PostPurchaseProductChangeset.parse({
|
|
6384
|
+
changes: [
|
|
6385
|
+
{
|
|
6386
|
+
...changesetDiscount ? { discount: changesetDiscount } : {},
|
|
6387
|
+
initialShippingPrice,
|
|
6388
|
+
quantity: selection2.quantity,
|
|
6389
|
+
recurringShippingPrice,
|
|
6390
|
+
sellingPlanId: subscription.selection.sellingPlanId,
|
|
6391
|
+
shippingOption,
|
|
6392
|
+
type: "add_subscription",
|
|
6393
|
+
variantId: selection2.variantId
|
|
6394
|
+
}
|
|
6395
|
+
]
|
|
6396
|
+
});
|
|
6397
|
+
}
|
|
6398
|
+
const changes = [
|
|
6399
|
+
{
|
|
6400
|
+
quantity: selection2.quantity,
|
|
6401
|
+
type: "add_variant",
|
|
6402
|
+
variantId: selection2.variantId,
|
|
6403
|
+
...changesetDiscount && changesetDiscount.value > 0 ? { discount: changesetDiscount } : {}
|
|
6404
|
+
}
|
|
6405
|
+
];
|
|
6406
|
+
if (shipping.type === "fixed_amount")
|
|
6407
|
+
changes.push({ price: shipping.amount, title: shipping.title, type: "add_shipping_line" });
|
|
6408
|
+
return PostPurchaseProductChangeset.parse({ changes });
|
|
6409
|
+
};
|
|
6410
|
+
|
|
5955
6411
|
// src/pricing/amountToCents.ts
|
|
5956
6412
|
var round = (value, precision = 0) => {
|
|
5957
6413
|
const factor = 10 ** precision;
|
|
@@ -5988,6 +6444,43 @@ var currencyDecimals = (currencyCode) => {
|
|
|
5988
6444
|
return decimals;
|
|
5989
6445
|
};
|
|
5990
6446
|
|
|
6447
|
+
// src/pricing/postPurchaseCosts.ts
|
|
6448
|
+
var postPurchaseCosts = (prepared, response, currencyCode) => {
|
|
6449
|
+
const { calculatedPurchase: purchase } = PostPurchaseProductCalculation.parse(response);
|
|
6450
|
+
const subscription = readPostPurchaseSubscription(prepared);
|
|
6451
|
+
const line = purchase.updatedLineItems.find(
|
|
6452
|
+
(line2) => line2.productId === prepared.selection.productId && line2.variantId === prepared.selection.variantId && (!subscription || line2.sellingPlanId === subscription.selection.sellingPlanId)
|
|
6453
|
+
);
|
|
6454
|
+
if (!line) throw new Error("Calculated variant mismatch");
|
|
6455
|
+
const decimals = currencyDecimals(currencyCode);
|
|
6456
|
+
const minor = ({ presentmentMoney }) => {
|
|
6457
|
+
const { amount: amount2, currencyCode: actualCurrency } = presentmentMoney;
|
|
6458
|
+
if (actualCurrency !== currencyCode || Number(Number(amount2).toFixed(decimals)) !== Number(amount2))
|
|
6459
|
+
throw new Error("Inconsistent presentment money");
|
|
6460
|
+
return amountToCents2(amount2, decimals);
|
|
6461
|
+
};
|
|
6462
|
+
const totalMinor = minor(purchase.totalOutstandingSet);
|
|
6463
|
+
const shippingMinor = purchase.addedShippingLines.reduce((sum, line2) => sum + minor(line2.priceSet), 0);
|
|
6464
|
+
const taxesMinor = purchase.addedTaxLines.reduce((sum, line2) => sum + minor(line2.priceSet), 0);
|
|
6465
|
+
let recurringDisplay;
|
|
6466
|
+
if (subscription) {
|
|
6467
|
+
const price = PostPurchaseProductCalculation.shape.calculatedPurchase.shape.totalOutstandingSet.parse(
|
|
6468
|
+
line.priceSet
|
|
6469
|
+
);
|
|
6470
|
+
const subtotalMinor = minor(price) * prepared.selection.quantity;
|
|
6471
|
+
const shippingMinor2 = amountToCents2(subscription.terms.subscription.recurringShippingPrice, decimals);
|
|
6472
|
+
recurringDisplay = { shippingMinor: shippingMinor2, subtotalMinor, totalMinor: subtotalMinor + shippingMinor2 };
|
|
6473
|
+
}
|
|
6474
|
+
return PostPurchaseProductCosts.parse({
|
|
6475
|
+
...recurringDisplay && { recurringDisplay },
|
|
6476
|
+
currencyCode,
|
|
6477
|
+
shippingMinor,
|
|
6478
|
+
subtotalMinor: totalMinor - shippingMinor - taxesMinor,
|
|
6479
|
+
taxesMinor,
|
|
6480
|
+
totalMinor
|
|
6481
|
+
});
|
|
6482
|
+
};
|
|
6483
|
+
|
|
5991
6484
|
// src/pricing/postPurchaseSubscriptionDisplay.ts
|
|
5992
6485
|
var postPurchaseSubscriptionDisplay = (prepared, currencyCode) => {
|
|
5993
6486
|
const subscription = readPostPurchaseSubscription(prepared);
|