@rebuy/rebuy 3.39.0 → 3.40.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 +786 -602
- package/dist/index.mjs +786 -602
- package/dist/schema/checkout-and-beyond/index.cjs +7 -1
- package/dist/schema/checkout-and-beyond/index.mjs +7 -1
- package/dist/schema/index.d.ts +5 -0
- package/dist/schema/postPurchaseFinish.d.ts +4 -4
- package/dist/schema/postPurchaseHealth.d.ts +174 -0
- package/dist/schema/postPurchaseHealthProgress.d.ts +5 -0
- package/dist/schema/postPurchaseHealthSchedule.d.ts +29 -0
- package/dist/schema/postPurchasePolicy.d.ts +1 -1
- package/dist/schema/postPurchaseReleaseAuthority.d.ts +53 -0
- package/dist/schema/postPurchaseReleaseClaim.d.ts +30 -0
- package/dist/schema/postPurchaseReleaseSchedule.d.ts +44 -0
- package/dist/schema/postPurchaseSession.d.ts +2 -2
- package/dist/schema/widget-data.cjs +6 -1
- package/dist/schema/widget-data.mjs +6 -1
- package/dist/schema/widgets/checkout-and-beyond/dataSource.d.ts +14 -0
- package/dist/server/index.cjs +18 -2
- package/dist/server/index.mjs +18 -2
- package/dist/transforms/index.cjs +18 -2
- package/dist/transforms/index.mjs +18 -2
- package/dist/transforms/offerV1/types.d.ts +4 -0
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -89,6 +89,7 @@ __export(src_exports, {
|
|
|
89
89
|
CABVariableSeed: () => CABVariableSeed,
|
|
90
90
|
CABVariableTrigger: () => CABVariableTrigger,
|
|
91
91
|
CABVariantContent: () => CABVariantContent,
|
|
92
|
+
CABVariantLabels: () => CABVariantLabels,
|
|
92
93
|
CABVariantsSection: () => CABVariantsSection,
|
|
93
94
|
CABVisibility: () => CABVisibility,
|
|
94
95
|
COMBINED_ENDPOINTS: () => COMBINED_ENDPOINTS,
|
|
@@ -124,8 +125,20 @@ __export(src_exports, {
|
|
|
124
125
|
GridItem: () => GridItem,
|
|
125
126
|
HEX_COLOR_REGEX: () => HEX_COLOR_REGEX,
|
|
126
127
|
HTML_TAGS_REGEX: () => HTML_TAGS_REGEX,
|
|
128
|
+
HealthAttemptSchema: () => HealthAttemptSchema,
|
|
129
|
+
HealthClaimRequestSchema: () => HealthClaimRequestSchema,
|
|
130
|
+
HealthClaimResponseSchema: () => HealthClaimResponseSchema,
|
|
131
|
+
HealthFactSchema: () => HealthFactSchema,
|
|
132
|
+
HealthPrepareRequestSchema: () => HealthPrepareRequestSchema,
|
|
133
|
+
HealthPrepareResponseSchema: () => HealthPrepareResponseSchema,
|
|
134
|
+
HealthResultRequestSchema: () => HealthResultRequestSchema,
|
|
135
|
+
HealthResultResponseSchema: () => HealthResultResponseSchema,
|
|
136
|
+
HealthResultSchema: () => HealthResultSchema,
|
|
137
|
+
HealthScheduleAcknowledgementSchema: () => HealthScheduleAcknowledgementSchema,
|
|
138
|
+
HealthScheduleReceiptSchema: () => HealthScheduleReceiptSchema,
|
|
127
139
|
HealthScheduleSchema: () => HealthScheduleSchema,
|
|
128
140
|
HealthSchedulingResponseSchema: () => HealthSchedulingResponseSchema,
|
|
141
|
+
HealthStateSchema: () => HealthStateSchema,
|
|
129
142
|
HoldSettingSchema: () => HoldSettingSchema,
|
|
130
143
|
HorizontalAlignment: () => HorizontalAlignment,
|
|
131
144
|
IconName: () => IconName,
|
|
@@ -160,6 +173,7 @@ __export(src_exports, {
|
|
|
160
173
|
OrderDecisionSchema: () => OrderDecisionSchema,
|
|
161
174
|
POST_PURCHASE_SKIP_LIMIT: () => POST_PURCHASE_SKIP_LIMIT,
|
|
162
175
|
PayButtonBlock: () => PayButtonBlock,
|
|
176
|
+
PendingReleaseAuthoritySchema: () => PendingReleaseAuthoritySchema,
|
|
163
177
|
PopoverPosition: () => PopoverPosition,
|
|
164
178
|
PostPurchaseAmount: () => PostPurchaseAmount,
|
|
165
179
|
PostPurchaseAppIdSchema: () => PostPurchaseAppIdSchema,
|
|
@@ -174,6 +188,7 @@ __export(src_exports, {
|
|
|
174
188
|
PostPurchaseGroupChoice: () => PostPurchaseGroupChoice,
|
|
175
189
|
PostPurchaseGroupDescription: () => PostPurchaseGroupDescription,
|
|
176
190
|
PostPurchaseGroupSelection: () => PostPurchaseGroupSelection,
|
|
191
|
+
PostPurchaseHealthTaskNameSchema: () => PostPurchaseHealthTaskNameSchema,
|
|
177
192
|
PostPurchaseKlaviyoReviewRating: () => PostPurchaseKlaviyoReviewRating,
|
|
178
193
|
PostPurchaseMemberIdentity: () => PostPurchaseMemberIdentity,
|
|
179
194
|
PostPurchaseMemberPointer: () => PostPurchaseMemberPointer,
|
|
@@ -209,6 +224,7 @@ __export(src_exports, {
|
|
|
209
224
|
PostPurchaseQuantityPolicy: () => PostPurchaseQuantityPolicy,
|
|
210
225
|
PostPurchaseReviewCount: () => PostPurchaseReviewCount,
|
|
211
226
|
PostPurchaseReviewStyles: () => PostPurchaseReviewStyles,
|
|
227
|
+
PostPurchaseSessionIdSchema: () => PostPurchaseSessionIdSchema,
|
|
212
228
|
PostPurchaseSettings: () => PostPurchaseSettings,
|
|
213
229
|
PostPurchaseShadowReportFields: () => PostPurchaseShadowReportFields,
|
|
214
230
|
PostPurchaseShadowReportSchema: () => PostPurchaseShadowReportSchema,
|
|
@@ -253,6 +269,7 @@ __export(src_exports, {
|
|
|
253
269
|
QuantityInput: () => QuantityInput,
|
|
254
270
|
REVIEW_LABELS: () => REVIEW_LABELS,
|
|
255
271
|
ROOT_RELATIVE_PATH_REGEX: () => ROOT_RELATIVE_PATH_REGEX,
|
|
272
|
+
ReadyReleaseAuthoritySchema: () => ReadyReleaseAuthoritySchema,
|
|
256
273
|
ReadySessionTimingSchema: () => ReadySessionTimingSchema,
|
|
257
274
|
RebuyButton: () => RebuyButton,
|
|
258
275
|
RebuyButtonV1: () => RebuyButtonV1,
|
|
@@ -261,6 +278,11 @@ __export(src_exports, {
|
|
|
261
278
|
RebuyMonetizeV1: () => RebuyMonetizeV1,
|
|
262
279
|
RecordedOfferDeclineSchema: () => RecordedOfferDeclineSchema,
|
|
263
280
|
RecordedPurchaseObservationSchema: () => RecordedPurchaseObservationSchema,
|
|
281
|
+
ReleaseAuthorityRequestSchema: () => ReleaseAuthorityRequestSchema,
|
|
282
|
+
ReleaseAuthorityResponseSchema: () => ReleaseAuthorityResponseSchema,
|
|
283
|
+
ReleaseClaimRequestSchema: () => ReleaseClaimRequestSchema,
|
|
284
|
+
ReleaseClaimResponseSchema: () => ReleaseClaimResponseSchema,
|
|
285
|
+
ReleaseOwnerSchema: () => ReleaseOwnerSchema,
|
|
264
286
|
RequiredHealthSchema: () => RequiredHealthSchema,
|
|
265
287
|
ResultCountOperator: () => ResultCountOperator,
|
|
266
288
|
ResultTagOperator: () => ResultTagOperator,
|
|
@@ -285,6 +307,8 @@ __export(src_exports, {
|
|
|
285
307
|
SessionIdentitySchema: () => SessionIdentitySchema,
|
|
286
308
|
SessionOrderTimingSchema: () => SessionOrderTimingSchema,
|
|
287
309
|
SessionPolicySchema: () => SessionPolicySchema,
|
|
310
|
+
SessionReleaseScheduleRequestSchema: () => SessionReleaseScheduleRequestSchema,
|
|
311
|
+
SessionReleaseScheduleResponseSchema: () => SessionReleaseScheduleResponseSchema,
|
|
288
312
|
SessionStartRequestSchema: () => SessionStartRequestSchema,
|
|
289
313
|
SessionStartResponseSchema: () => SessionStartResponseSchema,
|
|
290
314
|
ShopConfig: () => ShopConfig,
|
|
@@ -389,7 +413,9 @@ __export(src_exports, {
|
|
|
389
413
|
popoverPositions: () => popoverPositions,
|
|
390
414
|
postPurchaseChangeset: () => postPurchaseChangeset,
|
|
391
415
|
postPurchaseCosts: () => postPurchaseCosts,
|
|
416
|
+
postPurchaseHealthTaskId: () => postPurchaseHealthTaskId,
|
|
392
417
|
postPurchaseSubscriptionDisplay: () => postPurchaseSubscriptionDisplay,
|
|
418
|
+
postPurchaseTaskNameSchema: () => postPurchaseTaskNameSchema,
|
|
393
419
|
productImageObject: () => productImageObject,
|
|
394
420
|
productTypes: () => productTypes,
|
|
395
421
|
progressTierExclusionTypes: () => progressTierExclusionTypes,
|
|
@@ -3084,42 +3110,68 @@ var ExitPolicySchema = import_zod36.z.discriminatedUnion("status", [
|
|
|
3084
3110
|
]);
|
|
3085
3111
|
|
|
3086
3112
|
// src/schema/postPurchaseFinish.ts
|
|
3087
|
-
var
|
|
3113
|
+
var import_zod42 = require("zod");
|
|
3088
3114
|
|
|
3089
3115
|
// src/schema/postPurchaseFollowups.ts
|
|
3090
|
-
var
|
|
3116
|
+
var import_zod40 = require("zod");
|
|
3091
3117
|
|
|
3092
3118
|
// src/schema/postPurchaseHealthProgress.ts
|
|
3119
|
+
var import_zod38 = require("zod");
|
|
3120
|
+
|
|
3121
|
+
// src/schema/postPurchaseReleaseAuthority.ts
|
|
3093
3122
|
var import_zod37 = require("zod");
|
|
3094
|
-
var
|
|
3123
|
+
var PostPurchaseSessionIdSchema = import_zod37.z.string().regex(/^[a-f0-9]{64}$/);
|
|
3124
|
+
var ReleaseOwnerSchema = import_zod37.z.enum(["rebuy", "shopify"]);
|
|
3125
|
+
var ReleaseAuthorityRequestSchema = import_zod37.z.strictObject({
|
|
3126
|
+
orderId: PostPurchaseOrderIdSchema,
|
|
3127
|
+
shop: ShopifyDomainSchema
|
|
3128
|
+
});
|
|
3129
|
+
var ReadyReleaseAuthoritySchema = import_zod37.z.object({
|
|
3130
|
+
deadline: PostPurchaseTimestampSchema,
|
|
3131
|
+
releaseOwner: ReleaseOwnerSchema,
|
|
3132
|
+
sessionId: PostPurchaseSessionIdSchema,
|
|
3133
|
+
status: import_zod37.z.literal("ready")
|
|
3134
|
+
});
|
|
3135
|
+
var PendingReleaseAuthoritySchema = import_zod37.z.object({ status: import_zod37.z.literal("pending") });
|
|
3136
|
+
var ReleaseAuthorityResponseSchema = import_zod37.z.object({
|
|
3137
|
+
data: import_zod37.z.discriminatedUnion("status", [
|
|
3138
|
+
import_zod37.z.object({ status: import_zod37.z.literal("unknown") }),
|
|
3139
|
+
PendingReleaseAuthoritySchema,
|
|
3140
|
+
ReadyReleaseAuthoritySchema
|
|
3141
|
+
]),
|
|
3142
|
+
successful: import_zod37.z.literal(true)
|
|
3143
|
+
});
|
|
3144
|
+
|
|
3145
|
+
// src/schema/postPurchaseHealthProgress.ts
|
|
3146
|
+
var HealthScheduleSchema = import_zod38.z.strictObject({
|
|
3095
3147
|
checkoutToken: DecideRequestSchema.shape.checkoutToken,
|
|
3096
3148
|
healthScheduledAt: PostPurchaseTimestampSchema,
|
|
3097
|
-
operationId: PurchaseReceiptSchema.shape.operationId,
|
|
3149
|
+
operationId: PurchaseReceiptSchema.shape.operationId.regex(/^[a-f0-9-]{36}$/),
|
|
3098
3150
|
orderId: PostPurchaseOrderIdSchema,
|
|
3099
|
-
removePartialOrder:
|
|
3100
|
-
sessionId:
|
|
3151
|
+
removePartialOrder: import_zod38.z.boolean(),
|
|
3152
|
+
sessionId: PostPurchaseSessionIdSchema,
|
|
3101
3153
|
shop: DecideRequestSchema.shape.shop
|
|
3102
3154
|
});
|
|
3103
|
-
var HealthSchedulingResponseSchema =
|
|
3104
|
-
data:
|
|
3105
|
-
callbackStatus:
|
|
3155
|
+
var HealthSchedulingResponseSchema = import_zod38.z.object({
|
|
3156
|
+
data: import_zod38.z.object({
|
|
3157
|
+
callbackStatus: import_zod38.z.enum(["pending", "attempted", "returned", "unknown"]),
|
|
3106
3158
|
facts: HealthScheduleSchema,
|
|
3107
|
-
scheduling:
|
|
3108
|
-
|
|
3109
|
-
|
|
3159
|
+
scheduling: import_zod38.z.union([
|
|
3160
|
+
import_zod38.z.strictObject({ recordedAt: PostPurchaseTimestampSchema, status: import_zod38.z.literal("verified") }),
|
|
3161
|
+
import_zod38.z.strictObject({ status: import_zod38.z.enum(["unavailable", "unverified"]) })
|
|
3110
3162
|
])
|
|
3111
3163
|
}),
|
|
3112
|
-
successful:
|
|
3164
|
+
successful: import_zod38.z.literal(true)
|
|
3113
3165
|
});
|
|
3114
3166
|
|
|
3115
3167
|
// src/schema/postPurchaseObservation.ts
|
|
3116
|
-
var
|
|
3117
|
-
var PurchaseObservationSchema =
|
|
3118
|
-
|
|
3119
|
-
changesetApplicationsRemaining:
|
|
3120
|
-
errors:
|
|
3121
|
-
|
|
3122
|
-
code:
|
|
3168
|
+
var import_zod39 = require("zod");
|
|
3169
|
+
var PurchaseObservationSchema = import_zod39.z.union([
|
|
3170
|
+
import_zod39.z.object({
|
|
3171
|
+
changesetApplicationsRemaining: import_zod39.z.number().int().nonnegative(),
|
|
3172
|
+
errors: import_zod39.z.array(
|
|
3173
|
+
import_zod39.z.object({
|
|
3174
|
+
code: import_zod39.z.enum([
|
|
3123
3175
|
"payment_required",
|
|
3124
3176
|
"insufficient_inventory",
|
|
3125
3177
|
"changeset_already_applied",
|
|
@@ -3133,83 +3185,83 @@ var PurchaseObservationSchema = import_zod38.z.union([
|
|
|
3133
3185
|
"subscription_limit_error",
|
|
3134
3186
|
"order_released_error"
|
|
3135
3187
|
]),
|
|
3136
|
-
message:
|
|
3188
|
+
message: import_zod39.z.string()
|
|
3137
3189
|
}).strict()
|
|
3138
3190
|
),
|
|
3139
|
-
status:
|
|
3191
|
+
status: import_zod39.z.enum(["processed", "partially_processed", "unprocessed"])
|
|
3140
3192
|
}).strict(),
|
|
3141
|
-
|
|
3193
|
+
import_zod39.z.object({ reason: import_zod39.z.literal("application-error"), status: import_zod39.z.literal("unknown") }).strict()
|
|
3142
3194
|
]);
|
|
3143
|
-
var RecordedPurchaseObservationSchema =
|
|
3195
|
+
var RecordedPurchaseObservationSchema = import_zod39.z.object({
|
|
3144
3196
|
observation: PurchaseObservationSchema,
|
|
3145
3197
|
recordedAt: PostPurchaseTimestampSchema
|
|
3146
3198
|
}).strict();
|
|
3147
3199
|
var PurchaseObservationRequestSchema = DecideRequestSchema.extend({
|
|
3148
3200
|
observation: PurchaseObservationSchema,
|
|
3149
|
-
operationId:
|
|
3201
|
+
operationId: import_zod39.z.uuid()
|
|
3150
3202
|
}).strict();
|
|
3151
|
-
var PurchaseObservationResponseSchema =
|
|
3152
|
-
data: RecordedPurchaseObservationSchema.extend({ operationId:
|
|
3153
|
-
successful:
|
|
3203
|
+
var PurchaseObservationResponseSchema = import_zod39.z.object({
|
|
3204
|
+
data: RecordedPurchaseObservationSchema.extend({ operationId: import_zod39.z.uuid() }),
|
|
3205
|
+
successful: import_zod39.z.literal(true)
|
|
3154
3206
|
});
|
|
3155
3207
|
|
|
3156
3208
|
// src/schema/postPurchaseFollowups.ts
|
|
3157
|
-
var RequiredHealthSchema =
|
|
3209
|
+
var RequiredHealthSchema = import_zod40.z.union([
|
|
3158
3210
|
HealthSchedulingResponseSchema.shape.data,
|
|
3159
|
-
|
|
3211
|
+
import_zod40.z.strictObject({ status: import_zod40.z.literal("unavailable") })
|
|
3160
3212
|
]);
|
|
3161
|
-
var AcceptedFollowupsResponseSchema =
|
|
3162
|
-
data:
|
|
3163
|
-
acceptedEvent:
|
|
3213
|
+
var AcceptedFollowupsResponseSchema = import_zod40.z.object({
|
|
3214
|
+
data: import_zod40.z.object({
|
|
3215
|
+
acceptedEvent: import_zod40.z.union([
|
|
3164
3216
|
AcceptedEventResponseSchema.shape.data,
|
|
3165
|
-
|
|
3217
|
+
import_zod40.z.strictObject({ status: import_zod40.z.literal("unavailable") })
|
|
3166
3218
|
]),
|
|
3167
3219
|
acceptedMetafield: AcceptedMetafieldResultSchema,
|
|
3168
3220
|
health: RequiredHealthSchema,
|
|
3169
3221
|
purchase: PurchaseObservationResponseSchema.shape.data
|
|
3170
3222
|
}),
|
|
3171
|
-
successful:
|
|
3223
|
+
successful: import_zod40.z.literal(true)
|
|
3172
3224
|
});
|
|
3173
3225
|
|
|
3174
3226
|
// src/schema/postPurchaseSessionClose.ts
|
|
3175
|
-
var
|
|
3176
|
-
var SessionClosureSchema =
|
|
3227
|
+
var import_zod41 = require("zod");
|
|
3228
|
+
var SessionClosureSchema = import_zod41.z.object({ closedAt: PostPurchaseTimestampSchema, status: import_zod41.z.literal("closed") });
|
|
3177
3229
|
var SessionCloseRequestSchema = DecideRequestSchema.strict();
|
|
3178
|
-
var SessionCloseResponseSchema =
|
|
3230
|
+
var SessionCloseResponseSchema = import_zod41.z.object({ data: SessionClosureSchema, successful: import_zod41.z.literal(true) });
|
|
3179
3231
|
|
|
3180
3232
|
// src/schema/postPurchaseFinish.ts
|
|
3181
|
-
var FinishedPurchaseSchema =
|
|
3182
|
-
|
|
3183
|
-
|
|
3233
|
+
var FinishedPurchaseSchema = import_zod42.z.union([
|
|
3234
|
+
import_zod42.z.strictObject({ status: import_zod42.z.literal("none") }),
|
|
3235
|
+
import_zod42.z.strictObject({
|
|
3184
3236
|
operationId: PurchaseReceiptSchema.shape.operationId,
|
|
3185
|
-
status:
|
|
3186
|
-
|
|
3237
|
+
status: import_zod42.z.union([
|
|
3238
|
+
import_zod42.z.literal("pending"),
|
|
3187
3239
|
...PurchaseObservationSchema.options.map((option) => option.shape.status)
|
|
3188
3240
|
])
|
|
3189
3241
|
})
|
|
3190
3242
|
]);
|
|
3191
3243
|
var SessionFinishRequestSchema = DecideRequestSchema.strict();
|
|
3192
|
-
var SessionFinishResponseSchema =
|
|
3244
|
+
var SessionFinishResponseSchema = import_zod42.z.object({
|
|
3193
3245
|
data: SessionClosureSchema.extend({
|
|
3194
3246
|
classification: ClassificationProgressSchema,
|
|
3195
3247
|
exitPolicy: ExitPolicySchema,
|
|
3196
3248
|
health: RequiredHealthSchema.nullable(),
|
|
3197
3249
|
purchase: FinishedPurchaseSchema
|
|
3198
3250
|
}),
|
|
3199
|
-
successful:
|
|
3251
|
+
successful: import_zod42.z.literal(true)
|
|
3200
3252
|
});
|
|
3201
3253
|
|
|
3202
3254
|
// src/schema/postPurchaseQuantity.ts
|
|
3203
|
-
var
|
|
3255
|
+
var import_zod65 = require("zod");
|
|
3204
3256
|
|
|
3205
3257
|
// src/schema/postPurchaseProductCollectionView.ts
|
|
3206
|
-
var
|
|
3258
|
+
var import_zod64 = require("zod");
|
|
3207
3259
|
|
|
3208
3260
|
// src/schema/postPurchaseProductView.ts
|
|
3209
|
-
var
|
|
3261
|
+
var import_zod63 = require("zod");
|
|
3210
3262
|
|
|
3211
3263
|
// src/schema/postPurchaseGroupCatalog.ts
|
|
3212
|
-
var
|
|
3264
|
+
var import_zod43 = require("zod");
|
|
3213
3265
|
var productId = PreparedPostPurchaseProduct.shape.selection.shape.productId;
|
|
3214
3266
|
var source = PostPurchaseProductSource.shape.data.element;
|
|
3215
3267
|
var PostPurchaseGroupDescription = source.pick({ description: true, id: true, image: true, images: true, title: true }).extend({
|
|
@@ -3217,17 +3269,17 @@ var PostPurchaseGroupDescription = source.pick({ description: true, id: true, im
|
|
|
3217
3269
|
image: source.shape.image.default(null),
|
|
3218
3270
|
options: PostPurchaseVariantCatalog.shape.options.default([])
|
|
3219
3271
|
});
|
|
3220
|
-
var PostPurchaseGroupCatalog =
|
|
3272
|
+
var PostPurchaseGroupCatalog = import_zod43.z.object({
|
|
3221
3273
|
memberProductId: productId,
|
|
3222
|
-
options:
|
|
3274
|
+
options: import_zod43.z.array(import_zod43.z.object({ productId, title: import_zod43.z.string(), variantCatalog: PostPurchaseVariantCatalog }))
|
|
3223
3275
|
});
|
|
3224
|
-
var PostPurchaseGroupSelection =
|
|
3276
|
+
var PostPurchaseGroupSelection = import_zod43.z.object({
|
|
3225
3277
|
memberProductId: productId,
|
|
3226
3278
|
productId
|
|
3227
3279
|
});
|
|
3228
3280
|
|
|
3229
3281
|
// src/schema/widgets/checkout-and-beyond/root.ts
|
|
3230
|
-
var
|
|
3282
|
+
var import_zod62 = require("zod");
|
|
3231
3283
|
|
|
3232
3284
|
// src/schema/widgets/checkout-and-beyond/constants.ts
|
|
3233
3285
|
var import_es_toolkit3 = require("es-toolkit");
|
|
@@ -3282,18 +3334,18 @@ var targetAreas = {
|
|
|
3282
3334
|
|
|
3283
3335
|
// src/schema/widgets/checkout-and-beyond/layout.ts
|
|
3284
3336
|
var import_uuid15 = require("uuid");
|
|
3285
|
-
var
|
|
3337
|
+
var import_zod61 = require("zod");
|
|
3286
3338
|
|
|
3287
3339
|
// src/schema/widgets/checkout-and-beyond/shared.ts
|
|
3288
|
-
var
|
|
3340
|
+
var import_zod60 = require("zod");
|
|
3289
3341
|
|
|
3290
3342
|
// src/schema/widgets/checkout-and-beyond/banner.ts
|
|
3291
|
-
var
|
|
3292
|
-
var CABBannerSection =
|
|
3343
|
+
var import_zod44 = require("zod");
|
|
3344
|
+
var CABBannerSection = import_zod44.z.lazy(
|
|
3293
3345
|
() => CABLayoutSection.omit({ sectionType: true }).extend({
|
|
3294
|
-
buttonField:
|
|
3295
|
-
color:
|
|
3296
|
-
dismissible:
|
|
3346
|
+
buttonField: import_zod44.z.enum(buttonFields).optional(),
|
|
3347
|
+
color: import_zod44.z.enum(bannerColors).default("info"),
|
|
3348
|
+
dismissible: import_zod44.z.boolean().default(true),
|
|
3297
3349
|
/**
|
|
3298
3350
|
* The `s-banner` heading — localized content (a buyer can see a merchant-composed banner). Absent OR
|
|
3299
3351
|
* blank ⇒ no heading; the renderer emits no heading slot for `''` rather than an empty one.
|
|
@@ -3309,18 +3361,18 @@ var CABBannerSection = import_zod43.z.lazy(
|
|
|
3309
3361
|
* not a 500. Nothing emits `heading` yet; the first converter that maps merchant banner copy into it
|
|
3310
3362
|
* either strips first or teaches `normalizeTextContent` to strip this field.
|
|
3311
3363
|
*/
|
|
3312
|
-
heading:
|
|
3313
|
-
sectionType:
|
|
3364
|
+
heading: import_zod44.z.record(import_zod44.z.string(), import_zod44.z.string().refine(checkForHTML, NO_HTML)).optional(),
|
|
3365
|
+
sectionType: import_zod44.z.literal(SectionType.banner).default(SectionType.banner)
|
|
3314
3366
|
})
|
|
3315
3367
|
);
|
|
3316
3368
|
|
|
3317
3369
|
// src/schema/widgets/checkout-and-beyond/button.ts
|
|
3318
3370
|
var import_uuid5 = require("uuid");
|
|
3319
|
-
var
|
|
3371
|
+
var import_zod46 = require("zod");
|
|
3320
3372
|
|
|
3321
3373
|
// src/schema/widgets/checkout-and-beyond/image.ts
|
|
3322
3374
|
var import_uuid4 = require("uuid");
|
|
3323
|
-
var
|
|
3375
|
+
var import_zod45 = require("zod");
|
|
3324
3376
|
|
|
3325
3377
|
// src/schema/widgets/checkout-and-beyond/icons.ts
|
|
3326
3378
|
var iconNames = [
|
|
@@ -3407,17 +3459,17 @@ var iconTones = ["auto", "critical", "custom", "info", "neutral", "success", "wa
|
|
|
3407
3459
|
var IconTone = freezeEnum(iconTones);
|
|
3408
3460
|
|
|
3409
3461
|
// src/schema/widgets/checkout-and-beyond/image.ts
|
|
3410
|
-
var CABImageSectionFields =
|
|
3462
|
+
var CABImageSectionFields = import_zod45.z.object({
|
|
3411
3463
|
...CABVariableFields,
|
|
3412
|
-
altText:
|
|
3464
|
+
altText: import_zod45.z.string().refine(checkForHTML, NO_HTML).default(""),
|
|
3413
3465
|
/**
|
|
3414
3466
|
* Image width÷height (e.g. `46` for the progress-bar fill); `null` renders at natural size. Any POSITIVE
|
|
3415
3467
|
* ratio — never limited to 1, but never `0`/negative either: a renderer dividing by it would get `Infinity`,
|
|
3416
3468
|
* and CSS `aspect-ratio` drops a negative value and silently reverts to natural size.
|
|
3417
3469
|
*/
|
|
3418
|
-
aspectRatio:
|
|
3419
|
-
border:
|
|
3420
|
-
buttonField:
|
|
3470
|
+
aspectRatio: import_zod45.z.number().positive().nullable().default(null),
|
|
3471
|
+
border: import_zod45.z.lazy(() => CABBorder),
|
|
3472
|
+
buttonField: import_zod45.z.enum(buttonFields).optional(),
|
|
3421
3473
|
/**
|
|
3422
3474
|
* `icon` renders `source` as a single `s-icon` by name (the uber-image path covers icons too), reading
|
|
3423
3475
|
* `iconSize`/`iconTone`. The other values are a harmless informational holdover from the previous
|
|
@@ -3436,29 +3488,29 @@ var CABImageSectionFields = import_zod44.z.object({
|
|
|
3436
3488
|
* behavior degraded gracefully and told us about it. The client-assembled half of the invariant was never
|
|
3437
3489
|
* the risky half.
|
|
3438
3490
|
*/
|
|
3439
|
-
category:
|
|
3491
|
+
category: import_zod45.z.enum(["gallery", "icon", "icons", "payment-methods", "secure-checkout"]).nullable().default(null),
|
|
3440
3492
|
/** `icon`-mode only: the `s-icon` `size`; `null` ⇒ the component default (`base`). Ignored by image treatments. */
|
|
3441
|
-
iconSize:
|
|
3493
|
+
iconSize: import_zod45.z.enum(iconSizes).nullable().default(null),
|
|
3442
3494
|
/** `icon`-mode only: the `s-icon` `tone`; `null` ⇒ the component default (`auto`). Ignored by image treatments. */
|
|
3443
|
-
iconTone:
|
|
3444
|
-
name:
|
|
3445
|
-
naturalHeight:
|
|
3446
|
-
naturalWidth:
|
|
3495
|
+
iconTone: import_zod45.z.enum(iconTones).nullable().default(null),
|
|
3496
|
+
name: import_zod45.z.string().optional(),
|
|
3497
|
+
naturalHeight: import_zod45.z.number().default(0),
|
|
3498
|
+
naturalWidth: import_zod45.z.number().default(0),
|
|
3447
3499
|
/**
|
|
3448
3500
|
* `contain` (the component default): dimensionless images render in s-image's 1/1 default frame, and
|
|
3449
3501
|
* `cover` would crop non-square art (payment badges lost their edges — 15993); `contain` letterboxes.
|
|
3450
3502
|
*/
|
|
3451
|
-
objectFit:
|
|
3452
|
-
sectionId:
|
|
3453
|
-
sectionType:
|
|
3503
|
+
objectFit: import_zod45.z.enum(objectFits).default(ObjectFit.contain),
|
|
3504
|
+
sectionId: import_zod45.z.uuid().default(() => (0, import_uuid4.v7)()),
|
|
3505
|
+
sectionType: import_zod45.z.literal(SectionType.image).default(SectionType.image),
|
|
3454
3506
|
/**
|
|
3455
3507
|
* An image URL or dynamic token, an empty default, or — when `category: 'icon'` — an icon NAME. Icon mode
|
|
3456
3508
|
* takes a name or `''` only, NOT a token: no renderer resolves a token to an icon today, so accepting one
|
|
3457
3509
|
* would promise a capability that doesn't exist. Widen the refine's carve-out to `DYNAMIC_TOKEN_REGEX` when a
|
|
3458
3510
|
* server-chosen tier icon actually needs it.
|
|
3459
3511
|
*/
|
|
3460
|
-
source:
|
|
3461
|
-
width:
|
|
3512
|
+
source: import_zod45.z.union([import_zod45.z.url(), import_zod45.z.literal(""), import_zod45.z.string().regex(DYNAMIC_TOKEN_REGEX), import_zod45.z.enum(iconNames)]).default(""),
|
|
3513
|
+
width: import_zod45.z.number().default(100)
|
|
3462
3514
|
});
|
|
3463
3515
|
var iconNameSet = new Set(iconNames);
|
|
3464
3516
|
var isIconName = (source2) => iconNameSet.has(source2);
|
|
@@ -3478,35 +3530,35 @@ var CABImageSection = CABImageSectionFields.superRefine(({ category, source: sou
|
|
|
3478
3530
|
});
|
|
3479
3531
|
|
|
3480
3532
|
// src/schema/widgets/checkout-and-beyond/button.ts
|
|
3481
|
-
var CABButtonContent =
|
|
3482
|
-
() =>
|
|
3533
|
+
var CABButtonContent = import_zod46.z.lazy(
|
|
3534
|
+
() => import_zod46.z.discriminatedUnion("sectionType", [CABImageSection, CABLayoutSection, CABTextSection])
|
|
3483
3535
|
);
|
|
3484
|
-
var CABButtonSection =
|
|
3536
|
+
var CABButtonSection = import_zod46.z.object({
|
|
3485
3537
|
...CABVariableFields,
|
|
3486
|
-
action:
|
|
3487
|
-
buttonStyle:
|
|
3488
|
-
custom:
|
|
3489
|
-
color:
|
|
3490
|
-
height:
|
|
3491
|
-
width:
|
|
3538
|
+
action: import_zod46.z.union([import_zod46.z.literal(""), import_zod46.z.enum(buttonActions)]).default(""),
|
|
3539
|
+
buttonStyle: import_zod46.z.enum(buttonStyles).default(ButtonStyle.primary),
|
|
3540
|
+
custom: import_zod46.z.object({
|
|
3541
|
+
color: import_zod46.z.string().regex(HEX_COLOR_REGEX).default("#005bd3"),
|
|
3542
|
+
height: import_zod46.z.number().default(52),
|
|
3543
|
+
width: import_zod46.z.number().default(300)
|
|
3492
3544
|
}).default({
|
|
3493
3545
|
color: "#005bd3",
|
|
3494
3546
|
height: 52,
|
|
3495
3547
|
width: 300
|
|
3496
3548
|
}),
|
|
3497
|
-
disableDowngrade:
|
|
3498
|
-
name:
|
|
3499
|
-
optionId:
|
|
3500
|
-
popover:
|
|
3501
|
-
alignment:
|
|
3502
|
-
position:
|
|
3549
|
+
disableDowngrade: import_zod46.z.boolean().default(false),
|
|
3550
|
+
name: import_zod46.z.string().optional(),
|
|
3551
|
+
optionId: import_zod46.z.number().optional(),
|
|
3552
|
+
popover: import_zod46.z.object({
|
|
3553
|
+
alignment: import_zod46.z.enum(textAlignments).default(TextAlignment.center),
|
|
3554
|
+
position: import_zod46.z.enum(popoverPositions).default(PopoverPosition.blockStart)
|
|
3503
3555
|
}).optional().default(() => ({
|
|
3504
3556
|
alignment: TextAlignment.center,
|
|
3505
3557
|
position: PopoverPosition.blockStart
|
|
3506
3558
|
})),
|
|
3507
|
-
sectionId:
|
|
3508
|
-
sections:
|
|
3509
|
-
sectionType:
|
|
3559
|
+
sectionId: import_zod46.z.uuid().default(() => (0, import_uuid5.v7)()),
|
|
3560
|
+
sections: import_zod46.z.union([import_zod46.z.array(CABButtonContent), import_zod46.z.strictObject({}).transform(() => [])]).default(() => []),
|
|
3561
|
+
sectionType: import_zod46.z.literal(SectionType.button).default(SectionType.button),
|
|
3510
3562
|
/**
|
|
3511
3563
|
* The smart-cart tier this button acts on (`addGift`/`removeGift`): scopes the click to one tier's gift. The
|
|
3512
3564
|
* client resolves the tier's gift (productId) from the progress-bar context by this `tierId` — the button node
|
|
@@ -3521,91 +3573,96 @@ var CABButtonSection = import_zod45.z.object({
|
|
|
3521
3573
|
* lookup finds no tier and the click resolves to nothing. Safe to bound — the field is new, so there are no
|
|
3522
3574
|
* stored payloads to grandfather, and the producer is client code, not a merchant form.
|
|
3523
3575
|
*/
|
|
3524
|
-
tier:
|
|
3576
|
+
tier: import_zod46.z.object({ tierId: import_zod46.z.string().min(1) }).optional(),
|
|
3525
3577
|
/** Fire-and-forget pixel POSTed when the button is clicked (e.g. a Monetize decline). */
|
|
3526
|
-
trackingUrl:
|
|
3578
|
+
trackingUrl: import_zod46.z.string().optional(),
|
|
3527
3579
|
/**
|
|
3528
3580
|
* Secondary effects applied to in-scope variables on click, alongside (never instead of) the primary
|
|
3529
3581
|
* `action` — an `addToOrder` button can also flip a variable. Applied in array order.
|
|
3530
3582
|
*/
|
|
3531
|
-
variableEffects:
|
|
3583
|
+
variableEffects: import_zod46.z.array(CABVariableEffect).optional()
|
|
3532
3584
|
});
|
|
3533
3585
|
|
|
3534
3586
|
// src/schema/widgets/checkout-and-beyond/carousel.ts
|
|
3535
|
-
var
|
|
3587
|
+
var import_zod51 = require("zod");
|
|
3536
3588
|
|
|
3537
3589
|
// src/schema/widgets/checkout-and-beyond/offers.ts
|
|
3538
|
-
var
|
|
3590
|
+
var import_zod50 = require("zod");
|
|
3539
3591
|
|
|
3540
3592
|
// src/schema/widgets/checkout-and-beyond/dataSource.ts
|
|
3541
3593
|
var import_uuid6 = require("uuid");
|
|
3542
|
-
var
|
|
3543
|
-
var CABDiscount =
|
|
3544
|
-
amount:
|
|
3545
|
-
discountedBy:
|
|
3546
|
-
discountedFrom:
|
|
3547
|
-
type:
|
|
3548
|
-
});
|
|
3549
|
-
var CABIntegrations =
|
|
3550
|
-
judgeme:
|
|
3551
|
-
junip:
|
|
3552
|
-
klaviyo:
|
|
3553
|
-
loox:
|
|
3554
|
-
okendo:
|
|
3555
|
-
opinew:
|
|
3556
|
-
reviewsio:
|
|
3557
|
-
stamped:
|
|
3558
|
-
yotpo:
|
|
3559
|
-
});
|
|
3560
|
-
var
|
|
3561
|
-
|
|
3562
|
-
|
|
3594
|
+
var import_zod47 = require("zod");
|
|
3595
|
+
var CABDiscount = import_zod47.z.object({
|
|
3596
|
+
amount: import_zod47.z.union([import_zod47.z.number(), import_zod47.z.string()]).catch(0),
|
|
3597
|
+
discountedBy: import_zod47.z.string().optional(),
|
|
3598
|
+
discountedFrom: import_zod47.z.enum(discountSources).optional().catch(void 0),
|
|
3599
|
+
type: import_zod47.z.enum(discountTypes).catch("none")
|
|
3600
|
+
});
|
|
3601
|
+
var CABIntegrations = import_zod47.z.object({
|
|
3602
|
+
judgeme: import_zod47.z.boolean().default(false),
|
|
3603
|
+
junip: import_zod47.z.boolean().default(false),
|
|
3604
|
+
klaviyo: import_zod47.z.boolean().default(false),
|
|
3605
|
+
loox: import_zod47.z.boolean().default(false),
|
|
3606
|
+
okendo: import_zod47.z.boolean().default(false),
|
|
3607
|
+
opinew: import_zod47.z.boolean().default(false),
|
|
3608
|
+
reviewsio: import_zod47.z.boolean().default(false),
|
|
3609
|
+
stamped: import_zod47.z.boolean().default(false),
|
|
3610
|
+
yotpo: import_zod47.z.boolean().default(false)
|
|
3611
|
+
});
|
|
3612
|
+
var CABVariantLabels = import_zod47.z.object({
|
|
3613
|
+
variantOption: import_zod47.z.string().optional().catch(void 0),
|
|
3614
|
+
variantOptions: import_zod47.z.string().optional().catch(void 0)
|
|
3615
|
+
});
|
|
3616
|
+
var CABDataSourceSection = import_zod47.z.object({
|
|
3617
|
+
dataSourceId: import_zod47.z.number().nullable().default(null),
|
|
3618
|
+
dataSourcePath: import_zod47.z.string().default(DEFAULT_ENDPOINTS[0].value),
|
|
3563
3619
|
discount: CABDiscount.optional(),
|
|
3564
3620
|
integrations: CABIntegrations.optional(),
|
|
3565
|
-
limit:
|
|
3566
|
-
matchVariant:
|
|
3567
|
-
matchVariantOutOfStock:
|
|
3568
|
-
name:
|
|
3569
|
-
productType:
|
|
3570
|
-
sectionId:
|
|
3571
|
-
sectionType:
|
|
3621
|
+
limit: import_zod47.z.number().default(1),
|
|
3622
|
+
matchVariant: import_zod47.z.boolean().default(false),
|
|
3623
|
+
matchVariantOutOfStock: import_zod47.z.boolean().default(false),
|
|
3624
|
+
name: import_zod47.z.string().default(DEFAULT_ENDPOINTS[0].label),
|
|
3625
|
+
productType: import_zod47.z.enum(productTypes).optional(),
|
|
3626
|
+
sectionId: import_zod47.z.uuid().default(() => (0, import_uuid6.v7)()),
|
|
3627
|
+
sectionType: import_zod47.z.literal(SectionType.dataSource).default(SectionType.dataSource),
|
|
3572
3628
|
/** Default subscribe-vs-one-time for `productType: both` (legacy `subscription_is_default`). */
|
|
3573
|
-
subscriptionIsDefault:
|
|
3574
|
-
treatAsGwp:
|
|
3629
|
+
subscriptionIsDefault: import_zod47.z.boolean().default(false),
|
|
3630
|
+
treatAsGwp: import_zod47.z.boolean().default(false),
|
|
3631
|
+
variantLabels: CABVariantLabels.optional().catch(void 0)
|
|
3575
3632
|
});
|
|
3576
3633
|
|
|
3577
3634
|
// src/schema/widgets/checkout-and-beyond/products.ts
|
|
3578
3635
|
var import_uuid8 = require("uuid");
|
|
3579
|
-
var
|
|
3636
|
+
var import_zod49 = require("zod");
|
|
3580
3637
|
|
|
3581
3638
|
// src/schema/widgets/checkout-and-beyond/product.ts
|
|
3582
3639
|
var import_uuid7 = require("uuid");
|
|
3583
|
-
var
|
|
3584
|
-
var CABVariantContent =
|
|
3585
|
-
() =>
|
|
3640
|
+
var import_zod48 = require("zod");
|
|
3641
|
+
var CABVariantContent = import_zod48.z.lazy(
|
|
3642
|
+
() => import_zod48.z.discriminatedUnion("sectionType", [CABButtonSection, CABTextSection])
|
|
3586
3643
|
);
|
|
3587
|
-
var CABProductSection =
|
|
3644
|
+
var CABProductSection = import_zod48.z.object({
|
|
3588
3645
|
...CABVariableFields,
|
|
3589
|
-
name:
|
|
3590
|
-
productId:
|
|
3591
|
-
sectionId:
|
|
3592
|
-
sections:
|
|
3593
|
-
sectionType:
|
|
3594
|
-
selectors:
|
|
3595
|
-
variantMode:
|
|
3646
|
+
name: import_zod48.z.string().optional(),
|
|
3647
|
+
productId: import_zod48.z.number().nullable().default(null),
|
|
3648
|
+
sectionId: import_zod48.z.uuid().default(() => (0, import_uuid7.v7)()),
|
|
3649
|
+
sections: import_zod48.z.union([import_zod48.z.array(CABVariantContent), import_zod48.z.strictObject({}).transform(() => [])]).default(() => []),
|
|
3650
|
+
sectionType: import_zod48.z.literal(SectionType.product).default(SectionType.product),
|
|
3651
|
+
selectors: import_zod48.z.record(import_zod48.z.string(), import_zod48.z.enum(variantSelectors).default(VariantSelector.menu)).default(() => ({})),
|
|
3652
|
+
variantMode: import_zod48.z.enum(variantModes).default(VariantMode.multiple)
|
|
3596
3653
|
});
|
|
3597
3654
|
|
|
3598
3655
|
// src/schema/widgets/checkout-and-beyond/products.ts
|
|
3599
|
-
var CABProductsSection =
|
|
3656
|
+
var CABProductsSection = import_zod49.z.object({
|
|
3600
3657
|
...CABVariableFields,
|
|
3601
|
-
name:
|
|
3602
|
-
sectionId:
|
|
3603
|
-
sections:
|
|
3604
|
-
sectionType:
|
|
3658
|
+
name: import_zod49.z.string().optional(),
|
|
3659
|
+
sectionId: import_zod49.z.uuid().default(() => (0, import_uuid8.v7)()),
|
|
3660
|
+
sections: import_zod49.z.union([import_zod49.z.array(import_zod49.z.lazy(() => CABProductSection)), import_zod49.z.strictObject({}).transform(() => [])]).default(() => []),
|
|
3661
|
+
sectionType: import_zod49.z.literal(SectionType.products).default(SectionType.products)
|
|
3605
3662
|
});
|
|
3606
3663
|
|
|
3607
3664
|
// src/schema/widgets/checkout-and-beyond/offers.ts
|
|
3608
|
-
var CABOffersSection =
|
|
3665
|
+
var CABOffersSection = import_zod50.z.lazy(
|
|
3609
3666
|
() => CABLayoutSection.omit({ sections: true, sectionType: true }).extend({
|
|
3610
3667
|
/**
|
|
3611
3668
|
* A rule between consecutive cards in the vertical list — legacy checkout-offers' `<Divider />`,
|
|
@@ -3613,8 +3670,8 @@ var CABOffersSection = import_zod49.z.lazy(
|
|
|
3613
3670
|
* run of products). Optional, not defaulted: only the v1 converter sets it (REB-24265); a
|
|
3614
3671
|
* hand-built tree keeps React CAB's dividerless rendering.
|
|
3615
3672
|
*/
|
|
3616
|
-
divider:
|
|
3617
|
-
sections:
|
|
3673
|
+
divider: import_zod50.z.boolean().optional(),
|
|
3674
|
+
sections: import_zod50.z.union([import_zod50.z.array(import_zod50.z.lazy(() => CABSection)), import_zod50.z.strictObject({}).transform(() => [])]).default(() => [
|
|
3618
3675
|
CABBannerSection.parse({
|
|
3619
3676
|
buttonField: "undoAddToOrder",
|
|
3620
3677
|
color: "success",
|
|
@@ -3628,77 +3685,77 @@ var CABOffersSection = import_zod49.z.lazy(
|
|
|
3628
3685
|
CABDataSourceSection.parse({}),
|
|
3629
3686
|
CABProductsSection.parse({})
|
|
3630
3687
|
]),
|
|
3631
|
-
sectionType:
|
|
3688
|
+
sectionType: import_zod50.z.literal(SectionType.offers).default(SectionType.offers)
|
|
3632
3689
|
})
|
|
3633
3690
|
);
|
|
3634
3691
|
|
|
3635
3692
|
// src/schema/widgets/checkout-and-beyond/carousel.ts
|
|
3636
|
-
var CABCarouselSection =
|
|
3693
|
+
var CABCarouselSection = import_zod51.z.lazy(
|
|
3637
3694
|
() => CABLayoutSection.omit({ sections: true, sectionType: true }).extend({
|
|
3638
|
-
autoAdvanceInterval:
|
|
3639
|
-
itemsAtOnce:
|
|
3695
|
+
autoAdvanceInterval: import_zod51.z.number().default(0),
|
|
3696
|
+
itemsAtOnce: import_zod51.z.number().min(1).default(1),
|
|
3640
3697
|
/** Card arrangement for the offers child (`horizontal` = side-by-side) — NOT the carousel's own `direction`. */
|
|
3641
|
-
offersDirection:
|
|
3642
|
-
sections:
|
|
3643
|
-
sectionType:
|
|
3698
|
+
offersDirection: import_zod51.z.enum(offersDirections).default("vertical"),
|
|
3699
|
+
sections: import_zod51.z.union([import_zod51.z.array(import_zod51.z.lazy(() => CABSection)), import_zod51.z.strictObject({}).transform(() => [])]).default(() => [CABOffersSection.parse({})]),
|
|
3700
|
+
sectionType: import_zod51.z.literal(SectionType.carousel).default(SectionType.carousel)
|
|
3644
3701
|
})
|
|
3645
3702
|
);
|
|
3646
3703
|
|
|
3647
3704
|
// src/schema/widgets/checkout-and-beyond/cartLine.ts
|
|
3648
|
-
var
|
|
3649
|
-
var CABCartLineSection =
|
|
3705
|
+
var import_zod52 = require("zod");
|
|
3706
|
+
var CABCartLineSection = import_zod52.z.lazy(
|
|
3650
3707
|
() => CABLayoutSection.omit({ sections: true, sectionType: true }).extend({
|
|
3651
|
-
sections:
|
|
3652
|
-
sectionType:
|
|
3708
|
+
sections: import_zod52.z.union([import_zod52.z.array(import_zod52.z.lazy(() => CABSection)), import_zod52.z.strictObject({}).transform(() => [])]).default(() => [CABButtonSection.parse({ action: ButtonAction.switchToSubscription })]),
|
|
3709
|
+
sectionType: import_zod52.z.literal(SectionType.cartLine).default(SectionType.cartLine)
|
|
3653
3710
|
})
|
|
3654
3711
|
);
|
|
3655
3712
|
|
|
3656
3713
|
// src/schema/widgets/checkout-and-beyond/discount.ts
|
|
3657
3714
|
var import_uuid9 = require("uuid");
|
|
3658
|
-
var
|
|
3659
|
-
var CABDiscountSection =
|
|
3715
|
+
var import_zod53 = require("zod");
|
|
3716
|
+
var CABDiscountSection = import_zod53.z.object({
|
|
3660
3717
|
...CABVariableFields,
|
|
3661
|
-
amount:
|
|
3662
|
-
discountedBy:
|
|
3663
|
-
discountedFrom:
|
|
3664
|
-
message:
|
|
3665
|
-
name:
|
|
3666
|
-
quantity:
|
|
3667
|
-
sectionId:
|
|
3668
|
-
sectionType:
|
|
3669
|
-
type:
|
|
3718
|
+
amount: import_zod53.z.union([import_zod53.z.number(), import_zod53.z.string()]).catch(0),
|
|
3719
|
+
discountedBy: import_zod53.z.string().optional(),
|
|
3720
|
+
discountedFrom: import_zod53.z.enum(discountSources).optional().catch(void 0),
|
|
3721
|
+
message: import_zod53.z.string().optional(),
|
|
3722
|
+
name: import_zod53.z.string().optional(),
|
|
3723
|
+
quantity: import_zod53.z.number().default(1),
|
|
3724
|
+
sectionId: import_zod53.z.uuid().default(() => (0, import_uuid9.v7)()),
|
|
3725
|
+
sectionType: import_zod53.z.literal(SectionType.discount).default(SectionType.discount),
|
|
3726
|
+
type: import_zod53.z.enum(discountTypes).catch("none")
|
|
3670
3727
|
});
|
|
3671
3728
|
|
|
3672
3729
|
// src/schema/widgets/checkout-and-beyond/monetize.ts
|
|
3673
3730
|
var import_uuid10 = require("uuid");
|
|
3674
|
-
var
|
|
3675
|
-
var CABMonetizeAds =
|
|
3676
|
-
requestId:
|
|
3731
|
+
var import_zod54 = require("zod");
|
|
3732
|
+
var CABMonetizeAds = import_zod54.z.object({
|
|
3733
|
+
requestId: import_zod54.z.string().optional(),
|
|
3677
3734
|
/** Defaulted here, never in the beacon: absence of information is `ads` itself being absent. */
|
|
3678
|
-
testing:
|
|
3735
|
+
testing: import_zod54.z.boolean().default(false)
|
|
3679
3736
|
});
|
|
3680
|
-
var CABMonetizeSection =
|
|
3737
|
+
var CABMonetizeSection = import_zod54.z.object({
|
|
3681
3738
|
...CABVariableFields,
|
|
3682
3739
|
ads: CABMonetizeAds.optional(),
|
|
3683
|
-
name:
|
|
3740
|
+
name: import_zod54.z.string().optional(),
|
|
3684
3741
|
/**
|
|
3685
3742
|
* Server-hydrated offer cards (inline hydration): when `/cab/sections` was asked with a `monetize`
|
|
3686
3743
|
* context block, the composed cards ride the marker itself — `[]` means "hydrated, no fill" (render
|
|
3687
3744
|
* nothing, skip the fetch); ABSENT means "not hydrated" (the client fetches via `/cab/monetize`).
|
|
3688
3745
|
*/
|
|
3689
|
-
offers:
|
|
3746
|
+
offers: import_zod54.z.array(import_zod54.z.lazy(() => CABSection)).optional(),
|
|
3690
3747
|
/** 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. */
|
|
3691
|
-
privacyPolicyUrl:
|
|
3692
|
-
sectionId:
|
|
3693
|
-
sectionType:
|
|
3748
|
+
privacyPolicyUrl: import_zod54.z.string().optional(),
|
|
3749
|
+
sectionId: import_zod54.z.uuid().default(() => (0, import_uuid10.v7)()),
|
|
3750
|
+
sectionType: import_zod54.z.literal(SectionType.monetize).default(SectionType.monetize),
|
|
3694
3751
|
/** Ads-taxonomy sub-vertical id (the widget's `sub_vertical` setting); paired with `vertical`. */
|
|
3695
|
-
subVertical:
|
|
3752
|
+
subVertical: import_zod54.z.string().optional(),
|
|
3696
3753
|
/** Ads-taxonomy vertical id (the widget's `vertical` setting) — with `subVertical`, the admin Monetize editor's two configurables. */
|
|
3697
|
-
vertical:
|
|
3754
|
+
vertical: import_zod54.z.string().optional()
|
|
3698
3755
|
});
|
|
3699
3756
|
|
|
3700
3757
|
// src/schema/widgets/checkout-and-beyond/progressBar.ts
|
|
3701
|
-
var
|
|
3758
|
+
var import_zod55 = require("zod");
|
|
3702
3759
|
|
|
3703
3760
|
// src/schema/widgets/checkout-and-beyond/giftLabels.ts
|
|
3704
3761
|
var GIFT_LABELS = {
|
|
@@ -3817,34 +3874,34 @@ var GIFT_LABELS = {
|
|
|
3817
3874
|
};
|
|
3818
3875
|
|
|
3819
3876
|
// src/schema/widgets/checkout-and-beyond/progressBar.ts
|
|
3820
|
-
var CABProgressTierExclusion =
|
|
3821
|
-
collectionIds:
|
|
3822
|
-
productIds:
|
|
3823
|
-
tags:
|
|
3824
|
-
type:
|
|
3877
|
+
var CABProgressTierExclusion = import_zod55.z.object({
|
|
3878
|
+
collectionIds: import_zod55.z.array(import_zod55.z.number().int().positive()).default(() => []),
|
|
3879
|
+
productIds: import_zod55.z.array(import_zod55.z.number().int().positive()).default(() => []),
|
|
3880
|
+
tags: import_zod55.z.array(import_zod55.z.string().min(1)).default(() => []),
|
|
3881
|
+
type: import_zod55.z.enum(progressTierExclusionTypes)
|
|
3825
3882
|
});
|
|
3826
|
-
var CABProgressTier =
|
|
3883
|
+
var CABProgressTier = import_zod55.z.object({
|
|
3827
3884
|
/**
|
|
3828
3885
|
* Order-discount tiers only (onsite `discount`): the reward the order-discount Function applies at
|
|
3829
3886
|
* cart time, carried so the client can resolve the `{{discountAmount}}` token in this tier's copy.
|
|
3830
3887
|
* `fixedAmount`: shop-currency CENTS (FX-scaled by the client, like {@link CABProgressTier.threshold});
|
|
3831
3888
|
* `percentage`: the whole-percent number rendered raw (`{n}%`). Absent on non-discount tiers.
|
|
3832
3889
|
*/
|
|
3833
|
-
discount:
|
|
3890
|
+
discount: import_zod55.z.object({ amount: import_zod55.z.number().nonnegative(), type: import_zod55.z.enum(["fixedAmount", "percentage"]) }).optional(),
|
|
3834
3891
|
/**
|
|
3835
3892
|
* Per-tier exclusion rules (onsite `exclusions` when `exclusions_enabled`): lines they match don't count
|
|
3836
3893
|
* toward this tier. Empty (the default, and the converter's output for a disabled or ruleless tier) means
|
|
3837
3894
|
* the tier measures the plain bar-level adjusted progress. Consumers read ONLY the list named by the rule's
|
|
3838
3895
|
* `type` — the converter leaves the other two at `[]`, so a populated off-type list never reaches the tree.
|
|
3839
3896
|
*/
|
|
3840
|
-
exclusions:
|
|
3897
|
+
exclusions: import_zod55.z.array(CABProgressTierExclusion).default(() => []),
|
|
3841
3898
|
/**
|
|
3842
3899
|
* Smart-cart product (gift) tiers only (onsite `filter_oos_variants`): when set, the client drops this
|
|
3843
3900
|
* tier entirely once its gift has NO in-stock eligible variant — the milestone, fill slot and gift
|
|
3844
3901
|
* controls all disappear, mirroring onsite removing the tier from `bar.tiers` before it renders. Absent
|
|
3845
3902
|
* on shipping/discount/decorative tiers and left off by default (the tier renders regardless of stock).
|
|
3846
3903
|
*/
|
|
3847
|
-
filterOosVariants:
|
|
3904
|
+
filterOosVariants: import_zod55.z.boolean().default(false),
|
|
3848
3905
|
/**
|
|
3849
3906
|
* Smart-cart product (gift) tiers only: the reward unlocked at this tier. The client enriches
|
|
3850
3907
|
* `productId`/`variantIds` to live variants (availability, price) and adds the chosen one to the cart
|
|
@@ -3852,10 +3909,10 @@ var CABProgressTier = import_zod54.z.object({
|
|
|
3852
3909
|
* tiers and on tiers with no configured product. Cart add/remove is a later stage; carried here so the
|
|
3853
3910
|
* tree is complete.
|
|
3854
3911
|
*/
|
|
3855
|
-
gift:
|
|
3856
|
-
productId:
|
|
3857
|
-
title:
|
|
3858
|
-
variantIds:
|
|
3912
|
+
gift: import_zod55.z.object({
|
|
3913
|
+
productId: import_zod55.z.number().int().positive(),
|
|
3914
|
+
title: import_zod55.z.string().optional(),
|
|
3915
|
+
variantIds: import_zod55.z.array(import_zod55.z.number().int().positive()).default(() => [])
|
|
3859
3916
|
}).optional(),
|
|
3860
3917
|
/**
|
|
3861
3918
|
* The step-row icon's square size in PIXELS (onsite `product_tier_element_size`, an admin px string the
|
|
@@ -3875,7 +3932,7 @@ var CABProgressTier = import_zod54.z.object({
|
|
|
3875
3932
|
* renderer never spells a fallback), which also makes a tree authored before this field render at
|
|
3876
3933
|
* React's size rather than the old hardcoded 20.
|
|
3877
3934
|
*/
|
|
3878
|
-
iconSizePx:
|
|
3935
|
+
iconSizePx: import_zod55.z.number().int().min(1).max(64).default(18),
|
|
3879
3936
|
/**
|
|
3880
3937
|
* The step-row label at this tier's slot (onsite `getTierLabel`): the merchant custom label, else the
|
|
3881
3938
|
* type default — 'Free Shipping' or '{n}% Discount'. A PRODUCT tier gets NO converter label: its name is
|
|
@@ -3885,35 +3942,35 @@ var CABProgressTier = import_zod54.z.object({
|
|
|
3885
3942
|
* turns a blank label into an absent key, and a client-authored blank means the same thing — the renderer
|
|
3886
3943
|
* emits no caption slot rather than an empty one). Plain text — a compact icon+label.
|
|
3887
3944
|
*/
|
|
3888
|
-
label:
|
|
3945
|
+
label: import_zod55.z.record(import_zod55.z.string(), import_zod55.z.string()).optional(),
|
|
3889
3946
|
/**
|
|
3890
3947
|
* Smart-cart product (gift) tiers only (onsite `product_tier_image`): show the gift's product image in
|
|
3891
3948
|
* the step-row slot instead of the generic bag icon. The converter can't supply the image URL (config
|
|
3892
3949
|
* carries only product IDs), so the client resolves it (authoritative Shopify featured image, React
|
|
3893
3950
|
* parity) and falls back to the bag icon when the flag is off or no image resolves. Default false.
|
|
3894
3951
|
*/
|
|
3895
|
-
productTierImage:
|
|
3952
|
+
productTierImage: import_zod55.z.boolean().default(false),
|
|
3896
3953
|
/**
|
|
3897
3954
|
* The tier's goal, measured per `unit`. `currency` (default): SHOP-currency cents — the canonical
|
|
3898
3955
|
* fallback: when the buyer's presentment currency has no entry in `thresholds`, the client
|
|
3899
3956
|
* multiplies this by the live FX rate (converter maps the v1 `unlock_price`, e.g. `75` → `7500`).
|
|
3900
3957
|
* `item`: a raw item count — no cents, no FX, no `thresholds` overrides.
|
|
3901
3958
|
*/
|
|
3902
|
-
threshold:
|
|
3959
|
+
threshold: import_zod55.z.number().int().nonnegative(),
|
|
3903
3960
|
/**
|
|
3904
3961
|
* Per-presentment-currency goal overrides — lowercased ISO currency code → cents (e.g. `{ cad: 9900 }`).
|
|
3905
3962
|
* When the buyer's currency has an entry, the client uses it verbatim INSTEAD of FX-converting
|
|
3906
3963
|
* `threshold`, so merchants show intentional, clean per-market amounts (Shopify Markets) rather than a
|
|
3907
3964
|
* converted base. Defaults to `{}` — no overrides means always fall back to `threshold`.
|
|
3908
3965
|
*/
|
|
3909
|
-
thresholds:
|
|
3966
|
+
thresholds: import_zod55.z.record(import_zod55.z.string(), import_zod55.z.number().int().nonnegative()).default(() => ({})),
|
|
3910
3967
|
/**
|
|
3911
3968
|
* Smart-cart tier identifier, mirrored onto the gift cart line's `_tier` attribute so the client can
|
|
3912
3969
|
* match an in-cart gift back to its tier (add on reach, remove on downgrade/decline). Absent on the
|
|
3913
3970
|
* shipping bar (single unlabeled tier, no gift).
|
|
3914
3971
|
*/
|
|
3915
|
-
tierId:
|
|
3916
|
-
tierType:
|
|
3972
|
+
tierId: import_zod55.z.string().optional(),
|
|
3973
|
+
tierType: import_zod55.z.enum(progressTierTypes).default(ProgressTierType.shipping),
|
|
3917
3974
|
/**
|
|
3918
3975
|
* What this tier's progress is measured in — PER TIER (onsite's `unlock_condition_type` model, NOT
|
|
3919
3976
|
* the React port's bar-level `tiers[0]` shortcut). `currency` compares money cents against the
|
|
@@ -3924,9 +3981,9 @@ var CABProgressTier = import_zod54.z.object({
|
|
|
3924
3981
|
* count carries no injected noun (no English `item`/`items` inflection on localized copy); merchant
|
|
3925
3982
|
* template text supplies grammatically-neutral wording around the token.
|
|
3926
3983
|
*/
|
|
3927
|
-
unit:
|
|
3984
|
+
unit: import_zod55.z.enum(progressTierUnits).default(ProgressTierUnit.currency)
|
|
3928
3985
|
});
|
|
3929
|
-
var CABProgressBarSection =
|
|
3986
|
+
var CABProgressBarSection = import_zod55.z.lazy(
|
|
3930
3987
|
() => CABLayoutSection.omit({ sectionType: true }).extend({
|
|
3931
3988
|
/**
|
|
3932
3989
|
* The onsite bar id (smart-cart TPB bars only). The client mirrors it to the cart's `_barId` attribute
|
|
@@ -3935,35 +3992,35 @@ var CABProgressBarSection = import_zod54.z.lazy(
|
|
|
3935
3992
|
* checkout reaches the extension without it, so the client writes it or the tier gift's 100% discount
|
|
3936
3993
|
* (and any tier order discount) never applies. Absent on the v1 shipping bar (no gift tiers, no id).
|
|
3937
3994
|
*/
|
|
3938
|
-
barId:
|
|
3995
|
+
barId: import_zod55.z.string().optional(),
|
|
3939
3996
|
/** Empty = shown everywhere; otherwise uppercase ISO country codes. */
|
|
3940
|
-
countryCodes:
|
|
3997
|
+
countryCodes: import_zod55.z.array(import_zod55.z.string().transform((code) => code.trim().toUpperCase())).default(() => []),
|
|
3941
3998
|
/**
|
|
3942
3999
|
* Uppercase ISO codes where a higher-precedence geo bar applies, so this (default, non-geo) bar is
|
|
3943
4000
|
* hidden there — replicates React `getbar`'s geo-match-over-default precedence. Empty = never excluded.
|
|
3944
4001
|
*/
|
|
3945
|
-
excludeCountryCodes:
|
|
4002
|
+
excludeCountryCodes: import_zod55.z.array(import_zod55.z.string().transform((code) => code.trim().toUpperCase())).default(() => []),
|
|
3946
4003
|
/**
|
|
3947
4004
|
* Measure progress against the PRE-discount subtotal (onsite `exclude_discount_in_subtotal`, and
|
|
3948
4005
|
* forced on for bars with a discount tier so its own reward can't un-reach the tier). The client
|
|
3949
4006
|
* adds the cart's discount allocations back to the live subtotal.
|
|
3950
4007
|
*/
|
|
3951
|
-
excludeDiscountInSubtotal:
|
|
4008
|
+
excludeDiscountInSubtotal: import_zod55.z.boolean().default(false),
|
|
3952
4009
|
/** Variant ids the client subtracts from the adjusted subtotal (React `bar.excluded_products`). */
|
|
3953
|
-
excludedVariantIds:
|
|
4010
|
+
excludedVariantIds: import_zod55.z.array(import_zod55.z.number().int().positive()).default(() => []),
|
|
3954
4011
|
/**
|
|
3955
4012
|
* When the cart holds a subscription item, treat the bar as reached regardless of subtotal (React
|
|
3956
4013
|
* `free_shipping_on_subscription(s)`). `freeShippingOnAll` is already a zero-threshold tier instead.
|
|
3957
4014
|
*/
|
|
3958
|
-
freeShippingOnSubscription:
|
|
4015
|
+
freeShippingOnSubscription: import_zod55.z.boolean().default(false),
|
|
3959
4016
|
/** Localized heading over the gift controls (onsite `gift_area_title`, default 'FREE GIFTS'). */
|
|
3960
|
-
giftAreaTitle:
|
|
4017
|
+
giftAreaTitle: import_zod55.z.record(import_zod55.z.string(), import_zod55.z.string()).default(() => ({ en: "FREE GIFTS" })),
|
|
3961
4018
|
/** Localized gift-control labels (add/remove/heading); a tier's gift `title` beats `yourGift`. */
|
|
3962
|
-
giftLabels:
|
|
3963
|
-
addGift:
|
|
3964
|
-
remove:
|
|
3965
|
-
selectOptions:
|
|
3966
|
-
yourGift:
|
|
4019
|
+
giftLabels: import_zod55.z.object({
|
|
4020
|
+
addGift: import_zod55.z.record(import_zod55.z.string(), import_zod55.z.string()).default(() => ({ ...GIFT_LABELS.addGift })),
|
|
4021
|
+
remove: import_zod55.z.record(import_zod55.z.string(), import_zod55.z.string()).default(() => ({ ...GIFT_LABELS.remove })),
|
|
4022
|
+
selectOptions: import_zod55.z.record(import_zod55.z.string(), import_zod55.z.string()).default(() => ({ ...GIFT_LABELS.selectOptions })),
|
|
4023
|
+
yourGift: import_zod55.z.record(import_zod55.z.string(), import_zod55.z.string()).default(() => ({ ...GIFT_LABELS.yourGift }))
|
|
3967
4024
|
}).default(() => ({
|
|
3968
4025
|
addGift: { ...GIFT_LABELS.addGift },
|
|
3969
4026
|
remove: { ...GIFT_LABELS.remove },
|
|
@@ -3971,38 +4028,38 @@ var CABProgressBarSection = import_zod54.z.lazy(
|
|
|
3971
4028
|
yourGift: { ...GIFT_LABELS.yourGift }
|
|
3972
4029
|
})),
|
|
3973
4030
|
/** The bar's a11y label; the merchant names it in the editor, else this default (React parity). */
|
|
3974
|
-
name:
|
|
4031
|
+
name: import_zod55.z.string().default("Order progress"),
|
|
3975
4032
|
/**
|
|
3976
4033
|
* Bar fill color. An explicit (widget-authored) value is used verbatim; when absent the server
|
|
3977
4034
|
* fills it with the live shop theme's `buttonBackground` (React `useRebuyTheme` parity). Still
|
|
3978
4035
|
* absent after that ⇒ the theme fetch failed and the client renders its platform-default bar —
|
|
3979
4036
|
* optional, not defaulted, so "merchant chose no color" stays distinguishable from any real value.
|
|
3980
4037
|
*/
|
|
3981
|
-
progressColor:
|
|
3982
|
-
sectionType:
|
|
4038
|
+
progressColor: import_zod55.z.string().optional(),
|
|
4039
|
+
sectionType: import_zod55.z.literal(SectionType.progressBar).default(SectionType.progressBar),
|
|
3983
4040
|
/**
|
|
3984
4041
|
* The bar's milestones in the merchant's CONFIGURED order — the renderer does NOT sort them (022
|
|
3985
4042
|
* O-B2: sorting by resolved threshold reversed configured milestones on out-of-order or mixed-unit
|
|
3986
4043
|
* count-vs-cents bars). Drives the fill (even slot per tier) and, for smart-cart product tiers, the
|
|
3987
4044
|
* gift add/remove. The visual tier display lives in `sections` (composable), NOT here.
|
|
3988
4045
|
*/
|
|
3989
|
-
tiers:
|
|
4046
|
+
tiers: import_zod55.z.union([import_zod55.z.array(CABProgressTier), import_zod55.z.strictObject({}).transform(() => [])]).default(() => [])
|
|
3990
4047
|
})
|
|
3991
4048
|
);
|
|
3992
4049
|
|
|
3993
4050
|
// src/schema/widgets/checkout-and-beyond/quantity.ts
|
|
3994
4051
|
var import_uuid11 = require("uuid");
|
|
3995
|
-
var
|
|
3996
|
-
var CABQuantitySection =
|
|
4052
|
+
var import_zod56 = require("zod");
|
|
4053
|
+
var CABQuantitySection = import_zod56.z.object({
|
|
3997
4054
|
...CABVariableFields,
|
|
3998
|
-
errorMessages:
|
|
3999
|
-
|
|
4000
|
-
|
|
4055
|
+
errorMessages: import_zod56.z.record(
|
|
4056
|
+
import_zod56.z.string(),
|
|
4057
|
+
import_zod56.z.object({
|
|
4001
4058
|
/** `{{step}}` is interpolated at render — the off-increment message React never gave a merchant key. */
|
|
4002
|
-
increment:
|
|
4003
|
-
max:
|
|
4004
|
-
min:
|
|
4005
|
-
neg:
|
|
4059
|
+
increment: import_zod56.z.string().optional(),
|
|
4060
|
+
max: import_zod56.z.string().optional(),
|
|
4061
|
+
min: import_zod56.z.string().optional(),
|
|
4062
|
+
neg: import_zod56.z.string().optional()
|
|
4006
4063
|
})
|
|
4007
4064
|
).default({
|
|
4008
4065
|
en: {
|
|
@@ -4012,18 +4069,18 @@ var CABQuantitySection = import_zod55.z.object({
|
|
|
4012
4069
|
neg: "Quantity cannot be negative"
|
|
4013
4070
|
}
|
|
4014
4071
|
}),
|
|
4015
|
-
inputType:
|
|
4016
|
-
max:
|
|
4017
|
-
min:
|
|
4072
|
+
inputType: import_zod56.z.enum(quantityInputs).default(QuantityInput.select),
|
|
4073
|
+
max: import_zod56.z.number().min(1).max(100).default(10),
|
|
4074
|
+
min: import_zod56.z.number().min(1).default(1),
|
|
4018
4075
|
/** The a11y label for the quantity control; the merchant names it in the editor, else this default. */
|
|
4019
|
-
name:
|
|
4020
|
-
sectionId:
|
|
4021
|
-
sectionType:
|
|
4076
|
+
name: import_zod56.z.string().default("Quantity"),
|
|
4077
|
+
sectionId: import_zod56.z.uuid().default(() => (0, import_uuid11.v7)()),
|
|
4078
|
+
sectionType: import_zod56.z.literal(SectionType.quantity).default(SectionType.quantity)
|
|
4022
4079
|
});
|
|
4023
4080
|
|
|
4024
4081
|
// src/schema/widgets/checkout-and-beyond/reviews.ts
|
|
4025
4082
|
var import_uuid12 = require("uuid");
|
|
4026
|
-
var
|
|
4083
|
+
var import_zod57 = require("zod");
|
|
4027
4084
|
|
|
4028
4085
|
// src/schema/widgets/checkout-and-beyond/reviewLabels.ts
|
|
4029
4086
|
var REVIEW_LABELS = {
|
|
@@ -4086,68 +4143,68 @@ var REVIEW_LABELS = {
|
|
|
4086
4143
|
};
|
|
4087
4144
|
|
|
4088
4145
|
// src/schema/widgets/checkout-and-beyond/reviews.ts
|
|
4089
|
-
var CABReviewsSection =
|
|
4146
|
+
var CABReviewsSection = import_zod57.z.object({
|
|
4090
4147
|
...CABVariableFields,
|
|
4091
|
-
color:
|
|
4148
|
+
color: import_zod57.z.string().default("#fadb14"),
|
|
4092
4149
|
/**
|
|
4093
4150
|
* Localized review-count templates (`{{reviewCount}}`), one/other plural forms; the client picks the
|
|
4094
4151
|
* form via `Intl.PluralRules`. Defaults here (schema-first) so every tree localizes without converter
|
|
4095
4152
|
* or merchant work.
|
|
4096
4153
|
*/
|
|
4097
|
-
countLabels:
|
|
4098
|
-
one:
|
|
4099
|
-
other:
|
|
4154
|
+
countLabels: import_zod57.z.object({
|
|
4155
|
+
one: import_zod57.z.record(import_zod57.z.string(), import_zod57.z.string()).default(() => ({ ...REVIEW_LABELS.one })),
|
|
4156
|
+
other: import_zod57.z.record(import_zod57.z.string(), import_zod57.z.string()).default(() => ({ ...REVIEW_LABELS.other }))
|
|
4100
4157
|
}).default(() => ({ one: { ...REVIEW_LABELS.one }, other: { ...REVIEW_LABELS.other } })),
|
|
4101
|
-
name:
|
|
4102
|
-
sectionId:
|
|
4103
|
-
sectionType:
|
|
4104
|
-
size:
|
|
4158
|
+
name: import_zod57.z.string().optional(),
|
|
4159
|
+
sectionId: import_zod57.z.uuid().default(() => (0, import_uuid12.v7)()),
|
|
4160
|
+
sectionType: import_zod57.z.literal(SectionType.reviews).default(SectionType.reviews),
|
|
4161
|
+
size: import_zod57.z.enum(reviewsSizes).default(ReviewsSize.default),
|
|
4105
4162
|
/**
|
|
4106
4163
|
* Star outline color, interpolated into a style by the renderer, so it is hex-constrained like
|
|
4107
4164
|
* `CABButtonSection.color`. The legacy source (`PostPurchaseSettings.styles.starStrokeColor`) is a free
|
|
4108
4165
|
* string: its converter must validate and fall back to this default rather than let one odd value drop
|
|
4109
4166
|
* the whole reviews section.
|
|
4110
4167
|
*/
|
|
4111
|
-
strokeColor:
|
|
4168
|
+
strokeColor: import_zod57.z.string().regex(HEX_COLOR_REGEX).default("#fadb14"),
|
|
4112
4169
|
/** Star outline width in px; `0` draws no outline. The legacy `styles.strokeWidth` is a STRING ('1') — its converter coerces. */
|
|
4113
|
-
strokeWidth:
|
|
4170
|
+
strokeWidth: import_zod57.z.number().nonnegative().default(0)
|
|
4114
4171
|
});
|
|
4115
4172
|
|
|
4116
4173
|
// src/schema/widgets/checkout-and-beyond/separator.ts
|
|
4117
4174
|
var import_uuid13 = require("uuid");
|
|
4118
|
-
var
|
|
4119
|
-
var CABSeparatorSection =
|
|
4175
|
+
var import_zod58 = require("zod");
|
|
4176
|
+
var CABSeparatorSection = import_zod58.z.object({
|
|
4120
4177
|
...CABVariableFields,
|
|
4121
|
-
sectionId:
|
|
4122
|
-
sectionType:
|
|
4178
|
+
sectionId: import_zod58.z.uuid().default(() => (0, import_uuid13.v7)()),
|
|
4179
|
+
sectionType: import_zod58.z.literal(SectionType.separator).default(SectionType.separator)
|
|
4123
4180
|
});
|
|
4124
4181
|
|
|
4125
4182
|
// src/schema/widgets/checkout-and-beyond/variants.ts
|
|
4126
4183
|
var import_compat5 = require("es-toolkit/compat");
|
|
4127
4184
|
var import_uuid14 = require("uuid");
|
|
4128
|
-
var
|
|
4129
|
-
var CABVariantsSection =
|
|
4185
|
+
var import_zod59 = require("zod");
|
|
4186
|
+
var CABVariantsSection = import_zod59.z.object({
|
|
4130
4187
|
...CABVariableFields,
|
|
4131
|
-
hideOutOfStockVariants:
|
|
4132
|
-
name:
|
|
4133
|
-
sectionId:
|
|
4134
|
-
sectionType:
|
|
4135
|
-
selector:
|
|
4136
|
-
variantMode:
|
|
4188
|
+
hideOutOfStockVariants: import_zod59.z.boolean().default(false),
|
|
4189
|
+
name: import_zod59.z.string().optional(),
|
|
4190
|
+
sectionId: import_zod59.z.uuid().default(() => (0, import_uuid14.v7)()),
|
|
4191
|
+
sectionType: import_zod59.z.literal(SectionType.variants).default(SectionType.variants),
|
|
4192
|
+
selector: import_zod59.z.enum((0, import_compat5.slice)(variantSelectors, 0, 3)).default(VariantSelector.menu),
|
|
4193
|
+
variantMode: import_zod59.z.enum(variantModes).default(VariantMode.multiple)
|
|
4137
4194
|
});
|
|
4138
4195
|
|
|
4139
4196
|
// src/schema/widgets/checkout-and-beyond/shared.ts
|
|
4140
|
-
var CABBorder =
|
|
4141
|
-
radius:
|
|
4142
|
-
style:
|
|
4143
|
-
width:
|
|
4197
|
+
var CABBorder = import_zod60.z.object({
|
|
4198
|
+
radius: import_zod60.z.enum(borderRadii).default(BorderRadius.base),
|
|
4199
|
+
style: import_zod60.z.enum(borderStyles).default(BorderStyle.none),
|
|
4200
|
+
width: import_zod60.z.enum(borderWidths).default(BorderWidth.base)
|
|
4144
4201
|
}).default({
|
|
4145
4202
|
radius: BorderRadius.base,
|
|
4146
4203
|
style: BorderStyle.none,
|
|
4147
4204
|
width: BorderWidth.base
|
|
4148
4205
|
});
|
|
4149
|
-
var CABSection =
|
|
4150
|
-
() =>
|
|
4206
|
+
var CABSection = import_zod60.z.lazy(
|
|
4207
|
+
() => import_zod60.z.discriminatedUnion("sectionType", [
|
|
4151
4208
|
CABBannerSection,
|
|
4152
4209
|
CABButtonSection,
|
|
4153
4210
|
CABCarouselSection,
|
|
@@ -4170,41 +4227,41 @@ var CABSection = import_zod59.z.lazy(
|
|
|
4170
4227
|
);
|
|
4171
4228
|
|
|
4172
4229
|
// src/schema/widgets/checkout-and-beyond/layout.ts
|
|
4173
|
-
var GridItem =
|
|
4174
|
-
var CABLayoutWrapping =
|
|
4175
|
-
breakAt:
|
|
4176
|
-
maxPerLine:
|
|
4230
|
+
var GridItem = import_zod61.z.union([import_zod61.z.literal("auto"), import_zod61.z.literal("fill"), import_zod61.z.string().regex(/^\d+%$/), import_zod61.z.number()]);
|
|
4231
|
+
var CABLayoutWrapping = import_zod61.z.object({
|
|
4232
|
+
breakAt: import_zod61.z.number().positive(),
|
|
4233
|
+
maxPerLine: import_zod61.z.number().int().positive()
|
|
4177
4234
|
});
|
|
4178
|
-
var CABLayoutSection =
|
|
4235
|
+
var CABLayoutSection = import_zod61.z.object({
|
|
4179
4236
|
...CABVariableFields,
|
|
4180
|
-
alignment:
|
|
4181
|
-
horizontal:
|
|
4182
|
-
vertical:
|
|
4237
|
+
alignment: import_zod61.z.object({
|
|
4238
|
+
horizontal: import_zod61.z.enum(horizontalAlignments).default(HorizontalAlignment.start),
|
|
4239
|
+
vertical: import_zod61.z.enum(verticalAlignments).default(VerticalAlignment.top)
|
|
4183
4240
|
}).default({
|
|
4184
4241
|
horizontal: HorizontalAlignment.start,
|
|
4185
4242
|
vertical: VerticalAlignment.top
|
|
4186
4243
|
}),
|
|
4187
|
-
border:
|
|
4188
|
-
buttonField:
|
|
4189
|
-
direction:
|
|
4244
|
+
border: import_zod61.z.lazy(() => CABBorder),
|
|
4245
|
+
buttonField: import_zod61.z.enum(buttonFields).optional(),
|
|
4246
|
+
direction: import_zod61.z.enum(directions).default(Direction.rows),
|
|
4190
4247
|
/**
|
|
4191
4248
|
* Platform chrome around the section, not a layout behavior: `callout` is a subdued box with block borders
|
|
4192
4249
|
* (the legacy post-purchase callout banner), `offer-content` the post-purchase offer's own content card.
|
|
4193
4250
|
*/
|
|
4194
|
-
frame:
|
|
4195
|
-
grid:
|
|
4196
|
-
columns:
|
|
4197
|
-
rows:
|
|
4251
|
+
frame: import_zod61.z.enum(layoutFrames).optional(),
|
|
4252
|
+
grid: import_zod61.z.object({
|
|
4253
|
+
columns: import_zod61.z.union([import_zod61.z.array(GridItem), import_zod61.z.undefined()]).default(() => ["auto"]),
|
|
4254
|
+
rows: import_zod61.z.union([import_zod61.z.array(GridItem), import_zod61.z.undefined()]).default(() => ["auto"])
|
|
4198
4255
|
}).default({ columns: ["auto"], rows: ["auto"] }).optional(),
|
|
4199
|
-
name:
|
|
4200
|
-
padding:
|
|
4201
|
-
sectionId:
|
|
4202
|
-
sections:
|
|
4203
|
-
sectionType:
|
|
4204
|
-
spacing:
|
|
4256
|
+
name: import_zod61.z.string().optional(),
|
|
4257
|
+
padding: import_zod61.z.enum(spacings).default(Spacing.none),
|
|
4258
|
+
sectionId: import_zod61.z.uuid().default(() => (0, import_uuid15.v7)()),
|
|
4259
|
+
sections: import_zod61.z.union([import_zod61.z.array(import_zod61.z.lazy(() => CABSection)), import_zod61.z.strictObject({}).transform(() => [])]).default(() => []),
|
|
4260
|
+
sectionType: import_zod61.z.literal(SectionType.layout).default(SectionType.layout),
|
|
4261
|
+
spacing: import_zod61.z.enum(spacings).default(Spacing.base),
|
|
4205
4262
|
/** Fire-and-forget impression pixel POSTed once when the section is shown (e.g. a Monetize offer view). */
|
|
4206
|
-
viewUrl:
|
|
4207
|
-
width:
|
|
4263
|
+
viewUrl: import_zod61.z.string().optional(),
|
|
4264
|
+
width: import_zod61.z.number().default(100),
|
|
4208
4265
|
wrapping: CABLayoutWrapping.optional()
|
|
4209
4266
|
});
|
|
4210
4267
|
|
|
@@ -4226,8 +4283,8 @@ var UI_LABELS = {
|
|
|
4226
4283
|
};
|
|
4227
4284
|
|
|
4228
4285
|
// src/schema/widgets/checkout-and-beyond/root.ts
|
|
4229
|
-
var localized = (fallback) =>
|
|
4230
|
-
var CABUILabels =
|
|
4286
|
+
var localized = (fallback) => import_zod62.z.record(import_zod62.z.string(), import_zod62.z.string()).default(() => ({ ...fallback })).transform((labels) => Object.keys(labels).length > 0 ? labels : { ...fallback });
|
|
4287
|
+
var CABUILabels = import_zod62.z.object({
|
|
4231
4288
|
currentPage: localized(UI_LABELS.currentPage),
|
|
4232
4289
|
guest: localized(UI_LABELS.guest),
|
|
4233
4290
|
loadingOptions: localized(UI_LABELS.loadingOptions),
|
|
@@ -4252,47 +4309,47 @@ var CABUILabels = import_zod61.z.object({
|
|
|
4252
4309
|
subscriptionOptions: { ...UI_LABELS.subscriptionOptions },
|
|
4253
4310
|
updating: { ...UI_LABELS.updating }
|
|
4254
4311
|
}));
|
|
4255
|
-
var TargetArea =
|
|
4256
|
-
fill:
|
|
4257
|
-
flip:
|
|
4258
|
-
icon:
|
|
4259
|
-
label:
|
|
4260
|
-
width:
|
|
4312
|
+
var TargetArea = import_zod62.z.object({
|
|
4313
|
+
fill: import_zod62.z.boolean().optional(),
|
|
4314
|
+
flip: import_zod62.z.enum(["both", "horizontal", "vertical"]).optional(),
|
|
4315
|
+
icon: import_zod62.z.string(),
|
|
4316
|
+
label: import_zod62.z.string(),
|
|
4317
|
+
width: import_zod62.z.string()
|
|
4261
4318
|
}).default(targetAreas[EditorMode.checkoutExtension][1]);
|
|
4262
|
-
var CABTracking =
|
|
4263
|
-
enableAttribution:
|
|
4264
|
-
enableSource:
|
|
4265
|
-
enableWidget:
|
|
4319
|
+
var CABTracking = import_zod62.z.object({
|
|
4320
|
+
enableAttribution: import_zod62.z.boolean().nullish().transform((value) => value ?? true),
|
|
4321
|
+
enableSource: import_zod62.z.boolean().nullish().transform((value) => value ?? true),
|
|
4322
|
+
enableWidget: import_zod62.z.boolean().nullish().transform((value) => value ?? true)
|
|
4266
4323
|
}).nullish().transform((value) => value ?? { enableAttribution: true, enableSource: true, enableWidget: true });
|
|
4267
|
-
var CABExperiment =
|
|
4268
|
-
elementId:
|
|
4269
|
-
experimentId:
|
|
4270
|
-
experimentType:
|
|
4271
|
-
selectedId:
|
|
4324
|
+
var CABExperiment = import_zod62.z.object({
|
|
4325
|
+
elementId: import_zod62.z.number(),
|
|
4326
|
+
experimentId: import_zod62.z.number(),
|
|
4327
|
+
experimentType: import_zod62.z.string(),
|
|
4328
|
+
selectedId: import_zod62.z.number()
|
|
4272
4329
|
});
|
|
4273
4330
|
var CABRootSection = CABLayoutSection.extend({
|
|
4274
|
-
editorMode:
|
|
4331
|
+
editorMode: import_zod62.z.enum(editorModes).default(EditorMode.checkoutExtension),
|
|
4275
4332
|
experiment: CABExperiment.optional(),
|
|
4276
4333
|
// Same rule as CABTracking above: the v1 converters pass raw legacy `previewMode` through, so a
|
|
4277
4334
|
// `null` must fall back rather than throw the widget; malformed values still throw.
|
|
4278
|
-
previewMode:
|
|
4279
|
-
storeId:
|
|
4335
|
+
previewMode: import_zod62.z.boolean().nullish().transform((value) => value ?? false),
|
|
4336
|
+
storeId: import_zod62.z.number().nullable().default(null),
|
|
4280
4337
|
targetArea: TargetArea.nullable(),
|
|
4281
4338
|
tracking: CABTracking,
|
|
4282
|
-
type:
|
|
4339
|
+
type: import_zod62.z.enum(widgetTypes).default(WidgetType.ui_extension_content_block),
|
|
4283
4340
|
uiLabels: CABUILabels,
|
|
4284
|
-
version:
|
|
4285
|
-
widgetId:
|
|
4341
|
+
version: import_zod62.z.literal(2).default(2),
|
|
4342
|
+
widgetId: import_zod62.z.number().nullable().default(null)
|
|
4286
4343
|
});
|
|
4287
4344
|
|
|
4288
4345
|
// src/schema/postPurchaseProductView.ts
|
|
4289
|
-
var PostPurchaseProductView =
|
|
4290
|
-
|
|
4346
|
+
var PostPurchaseProductView = import_zod63.z.union([
|
|
4347
|
+
import_zod63.z.object({
|
|
4291
4348
|
groupCatalog: PostPurchaseGroupCatalog.optional(),
|
|
4292
4349
|
initialVariant: PostPurchaseVariantSelector.optional(),
|
|
4293
4350
|
planCatalog: PostPurchasePlanCatalog.nullable().optional(),
|
|
4294
4351
|
preparation: PreparedPostPurchaseProduct.extend({
|
|
4295
|
-
display: PreparedPostPurchaseProduct.shape.display.extend({ description:
|
|
4352
|
+
display: PreparedPostPurchaseProduct.shape.display.extend({ description: import_zod63.z.string().nullable() }).refine(
|
|
4296
4353
|
({ description, descriptionDocument }) => description === null === (descriptionDocument !== void 0),
|
|
4297
4354
|
"Exactly one of the plain and rich descriptions is shown"
|
|
4298
4355
|
)
|
|
@@ -4301,33 +4358,33 @@ var PostPurchaseProductView = import_zod62.z.union([
|
|
|
4301
4358
|
sections: CABRootSection,
|
|
4302
4359
|
variantCatalog: PostPurchaseVariantCatalog.optional()
|
|
4303
4360
|
}),
|
|
4304
|
-
|
|
4361
|
+
import_zod63.z.object({
|
|
4305
4362
|
groupCatalog: PostPurchaseGroupCatalog.optional(),
|
|
4306
4363
|
initialVariant: PostPurchaseVariantSelector.optional(),
|
|
4307
4364
|
planCatalog: PostPurchasePlanCatalog.nullable().optional(),
|
|
4308
4365
|
preparation: PostPurchasePreparation.options[1],
|
|
4309
4366
|
purchaseOptions: PostPurchaseOptions.optional(),
|
|
4310
|
-
sections:
|
|
4367
|
+
sections: import_zod63.z.null(),
|
|
4311
4368
|
variantCatalog: PostPurchaseVariantCatalog.optional()
|
|
4312
4369
|
})
|
|
4313
4370
|
]);
|
|
4314
4371
|
|
|
4315
4372
|
// src/schema/postPurchaseProductCollectionView.ts
|
|
4316
|
-
var PostPurchaseProductCollectionView =
|
|
4317
|
-
members:
|
|
4318
|
-
|
|
4373
|
+
var PostPurchaseProductCollectionView = import_zod64.z.object({
|
|
4374
|
+
members: import_zod64.z.array(
|
|
4375
|
+
import_zod64.z.object({
|
|
4319
4376
|
productId: PostPurchaseProductId,
|
|
4320
|
-
productIndex:
|
|
4377
|
+
productIndex: import_zod64.z.number().int().nonnegative(),
|
|
4321
4378
|
view: PostPurchaseProductView
|
|
4322
4379
|
})
|
|
4323
4380
|
)
|
|
4324
4381
|
});
|
|
4325
|
-
var PostPurchaseCollectionChoice =
|
|
4382
|
+
var PostPurchaseCollectionChoice = import_zod64.z.object({
|
|
4326
4383
|
choice: PostPurchaseChoice.optional(),
|
|
4327
4384
|
productId: PostPurchaseProductId,
|
|
4328
4385
|
variantId: PostPurchaseVariantSelector.shape.variantId.optional()
|
|
4329
4386
|
}).strict();
|
|
4330
|
-
var PostPurchaseExcludedProductIds =
|
|
4387
|
+
var PostPurchaseExcludedProductIds = import_zod64.z.array(PostPurchaseProductId).default([]);
|
|
4331
4388
|
var PostPurchaseMemberSelector = PostPurchaseProgressSchema.shape.members.element.pick({ productId: true }).extend({ progressRevision: PostPurchaseProgressSchema.shape.revision });
|
|
4332
4389
|
var PostPurchaseMemberPointer = PostPurchaseProgressSchema.shape.members.element.omit({ status: true }).extend({
|
|
4333
4390
|
entryRevision: PostPurchaseProgressSchema.shape.entryRevision,
|
|
@@ -4340,7 +4397,7 @@ var PostPurchaseQuantityChoice = PostPurchaseCollectionChoice.extend({ quantity:
|
|
|
4340
4397
|
var PostPurchaseQuantityPolicy = PostPurchaseSettings.shape.quantityInputs.omit({ defaultQuantity: true }).extend({
|
|
4341
4398
|
initialQuantity: quantity,
|
|
4342
4399
|
maxValue: quantity,
|
|
4343
|
-
minValue:
|
|
4400
|
+
minValue: import_zod65.z.literal(0).transform(() => 1).or(quantity)
|
|
4344
4401
|
}).refine(({ maxValue, minValue }) => minValue <= maxValue, "Quantity bounds are reversed");
|
|
4345
4402
|
|
|
4346
4403
|
// src/schema/postPurchaseGroup.ts
|
|
@@ -4348,39 +4405,143 @@ var PostPurchaseGroupChoice = PostPurchaseQuantityChoice.extend({
|
|
|
4348
4405
|
memberProductId: PreparedPostPurchaseProduct.shape.selection.shape.productId
|
|
4349
4406
|
});
|
|
4350
4407
|
|
|
4408
|
+
// src/schema/postPurchaseHealth.ts
|
|
4409
|
+
var import_zod68 = require("zod");
|
|
4410
|
+
|
|
4411
|
+
// src/schema/postPurchaseHealthSchedule.ts
|
|
4412
|
+
var import_zod67 = require("zod");
|
|
4413
|
+
|
|
4414
|
+
// src/schema/postPurchaseReleaseSchedule.ts
|
|
4415
|
+
var import_zod66 = require("zod");
|
|
4416
|
+
var postPurchaseTaskNameSchema = (queue, id) => import_zod66.z.string().regex(new RegExp(`^projects/[a-zA-Z0-9.:-]+/locations/us-central1/queues/${queue}/tasks/${id}$`));
|
|
4417
|
+
var SessionReleaseScheduleRequestSchema = import_zod66.z.strictObject({
|
|
4418
|
+
deadline: PostPurchaseTimestampSchema,
|
|
4419
|
+
orderId: PostPurchaseOrderIdSchema,
|
|
4420
|
+
releaseOwner: ReleaseOwnerSchema,
|
|
4421
|
+
sessionId: PostPurchaseSessionIdSchema
|
|
4422
|
+
});
|
|
4423
|
+
var SessionReleaseScheduleResponseSchema = import_zod66.z.object({
|
|
4424
|
+
data: import_zod66.z.discriminatedUnion("status", [
|
|
4425
|
+
SessionReleaseScheduleRequestSchema.extend({
|
|
4426
|
+
releaseOwner: import_zod66.z.literal("rebuy"),
|
|
4427
|
+
status: import_zod66.z.literal("queued"),
|
|
4428
|
+
taskName: postPurchaseTaskNameSchema("post-purchase-order-hold-release", "[a-f0-9]{64}-release")
|
|
4429
|
+
}),
|
|
4430
|
+
SessionReleaseScheduleRequestSchema.extend({
|
|
4431
|
+
releaseOwner: import_zod66.z.literal("shopify"),
|
|
4432
|
+
status: import_zod66.z.literal("native")
|
|
4433
|
+
})
|
|
4434
|
+
]),
|
|
4435
|
+
successful: import_zod66.z.literal(true)
|
|
4436
|
+
});
|
|
4437
|
+
|
|
4438
|
+
// src/schema/postPurchaseHealthSchedule.ts
|
|
4439
|
+
var postPurchaseHealthTaskId = ({ orderId, shop }) => `${shop.replace(/\.myshopify\.com$/, "")}--${orderId.replace("gid://shopify/Order/", "")}`;
|
|
4440
|
+
var PostPurchaseHealthTaskNameSchema = postPurchaseTaskNameSchema(
|
|
4441
|
+
"post-purchase-health-check",
|
|
4442
|
+
"[a-z0-9][a-z0-9-]*--[1-9][0-9]*"
|
|
4443
|
+
);
|
|
4444
|
+
var HealthScheduleAcknowledgementSchema = import_zod67.z.strictObject({
|
|
4445
|
+
data: HealthScheduleSchema.extend({
|
|
4446
|
+
status: import_zod67.z.literal("queued"),
|
|
4447
|
+
taskName: PostPurchaseHealthTaskNameSchema
|
|
4448
|
+
}).refine(
|
|
4449
|
+
(data) => data.taskName.endsWith(`/tasks/${postPurchaseHealthTaskId(data)}`),
|
|
4450
|
+
"taskName must be this order's health task"
|
|
4451
|
+
),
|
|
4452
|
+
successful: import_zod67.z.literal(true)
|
|
4453
|
+
});
|
|
4454
|
+
|
|
4455
|
+
// src/schema/postPurchaseHealth.ts
|
|
4456
|
+
var HealthFactSchema = HealthScheduleSchema.pick({
|
|
4457
|
+
healthScheduledAt: true,
|
|
4458
|
+
operationId: true,
|
|
4459
|
+
removePartialOrder: true
|
|
4460
|
+
});
|
|
4461
|
+
var HealthScheduleReceiptSchema = import_zod68.z.strictObject({
|
|
4462
|
+
recordedAt: PostPurchaseTimestampSchema,
|
|
4463
|
+
taskName: PostPurchaseHealthTaskNameSchema
|
|
4464
|
+
});
|
|
4465
|
+
var StoredHealthFactSchema = HealthFactSchema.extend({ scheduleReceipt: HealthScheduleReceiptSchema.optional() });
|
|
4466
|
+
var HealthAttemptSchema = StoredHealthFactSchema.extend({
|
|
4467
|
+
attemptedAt: PostPurchaseTimestampSchema,
|
|
4468
|
+
attemptId: import_zod68.z.uuid(),
|
|
4469
|
+
status: import_zod68.z.literal("attempted")
|
|
4470
|
+
});
|
|
4471
|
+
var HealthResultSchema = HealthAttemptSchema.extend({
|
|
4472
|
+
finishedAt: PostPurchaseTimestampSchema,
|
|
4473
|
+
status: import_zod68.z.enum(["returned", "unknown"])
|
|
4474
|
+
});
|
|
4475
|
+
var HealthStateSchema = import_zod68.z.union([
|
|
4476
|
+
StoredHealthFactSchema.extend({ status: import_zod68.z.literal("pending") }),
|
|
4477
|
+
HealthAttemptSchema,
|
|
4478
|
+
HealthResultSchema
|
|
4479
|
+
]);
|
|
4480
|
+
var HealthPrepareRequestSchema = DecideRequestSchema.extend({
|
|
4481
|
+
operationId: HealthScheduleSchema.shape.operationId
|
|
4482
|
+
}).strict();
|
|
4483
|
+
var HealthPrepareResponseSchema = import_zod68.z.object({ data: HealthScheduleSchema, successful: import_zod68.z.literal(true) });
|
|
4484
|
+
var HealthClaimRequestSchema = import_zod68.z.strictObject({
|
|
4485
|
+
orderId: PostPurchaseOrderIdSchema,
|
|
4486
|
+
removePartialOrder: import_zod68.z.boolean(),
|
|
4487
|
+
shop: ShopifyDomainSchema
|
|
4488
|
+
});
|
|
4489
|
+
var HealthClaimFactSchema = HealthClaimRequestSchema.extend({
|
|
4490
|
+
healthScheduledAt: HealthFactSchema.shape.healthScheduledAt
|
|
4491
|
+
});
|
|
4492
|
+
var HealthClaimResponseSchema = import_zod68.z.object({
|
|
4493
|
+
data: import_zod68.z.union([
|
|
4494
|
+
import_zod68.z.strictObject({ status: import_zod68.z.literal("missing") }),
|
|
4495
|
+
HealthClaimFactSchema.extend({ status: import_zod68.z.enum(["pending", "attempted", "returned", "unknown"]) }),
|
|
4496
|
+
HealthClaimFactSchema.extend({ attemptId: HealthAttemptSchema.shape.attemptId, status: import_zod68.z.literal("claimed") })
|
|
4497
|
+
]),
|
|
4498
|
+
successful: import_zod68.z.literal(true)
|
|
4499
|
+
});
|
|
4500
|
+
var HealthResultRequestSchema = HealthClaimRequestSchema.extend({
|
|
4501
|
+
attemptId: HealthAttemptSchema.shape.attemptId,
|
|
4502
|
+
outcome: HealthResultSchema.shape.status
|
|
4503
|
+
});
|
|
4504
|
+
var HealthResultResponseSchema = import_zod68.z.object({
|
|
4505
|
+
data: HealthClaimFactSchema.extend({
|
|
4506
|
+
finishedAt: HealthResultSchema.shape.finishedAt,
|
|
4507
|
+
status: HealthResultSchema.shape.status
|
|
4508
|
+
}),
|
|
4509
|
+
successful: import_zod68.z.literal(true)
|
|
4510
|
+
});
|
|
4511
|
+
|
|
4351
4512
|
// src/schema/postPurchaseLifecycle.ts
|
|
4352
|
-
var
|
|
4353
|
-
var Presentation =
|
|
4513
|
+
var import_zod69 = require("zod");
|
|
4514
|
+
var Presentation = import_zod69.z.strictObject({
|
|
4354
4515
|
member: PostPurchaseMemberIdentity,
|
|
4355
4516
|
selectedProductId: PostPurchaseMemberIdentity.shape.productId.optional(),
|
|
4356
4517
|
variant: PostPurchaseVariantSelector
|
|
4357
4518
|
});
|
|
4358
4519
|
var LifecycleObservationRequestSchema = DecideRequestSchema.extend({
|
|
4359
4520
|
entryRevision: PostPurchaseProgressSchema.shape.entryRevision,
|
|
4360
|
-
eventType:
|
|
4521
|
+
eventType: import_zod69.z.enum(["OFFER_VIEWED", "OFFER_TIMER_EXPIRED"]),
|
|
4361
4522
|
presentation: Presentation.nullable(),
|
|
4362
4523
|
progressRevision: PostPurchaseProgressSchema.shape.revision,
|
|
4363
|
-
requestId:
|
|
4524
|
+
requestId: import_zod69.z.uuid()
|
|
4364
4525
|
}).strict().refine(
|
|
4365
4526
|
({ eventType, presentation }) => eventType !== "OFFER_VIEWED" || presentation !== null,
|
|
4366
4527
|
"Viewed observations require a presented product"
|
|
4367
4528
|
);
|
|
4368
|
-
var LifecycleObservationResponseSchema =
|
|
4369
|
-
data:
|
|
4529
|
+
var LifecycleObservationResponseSchema = import_zod69.z.object({
|
|
4530
|
+
data: import_zod69.z.strictObject({
|
|
4370
4531
|
requestId: LifecycleObservationRequestSchema.shape.requestId,
|
|
4371
|
-
status:
|
|
4532
|
+
status: import_zod69.z.union([AcceptedEventOutcomeSchema, import_zod69.z.literal("unavailable")])
|
|
4372
4533
|
}),
|
|
4373
|
-
successful:
|
|
4534
|
+
successful: import_zod69.z.literal(true)
|
|
4374
4535
|
});
|
|
4375
4536
|
|
|
4376
4537
|
// src/schema/postPurchaseOffer.ts
|
|
4377
|
-
var
|
|
4538
|
+
var import_zod71 = require("zod");
|
|
4378
4539
|
|
|
4379
4540
|
// src/schema/postPurchaseSkipTrace.ts
|
|
4380
|
-
var
|
|
4541
|
+
var import_zod70 = require("zod");
|
|
4381
4542
|
var POST_PURCHASE_SKIP_LIMIT = 32;
|
|
4382
|
-
var PostPurchaseSkipTraceSchema =
|
|
4383
|
-
|
|
4543
|
+
var PostPurchaseSkipTraceSchema = import_zod70.z.array(
|
|
4544
|
+
import_zod70.z.object({
|
|
4384
4545
|
entry: DecisionEntrySchema,
|
|
4385
4546
|
reason: PostPurchaseSkipReasonSchema
|
|
4386
4547
|
})
|
|
@@ -4388,66 +4549,66 @@ var PostPurchaseSkipTraceSchema = import_zod66.z.array(
|
|
|
4388
4549
|
|
|
4389
4550
|
// src/schema/postPurchaseOffer.ts
|
|
4390
4551
|
var OfferPreparationRequestSchema = DecideRequestSchema.strict();
|
|
4391
|
-
var OfferPreparationResponseSchema =
|
|
4392
|
-
data:
|
|
4393
|
-
successful:
|
|
4552
|
+
var OfferPreparationResponseSchema = import_zod71.z.object({
|
|
4553
|
+
data: import_zod71.z.object({ attemptedSkips: PostPurchaseSkipTraceSchema.optional(), progress: PostPurchaseProgressSchema }),
|
|
4554
|
+
successful: import_zod71.z.literal(true)
|
|
4394
4555
|
});
|
|
4395
4556
|
|
|
4396
4557
|
// src/schema/postPurchaseOfferEligibility.ts
|
|
4397
|
-
var
|
|
4558
|
+
var import_zod72 = require("zod");
|
|
4398
4559
|
var selection = PreparedPostPurchaseProduct.shape.selection;
|
|
4399
|
-
var PostPurchaseOfferSkipReason =
|
|
4400
|
-
var PostPurchaseOfferEligibilityContext =
|
|
4560
|
+
var PostPurchaseOfferSkipReason = import_zod72.z.enum(["empty", "no-eligible-subscription"]);
|
|
4561
|
+
var PostPurchaseOfferEligibilityContext = import_zod72.z.object({
|
|
4401
4562
|
excludedProductIds: PostPurchaseExcludedProductIds,
|
|
4402
|
-
originalLineItems:
|
|
4563
|
+
originalLineItems: import_zod72.z.array(selection.pick({ productId: true, sellingPlanId: true, variantId: true }))
|
|
4403
4564
|
});
|
|
4404
|
-
var PostPurchaseOfferEligibility =
|
|
4405
|
-
|
|
4406
|
-
members:
|
|
4407
|
-
|
|
4565
|
+
var PostPurchaseOfferEligibility = import_zod72.z.discriminatedUnion("status", [
|
|
4566
|
+
import_zod72.z.object({
|
|
4567
|
+
members: import_zod72.z.array(
|
|
4568
|
+
import_zod72.z.object({ productId: selection.shape.productId, productIndex: import_zod72.z.number().int().nonnegative() })
|
|
4408
4569
|
),
|
|
4409
|
-
status:
|
|
4570
|
+
status: import_zod72.z.literal("retain")
|
|
4410
4571
|
}),
|
|
4411
|
-
|
|
4412
|
-
|
|
4572
|
+
import_zod72.z.object({ reason: PostPurchaseOfferSkipReason, status: import_zod72.z.literal("skip") }),
|
|
4573
|
+
import_zod72.z.object({ reason: import_zod72.z.literal("eligible-upgrade").optional(), status: import_zod72.z.literal("unavailable") })
|
|
4413
4574
|
]);
|
|
4414
4575
|
|
|
4415
4576
|
// src/schema/postPurchaseOfferPresentation.ts
|
|
4416
|
-
var
|
|
4577
|
+
var import_zod73 = require("zod");
|
|
4417
4578
|
var language2 = PostPurchaseSettings.shape.language.shape.global.unwrap().unwrap();
|
|
4418
|
-
var PostPurchaseOfferPresentation =
|
|
4579
|
+
var PostPurchaseOfferPresentation = import_zod73.z.strictObject({
|
|
4419
4580
|
labels: language2.pick({ declineAll: true, declineThisOffer: true }),
|
|
4420
4581
|
layout: PostPurchaseSettings.shape.offersLayout,
|
|
4421
4582
|
sections: CABRootSection.nullable(),
|
|
4422
4583
|
showDeclineAll: PostPurchaseSettings.shape.productOptions.shape.showDeclineAll
|
|
4423
4584
|
});
|
|
4424
4585
|
var OfferPresentationRequestSchema = DecideRequestSchema.strict();
|
|
4425
|
-
var OfferPresentationResponseSchema =
|
|
4426
|
-
data:
|
|
4586
|
+
var OfferPresentationResponseSchema = import_zod73.z.object({
|
|
4587
|
+
data: import_zod73.z.strictObject({
|
|
4427
4588
|
presentation: PostPurchaseOfferPresentation.nullable(),
|
|
4428
4589
|
progress: PostPurchaseProgressSchema.nullable(),
|
|
4429
4590
|
serverNow: PostPurchaseTimestampSchema
|
|
4430
4591
|
}),
|
|
4431
|
-
successful:
|
|
4592
|
+
successful: import_zod73.z.literal(true)
|
|
4432
4593
|
});
|
|
4433
4594
|
|
|
4434
4595
|
// src/schema/postPurchaseOrderDecision.ts
|
|
4435
|
-
var
|
|
4436
|
-
var OrderDecisionSchema =
|
|
4437
|
-
|
|
4438
|
-
|
|
4596
|
+
var import_zod74 = require("zod");
|
|
4597
|
+
var OrderDecisionSchema = import_zod74.z.discriminatedUnion("owner", [
|
|
4598
|
+
import_zod74.z.object({ owner: import_zod74.z.literal("session"), sessionId: PostPurchaseSessionIdSchema }),
|
|
4599
|
+
import_zod74.z.object({ owner: import_zod74.z.literal("release"), sessionId: import_zod74.z.null() })
|
|
4439
4600
|
]);
|
|
4440
4601
|
|
|
4441
4602
|
// src/schema/postPurchasePolicy.ts
|
|
4442
|
-
var
|
|
4443
|
-
var HoldSettingSchema =
|
|
4444
|
-
|
|
4445
|
-
|
|
4603
|
+
var import_zod75 = require("zod");
|
|
4604
|
+
var HoldSettingSchema = import_zod75.z.discriminatedUnion("enabled", [
|
|
4605
|
+
import_zod75.z.object({ durationMinutes: import_zod75.z.number().int().min(1).max(60), enabled: import_zod75.z.literal(true) }),
|
|
4606
|
+
import_zod75.z.object({ durationMinutes: import_zod75.z.null(), enabled: import_zod75.z.literal(false) })
|
|
4446
4607
|
]);
|
|
4447
|
-
var TimingSettingsSchema =
|
|
4608
|
+
var TimingSettingsSchema = import_zod75.z.object({ flowHold: HoldSettingSchema, shopHold: HoldSettingSchema });
|
|
4448
4609
|
var SessionPolicySchema = TimingSettingsSchema.extend({
|
|
4449
|
-
durationMinutes:
|
|
4450
|
-
source:
|
|
4610
|
+
durationMinutes: import_zod75.z.number().int().min(1).max(60).nullable(),
|
|
4611
|
+
source: import_zod75.z.enum(["shop", "flow", "native"])
|
|
4451
4612
|
}).refine(
|
|
4452
4613
|
(policy) => {
|
|
4453
4614
|
const expectedSource = policy.shopHold.enabled ? "shop" : policy.flowHold.enabled ? "flow" : "native";
|
|
@@ -4461,8 +4622,8 @@ var SessionPolicySchema = TimingSettingsSchema.extend({
|
|
|
4461
4622
|
);
|
|
4462
4623
|
|
|
4463
4624
|
// src/schema/postPurchasePreparationOptions.ts
|
|
4464
|
-
var
|
|
4465
|
-
var PostPurchasePreparationOptions =
|
|
4625
|
+
var import_zod76 = require("zod");
|
|
4626
|
+
var PostPurchasePreparationOptions = import_zod76.z.object({
|
|
4466
4627
|
choice: PostPurchaseChoice.optional(),
|
|
4467
4628
|
member: PostPurchaseMemberSelector.strict().optional(),
|
|
4468
4629
|
quantity: PreparedPostPurchaseProduct.shape.selection.shape.quantity.optional(),
|
|
@@ -4474,8 +4635,8 @@ var PostPurchasePreparationOptions = import_zod72.z.object({
|
|
|
4474
4635
|
);
|
|
4475
4636
|
|
|
4476
4637
|
// src/schema/postPurchaseProductSettings.ts
|
|
4477
|
-
var
|
|
4478
|
-
var amount =
|
|
4638
|
+
var import_zod77 = require("zod");
|
|
4639
|
+
var amount = import_zod77.z.union([import_zod77.z.number().nonnegative(), PostPurchaseAmount.transform(Number)]);
|
|
4479
4640
|
var PostPurchaseProductSettings = PostPurchaseSettings.pick({
|
|
4480
4641
|
discountedFrom: true,
|
|
4481
4642
|
language: true,
|
|
@@ -4487,50 +4648,62 @@ var PostPurchaseProductSettings = PostPurchaseSettings.pick({
|
|
|
4487
4648
|
subscriptionIsDefault: true,
|
|
4488
4649
|
upgradeToSubscription: true
|
|
4489
4650
|
}).extend({
|
|
4490
|
-
advance:
|
|
4491
|
-
blocks:
|
|
4651
|
+
advance: import_zod77.z.unknown().default({}),
|
|
4652
|
+
blocks: import_zod77.z.array(import_zod77.z.unknown()).optional(),
|
|
4492
4653
|
discount: PostPurchaseSettings.shape.discount.extend({ amount: amount.default(30) }),
|
|
4493
|
-
integrations:
|
|
4654
|
+
integrations: import_zod77.z.unknown().default({}),
|
|
4494
4655
|
shipping: PostPurchaseSettings.shape.shipping.extend({ amount: amount.default(10) }),
|
|
4495
|
-
styles:
|
|
4656
|
+
styles: import_zod77.z.unknown().default({}),
|
|
4496
4657
|
subImages: PostPurchaseSettings.shape.subImages.catch(null),
|
|
4497
|
-
subscription:
|
|
4658
|
+
subscription: import_zod77.z.unknown().default(PostPurchaseSettings.shape.subscription.parse(void 0))
|
|
4498
4659
|
});
|
|
4499
4660
|
|
|
4500
4661
|
// src/schema/postPurchaseRecovery.ts
|
|
4501
|
-
var
|
|
4662
|
+
var import_zod78 = require("zod");
|
|
4502
4663
|
var PurchaseRecoveryRequestSchema = DecideRequestSchema.strict();
|
|
4503
|
-
var PurchaseRecoveryResponseSchema =
|
|
4504
|
-
data:
|
|
4505
|
-
operation:
|
|
4664
|
+
var PurchaseRecoveryResponseSchema = import_zod78.z.object({
|
|
4665
|
+
data: import_zod78.z.object({
|
|
4666
|
+
operation: import_zod78.z.object({
|
|
4506
4667
|
observation: RecordedPurchaseObservationSchema.nullable(),
|
|
4507
4668
|
operationId: PurchaseReceiptSchema.shape.operationId
|
|
4508
4669
|
}).strict().nullable(),
|
|
4509
4670
|
progress: PostPurchaseProgressSchema.nullable().optional()
|
|
4510
4671
|
}),
|
|
4511
|
-
successful:
|
|
4672
|
+
successful: import_zod78.z.literal(true)
|
|
4673
|
+
});
|
|
4674
|
+
|
|
4675
|
+
// src/schema/postPurchaseReleaseClaim.ts
|
|
4676
|
+
var import_zod79 = require("zod");
|
|
4677
|
+
var ReleaseClaimRequestSchema = ReleaseAuthorityRequestSchema;
|
|
4678
|
+
var ReleaseClaimResponseSchema = import_zod79.z.object({
|
|
4679
|
+
data: import_zod79.z.discriminatedUnion("status", [
|
|
4680
|
+
import_zod79.z.object({ status: import_zod79.z.literal("release-permitted") }),
|
|
4681
|
+
PendingReleaseAuthoritySchema,
|
|
4682
|
+
ReadyReleaseAuthoritySchema
|
|
4683
|
+
]),
|
|
4684
|
+
successful: import_zod79.z.literal(true)
|
|
4512
4685
|
});
|
|
4513
4686
|
|
|
4514
4687
|
// src/schema/postPurchaseSelection.ts
|
|
4515
|
-
var
|
|
4688
|
+
var import_zod80 = require("zod");
|
|
4516
4689
|
var SelectionClaimsSchema = DecideRequestSchema.extend({
|
|
4517
4690
|
appId: PostPurchaseAppIdSchema,
|
|
4518
4691
|
entry: DecisionEntrySchema,
|
|
4519
|
-
iss:
|
|
4520
|
-
purpose:
|
|
4692
|
+
iss: import_zod80.z.literal("rebuy-api"),
|
|
4693
|
+
purpose: import_zod80.z.literal("post-purchase-selection")
|
|
4521
4694
|
});
|
|
4522
4695
|
var SessionStartRequestSchema = DecideRequestSchema.extend({
|
|
4523
|
-
selectionToken:
|
|
4696
|
+
selectionToken: import_zod80.z.string().min(1).max(8192).optional()
|
|
4524
4697
|
}).strict();
|
|
4525
4698
|
|
|
4526
4699
|
// src/schema/postPurchaseSession.ts
|
|
4527
|
-
var
|
|
4700
|
+
var import_zod81 = require("zod");
|
|
4528
4701
|
var SessionIdentitySchema = DecideRequestSchema.extend({ appId: PostPurchaseAppIdSchema });
|
|
4529
|
-
var SessionOrderTimingSchema =
|
|
4702
|
+
var SessionOrderTimingSchema = import_zod81.z.object({
|
|
4530
4703
|
nativeDeadline: PostPurchaseTimestampSchema,
|
|
4531
4704
|
orderCreatedAt: PostPurchaseTimestampSchema,
|
|
4532
4705
|
orderId: PostPurchaseOrderIdSchema,
|
|
4533
|
-
timingSource:
|
|
4706
|
+
timingSource: import_zod81.z.literal("shopify-order-created-at")
|
|
4534
4707
|
});
|
|
4535
4708
|
var ReadySessionTimingSchema = SessionOrderTimingSchema.extend({
|
|
4536
4709
|
deadline: PostPurchaseTimestampSchema,
|
|
@@ -4547,33 +4720,33 @@ var ReadySessionTimingSchema = SessionOrderTimingSchema.extend({
|
|
|
4547
4720
|
message: "deadline must not exceed nativeDeadline",
|
|
4548
4721
|
path: ["deadline"]
|
|
4549
4722
|
});
|
|
4550
|
-
var SessionStartResponseSchema =
|
|
4551
|
-
data:
|
|
4552
|
-
phase:
|
|
4723
|
+
var SessionStartResponseSchema = import_zod81.z.object({
|
|
4724
|
+
data: import_zod81.z.object({
|
|
4725
|
+
phase: import_zod81.z.literal("render"),
|
|
4553
4726
|
serverNow: PostPurchaseTimestampSchema,
|
|
4554
4727
|
session: ReadySessionTimingSchema,
|
|
4555
|
-
workflowPhase:
|
|
4728
|
+
workflowPhase: import_zod81.z.literal("start")
|
|
4556
4729
|
}),
|
|
4557
|
-
successful:
|
|
4730
|
+
successful: import_zod81.z.literal(true)
|
|
4558
4731
|
});
|
|
4559
4732
|
|
|
4560
4733
|
// src/schema/postPurchaseShadow.ts
|
|
4561
|
-
var
|
|
4562
|
-
var PostPurchaseShadowSelectionSchema =
|
|
4563
|
-
|
|
4564
|
-
|
|
4734
|
+
var import_zod82 = require("zod");
|
|
4735
|
+
var PostPurchaseShadowSelectionSchema = import_zod82.z.discriminatedUnion("verdict", [
|
|
4736
|
+
import_zod82.z.object({ entry: DecisionEntrySchema, verdict: import_zod82.z.literal("render") }),
|
|
4737
|
+
import_zod82.z.object({ verdict: import_zod82.z.literal("skip") })
|
|
4565
4738
|
]);
|
|
4566
|
-
var PostPurchaseShadowReportFields =
|
|
4567
|
-
differences:
|
|
4739
|
+
var PostPurchaseShadowReportFields = import_zod82.z.object({
|
|
4740
|
+
differences: import_zod82.z.array(import_zod82.z.enum(["verdict", "entry", "targeting", "incomplete-capture", "unsupported-configuration"])).refine((differences) => new Set(differences).size === differences.length, {
|
|
4568
4741
|
message: "differences must not contain duplicate entries"
|
|
4569
4742
|
}),
|
|
4570
4743
|
legacySelection: PostPurchaseShadowSelectionSchema,
|
|
4571
|
-
phase:
|
|
4572
|
-
sampleId:
|
|
4744
|
+
phase: import_zod82.z.literal("shouldRender"),
|
|
4745
|
+
sampleId: import_zod82.z.string(),
|
|
4573
4746
|
serverSelection: PostPurchaseShadowSelectionSchema.optional(),
|
|
4574
|
-
status:
|
|
4575
|
-
targetingFlowIds:
|
|
4576
|
-
workflowPhase:
|
|
4747
|
+
status: import_zod82.z.enum(["match", "diverged", "incomplete"]),
|
|
4748
|
+
targetingFlowIds: import_zod82.z.array(import_zod82.z.number().int().positive()),
|
|
4749
|
+
workflowPhase: import_zod82.z.literal("decide")
|
|
4577
4750
|
});
|
|
4578
4751
|
var PostPurchaseShadowReportSchema = PostPurchaseShadowReportFields.refine(
|
|
4579
4752
|
(report) => report.status !== "match" || report.differences.length === 0,
|
|
@@ -4587,20 +4760,20 @@ var PostPurchaseShadowReportSchema = PostPurchaseShadowReportFields.refine(
|
|
|
4587
4760
|
});
|
|
4588
4761
|
|
|
4589
4762
|
// src/schema/postPurchaseSubscriptionDisplay.ts
|
|
4590
|
-
var
|
|
4591
|
-
var Minor2 =
|
|
4592
|
-
var PostPurchaseSubscriptionDisplay =
|
|
4763
|
+
var import_zod83 = require("zod");
|
|
4764
|
+
var Minor2 = import_zod83.z.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER);
|
|
4765
|
+
var PostPurchaseSubscriptionDisplay = import_zod83.z.object({
|
|
4593
4766
|
comparisonMinor: Minor2,
|
|
4594
|
-
currencyCode:
|
|
4767
|
+
currencyCode: import_zod83.z.string().regex(/^[A-Z]{3}$/),
|
|
4595
4768
|
priceMinor: Minor2,
|
|
4596
4769
|
savingMinor: Minor2,
|
|
4597
|
-
savingPercent:
|
|
4770
|
+
savingPercent: import_zod83.z.number().int().min(0).max(100)
|
|
4598
4771
|
});
|
|
4599
4772
|
|
|
4600
4773
|
// src/schema/postPurchaseSubscriptionProduct.ts
|
|
4601
|
-
var
|
|
4774
|
+
var import_zod84 = require("zod");
|
|
4602
4775
|
var PreparedPostPurchaseSubscription = PreparedPostPurchaseProduct.extend({
|
|
4603
|
-
selection: PreparedPostPurchaseProduct.shape.selection.extend({ sellingPlanId:
|
|
4776
|
+
selection: PreparedPostPurchaseProduct.shape.selection.extend({ sellingPlanId: import_zod84.z.number().int().positive() }),
|
|
4604
4777
|
terms: PreparedPostPurchaseProduct.shape.terms.extend({
|
|
4605
4778
|
subscription: PostPurchaseSubscriptionTerms
|
|
4606
4779
|
}).refine(
|
|
@@ -4613,108 +4786,108 @@ var readPostPurchaseSubscription = (prepared) => {
|
|
|
4613
4786
|
};
|
|
4614
4787
|
|
|
4615
4788
|
// src/schema/postPurchaseTransition.ts
|
|
4616
|
-
var
|
|
4789
|
+
var import_zod85 = require("zod");
|
|
4617
4790
|
var OfferTransitionRequestSchema = DecideRequestSchema.extend({
|
|
4618
4791
|
entryRevision: PostPurchaseProgressSchema.shape.entryRevision,
|
|
4619
4792
|
progressRevision: PostPurchaseProgressSchema.shape.revision
|
|
4620
4793
|
}).strict();
|
|
4621
|
-
var OfferTransitionResponseSchema =
|
|
4622
|
-
data:
|
|
4794
|
+
var OfferTransitionResponseSchema = import_zod85.z.object({
|
|
4795
|
+
data: import_zod85.z.object({
|
|
4623
4796
|
attemptedSkips: PostPurchaseSkipTraceSchema.optional(),
|
|
4624
4797
|
progress: PostPurchaseProgressSchema,
|
|
4625
|
-
status:
|
|
4798
|
+
status: import_zod85.z.enum(["advanced", "no-child", "unavailable"])
|
|
4626
4799
|
}),
|
|
4627
|
-
successful:
|
|
4800
|
+
successful: import_zod85.z.literal(true)
|
|
4628
4801
|
});
|
|
4629
4802
|
|
|
4630
4803
|
// src/schema/postPurchaseVariantDefault.ts
|
|
4631
|
-
var
|
|
4804
|
+
var import_zod86 = require("zod");
|
|
4632
4805
|
var values = PostPurchaseVariantValues.partial().extend({
|
|
4633
4806
|
option1: PostPurchaseVariantValues.shape.option1.nullish()
|
|
4634
4807
|
});
|
|
4635
4808
|
var variant = values.extend({
|
|
4636
4809
|
id: PostPurchaseVariantId,
|
|
4637
|
-
inventoryManagement:
|
|
4638
|
-
inventoryPolicy:
|
|
4639
|
-
inventoryQuantity:
|
|
4810
|
+
inventoryManagement: import_zod86.z.string().nullable(),
|
|
4811
|
+
inventoryPolicy: import_zod86.z.string(),
|
|
4812
|
+
inventoryQuantity: import_zod86.z.number()
|
|
4640
4813
|
});
|
|
4641
|
-
var options =
|
|
4642
|
-
var PostPurchaseVariantDefaultProduct =
|
|
4814
|
+
var options = import_zod86.z.array(PostPurchaseVariantOption.pick({ name: true, values: true }));
|
|
4815
|
+
var PostPurchaseVariantDefaultProduct = import_zod86.z.object({
|
|
4643
4816
|
id: PostPurchaseProductId,
|
|
4644
4817
|
options,
|
|
4645
4818
|
selectedVariant: variant.optional(),
|
|
4646
|
-
variants:
|
|
4819
|
+
variants: import_zod86.z.array(variant)
|
|
4647
4820
|
});
|
|
4648
4821
|
var PostPurchaseVariantDefaultSettings = PostPurchaseSettings.shape.productOptions.pick({
|
|
4649
4822
|
hideOutOfStockVariants: true,
|
|
4650
4823
|
matchVariant: true
|
|
4651
4824
|
});
|
|
4652
|
-
var PostPurchaseOrderAttributes =
|
|
4653
|
-
var PostPurchaseOriginalVariants =
|
|
4654
|
-
|
|
4825
|
+
var PostPurchaseOrderAttributes = import_zod86.z.record(import_zod86.z.string(), import_zod86.z.array(import_zod86.z.string())).default({});
|
|
4826
|
+
var PostPurchaseOriginalVariants = import_zod86.z.array(
|
|
4827
|
+
import_zod86.z.object({ productId: PostPurchaseProductId, variantId: PostPurchaseVariantId })
|
|
4655
4828
|
);
|
|
4656
|
-
var PostPurchaseAttributeProducts =
|
|
4657
|
-
|
|
4829
|
+
var PostPurchaseAttributeProducts = import_zod86.z.array(
|
|
4830
|
+
import_zod86.z.object({ id: PostPurchaseProductId, options, variants: import_zod86.z.array(values.extend({ id: PostPurchaseVariantId })) })
|
|
4658
4831
|
);
|
|
4659
4832
|
|
|
4660
4833
|
// src/schema/postPurchaseVariantDefaultContext.ts
|
|
4661
|
-
var
|
|
4662
|
-
var PostPurchaseVariantDefaultContext =
|
|
4663
|
-
enrichedLineItems:
|
|
4834
|
+
var import_zod87 = require("zod");
|
|
4835
|
+
var PostPurchaseVariantDefaultContext = import_zod87.z.object({
|
|
4836
|
+
enrichedLineItems: import_zod87.z.unknown().optional(),
|
|
4664
4837
|
originalVariants: PostPurchaseOriginalVariants
|
|
4665
4838
|
});
|
|
4666
4839
|
|
|
4667
4840
|
// src/schema/shopConfig.ts
|
|
4668
|
-
var
|
|
4669
|
-
var ShopConfig =
|
|
4670
|
-
activeExperiments:
|
|
4671
|
-
|
|
4672
|
-
data:
|
|
4673
|
-
|
|
4674
|
-
aliasName:
|
|
4675
|
-
cssInput:
|
|
4676
|
-
elementId:
|
|
4677
|
-
id:
|
|
4678
|
-
javascriptInput:
|
|
4679
|
-
traffic:
|
|
4841
|
+
var import_zod88 = require("zod");
|
|
4842
|
+
var ShopConfig = import_zod88.z.object({
|
|
4843
|
+
activeExperiments: import_zod88.z.array(
|
|
4844
|
+
import_zod88.z.object({
|
|
4845
|
+
data: import_zod88.z.array(
|
|
4846
|
+
import_zod88.z.object({
|
|
4847
|
+
aliasName: import_zod88.z.string(),
|
|
4848
|
+
cssInput: import_zod88.z.string().nullish(),
|
|
4849
|
+
elementId: import_zod88.z.coerce.number(),
|
|
4850
|
+
id: import_zod88.z.coerce.number(),
|
|
4851
|
+
javascriptInput: import_zod88.z.string().nullish(),
|
|
4852
|
+
traffic: import_zod88.z.coerce.number()
|
|
4680
4853
|
})
|
|
4681
4854
|
),
|
|
4682
|
-
id:
|
|
4683
|
-
name:
|
|
4684
|
-
pageTarget:
|
|
4685
|
-
pageTargetUrl:
|
|
4686
|
-
placeholderId:
|
|
4687
|
-
type:
|
|
4855
|
+
id: import_zod88.z.coerce.number(),
|
|
4856
|
+
name: import_zod88.z.string(),
|
|
4857
|
+
pageTarget: import_zod88.z.string().nullable(),
|
|
4858
|
+
pageTargetUrl: import_zod88.z.string().nullable(),
|
|
4859
|
+
placeholderId: import_zod88.z.coerce.number().nullable(),
|
|
4860
|
+
type: import_zod88.z.string()
|
|
4688
4861
|
})
|
|
4689
4862
|
),
|
|
4690
|
-
activePackages:
|
|
4691
|
-
|
|
4692
|
-
cancelledAt:
|
|
4693
|
-
id:
|
|
4694
|
-
installedAt:
|
|
4695
|
-
isActive:
|
|
4696
|
-
isBillable:
|
|
4697
|
-
packageId:
|
|
4698
|
-
packageName:
|
|
4699
|
-
shortName:
|
|
4700
|
-
trialDays:
|
|
4701
|
-
uninstalledAt:
|
|
4863
|
+
activePackages: import_zod88.z.array(
|
|
4864
|
+
import_zod88.z.object({
|
|
4865
|
+
cancelledAt: import_zod88.z.string().nullable(),
|
|
4866
|
+
id: import_zod88.z.number(),
|
|
4867
|
+
installedAt: import_zod88.z.string().nullable(),
|
|
4868
|
+
isActive: import_zod88.z.boolean(),
|
|
4869
|
+
isBillable: import_zod88.z.boolean(),
|
|
4870
|
+
packageId: import_zod88.z.number(),
|
|
4871
|
+
packageName: import_zod88.z.string(),
|
|
4872
|
+
shortName: import_zod88.z.string(),
|
|
4873
|
+
trialDays: import_zod88.z.number(),
|
|
4874
|
+
uninstalledAt: import_zod88.z.string().nullable()
|
|
4702
4875
|
})
|
|
4703
4876
|
),
|
|
4704
|
-
apiKey:
|
|
4705
|
-
billingVersion:
|
|
4706
|
-
cacheKey:
|
|
4707
|
-
carousel:
|
|
4708
|
-
currency:
|
|
4709
|
-
currencySymbol:
|
|
4710
|
-
domain:
|
|
4711
|
-
enabledJquery:
|
|
4712
|
-
enabledPresentmentCurrencies:
|
|
4713
|
-
hasSmartCollectionsEnabled:
|
|
4714
|
-
hasSmartSearchEnabled:
|
|
4715
|
-
id:
|
|
4716
|
-
integrations:
|
|
4717
|
-
|
|
4877
|
+
apiKey: import_zod88.z.string(),
|
|
4878
|
+
billingVersion: import_zod88.z.string().nullable(),
|
|
4879
|
+
cacheKey: import_zod88.z.coerce.number(),
|
|
4880
|
+
carousel: import_zod88.z.enum(["flickity", "splide"]),
|
|
4881
|
+
currency: import_zod88.z.string(),
|
|
4882
|
+
currencySymbol: import_zod88.z.string(),
|
|
4883
|
+
domain: import_zod88.z.string(),
|
|
4884
|
+
enabledJquery: import_zod88.z.boolean(),
|
|
4885
|
+
enabledPresentmentCurrencies: import_zod88.z.array(import_zod88.z.string()),
|
|
4886
|
+
hasSmartCollectionsEnabled: import_zod88.z.boolean(),
|
|
4887
|
+
hasSmartSearchEnabled: import_zod88.z.boolean(),
|
|
4888
|
+
id: import_zod88.z.coerce.number(),
|
|
4889
|
+
integrations: import_zod88.z.record(
|
|
4890
|
+
import_zod88.z.enum([
|
|
4718
4891
|
"attentive",
|
|
4719
4892
|
"judgeme",
|
|
4720
4893
|
"junip",
|
|
@@ -4727,170 +4900,170 @@ var ShopConfig = import_zod83.z.object({
|
|
|
4727
4900
|
"stamped",
|
|
4728
4901
|
"yotpo"
|
|
4729
4902
|
]),
|
|
4730
|
-
|
|
4903
|
+
import_zod88.z.union([import_zod88.z.boolean(), import_zod88.z.unknown()])
|
|
4731
4904
|
),
|
|
4732
|
-
markets:
|
|
4733
|
-
enabled:
|
|
4905
|
+
markets: import_zod88.z.object({
|
|
4906
|
+
enabled: import_zod88.z.boolean()
|
|
4734
4907
|
}),
|
|
4735
|
-
monetize:
|
|
4736
|
-
publisherKey:
|
|
4908
|
+
monetize: import_zod88.z.object({
|
|
4909
|
+
publisherKey: import_zod88.z.string().nullable()
|
|
4737
4910
|
}).nullish(),
|
|
4738
|
-
moneyFormat:
|
|
4739
|
-
myshopifyDomain:
|
|
4740
|
-
primaryLocale:
|
|
4741
|
-
productGroupsEnabled:
|
|
4742
|
-
rechargeCustomDomain:
|
|
4743
|
-
sellingPlansEnabled:
|
|
4744
|
-
shopId:
|
|
4745
|
-
shopifySellingPlansEnabled:
|
|
4746
|
-
shopName:
|
|
4747
|
-
storefrontAccessToken:
|
|
4748
|
-
useRebuyIcons:
|
|
4911
|
+
moneyFormat: import_zod88.z.string(),
|
|
4912
|
+
myshopifyDomain: import_zod88.z.string(),
|
|
4913
|
+
primaryLocale: import_zod88.z.string(),
|
|
4914
|
+
productGroupsEnabled: import_zod88.z.enum(["no", "yes"]).transform((value) => value === "yes"),
|
|
4915
|
+
rechargeCustomDomain: import_zod88.z.string().nullable(),
|
|
4916
|
+
sellingPlansEnabled: import_zod88.z.boolean(),
|
|
4917
|
+
shopId: import_zod88.z.number(),
|
|
4918
|
+
shopifySellingPlansEnabled: import_zod88.z.boolean(),
|
|
4919
|
+
shopName: import_zod88.z.string(),
|
|
4920
|
+
storefrontAccessToken: import_zod88.z.string().nullable(),
|
|
4921
|
+
useRebuyIcons: import_zod88.z.boolean()
|
|
4749
4922
|
});
|
|
4750
4923
|
|
|
4751
4924
|
// src/schema/userConfig.ts
|
|
4752
|
-
var
|
|
4753
|
-
var UserConfig =
|
|
4925
|
+
var import_zod89 = require("zod");
|
|
4926
|
+
var UserConfig = import_zod89.z.object({
|
|
4754
4927
|
shop: ShopConfig,
|
|
4755
4928
|
/**
|
|
4756
4929
|
* `.catch(undefined)` is the safety bar: smart-cart shape drift can NEVER fail `fetchUserConfig`,
|
|
4757
4930
|
* which resolves the apiKey for every offers/monetize/analytics/gift request.
|
|
4758
4931
|
*/
|
|
4759
4932
|
smartCart: SmartCartConfig.nullish().catch(void 0),
|
|
4760
|
-
smartFlows:
|
|
4933
|
+
smartFlows: import_zod89.z.array(import_zod89.z.unknown())
|
|
4761
4934
|
});
|
|
4762
4935
|
|
|
4763
4936
|
// src/schema/widgetData.ts
|
|
4764
|
-
var
|
|
4937
|
+
var import_zod98 = require("zod");
|
|
4765
4938
|
|
|
4766
4939
|
// src/schema/widgets/abTestingPlaceholder.ts
|
|
4767
|
-
var
|
|
4768
|
-
var ABTestingPlaceholder =
|
|
4769
|
-
type:
|
|
4940
|
+
var import_zod90 = require("zod");
|
|
4941
|
+
var ABTestingPlaceholder = import_zod90.z.looseObject({
|
|
4942
|
+
type: import_zod90.z.literal("placeholder")
|
|
4770
4943
|
});
|
|
4771
4944
|
|
|
4772
4945
|
// src/schema/widgets/checkoutExtension.ts
|
|
4773
|
-
var
|
|
4774
|
-
var CheckoutExtension =
|
|
4775
|
-
type:
|
|
4946
|
+
var import_zod91 = require("zod");
|
|
4947
|
+
var CheckoutExtension = import_zod91.z.looseObject({
|
|
4948
|
+
type: import_zod91.z.literal(WidgetType.shopify_checkout_extension).default(WidgetType.shopify_checkout_extension)
|
|
4776
4949
|
});
|
|
4777
4950
|
|
|
4778
4951
|
// src/schema/widgets/contentBlock.ts
|
|
4779
|
-
var
|
|
4780
|
-
var ContentBlockV1 =
|
|
4781
|
-
blockSpacing:
|
|
4782
|
-
imageBlocks:
|
|
4783
|
-
|
|
4784
|
-
|
|
4785
|
-
altText:
|
|
4786
|
-
description:
|
|
4787
|
-
id:
|
|
4788
|
-
imagePlacement:
|
|
4789
|
-
imageSize:
|
|
4790
|
-
imageUrl:
|
|
4791
|
-
textAlignment:
|
|
4952
|
+
var import_zod92 = require("zod");
|
|
4953
|
+
var ContentBlockV1 = import_zod92.z.object({
|
|
4954
|
+
blockSpacing: import_zod92.z.enum(spacings).optional(),
|
|
4955
|
+
imageBlocks: import_zod92.z.union([
|
|
4956
|
+
import_zod92.z.array(
|
|
4957
|
+
import_zod92.z.object({
|
|
4958
|
+
altText: import_zod92.z.string().nullable(),
|
|
4959
|
+
description: import_zod92.z.string().nullable(),
|
|
4960
|
+
id: import_zod92.z.uuid(),
|
|
4961
|
+
imagePlacement: import_zod92.z.enum(["top", "right", "bottom", "left"]),
|
|
4962
|
+
imageSize: import_zod92.z.number(),
|
|
4963
|
+
imageUrl: import_zod92.z.url(),
|
|
4964
|
+
textAlignment: import_zod92.z.enum(["left", "center", "right"]),
|
|
4792
4965
|
/** Inline scale only: an image caption can never be a block-level heading. */
|
|
4793
|
-
textSize:
|
|
4966
|
+
textSize: import_zod92.z.enum(inlineTextSizeNames)
|
|
4794
4967
|
})
|
|
4795
4968
|
),
|
|
4796
|
-
|
|
4969
|
+
import_zod92.z.strictObject({}).transform(() => [])
|
|
4797
4970
|
]).optional(),
|
|
4798
|
-
imageLayout:
|
|
4799
|
-
language:
|
|
4800
|
-
description:
|
|
4801
|
-
superTitle:
|
|
4802
|
-
title:
|
|
4971
|
+
imageLayout: import_zod92.z.enum(["row", "column"]).optional(),
|
|
4972
|
+
language: import_zod92.z.object({
|
|
4973
|
+
description: import_zod92.z.string(),
|
|
4974
|
+
superTitle: import_zod92.z.string(),
|
|
4975
|
+
title: import_zod92.z.string()
|
|
4803
4976
|
}),
|
|
4804
|
-
previewMode:
|
|
4805
|
-
type:
|
|
4806
|
-
version:
|
|
4977
|
+
previewMode: import_zod92.z.boolean(),
|
|
4978
|
+
type: import_zod92.z.literal(WidgetType.ui_extension_content_block).default(WidgetType.ui_extension_content_block),
|
|
4979
|
+
version: import_zod92.z.literal(1)
|
|
4807
4980
|
});
|
|
4808
|
-
var ContentBlock =
|
|
4981
|
+
var ContentBlock = import_zod92.z.discriminatedUnion("version", [
|
|
4809
4982
|
ContentBlockV1,
|
|
4810
4983
|
CABRootSection.extend({
|
|
4811
|
-
type:
|
|
4984
|
+
type: import_zod92.z.literal(WidgetType.ui_extension_content_block).default(WidgetType.ui_extension_content_block)
|
|
4812
4985
|
})
|
|
4813
4986
|
]);
|
|
4814
4987
|
|
|
4815
4988
|
// src/schema/widgets/giftWithPurchase.ts
|
|
4816
|
-
var
|
|
4817
|
-
var GiftWithPurchase =
|
|
4818
|
-
type:
|
|
4989
|
+
var import_zod93 = require("zod");
|
|
4990
|
+
var GiftWithPurchase = import_zod93.z.looseObject({
|
|
4991
|
+
type: import_zod93.z.literal(WidgetType.gift_with_purchase).default(WidgetType.gift_with_purchase)
|
|
4819
4992
|
});
|
|
4820
4993
|
|
|
4821
4994
|
// src/schema/widgets/lineItemEditor.ts
|
|
4822
|
-
var
|
|
4823
|
-
var LineItemEditorSwitchLanguageV1 =
|
|
4824
|
-
downgradeToOneTimeLabel:
|
|
4995
|
+
var import_zod94 = require("zod");
|
|
4996
|
+
var LineItemEditorSwitchLanguageV1 = import_zod94.z.object({
|
|
4997
|
+
downgradeToOneTimeLabel: import_zod94.z.string().optional(),
|
|
4825
4998
|
/** Frequency-option template (`{{frequency}}`/`{{interval}}`) for the plan select. */
|
|
4826
|
-
subscriptionOptionLabel:
|
|
4827
|
-
upgradeToSubscriptionLabel:
|
|
4828
|
-
upgradeToSubscriptionWithoutDiscountLabel:
|
|
4999
|
+
subscriptionOptionLabel: import_zod94.z.string().optional(),
|
|
5000
|
+
upgradeToSubscriptionLabel: import_zod94.z.string().optional(),
|
|
5001
|
+
upgradeToSubscriptionWithoutDiscountLabel: import_zod94.z.string().optional()
|
|
4829
5002
|
});
|
|
4830
|
-
var LineItemEditorV1 =
|
|
5003
|
+
var LineItemEditorV1 = import_zod94.z.object({
|
|
4831
5004
|
/** Legacy `getStyles` button style; the converter carries a valid kind, defaulting to `plain`. */
|
|
4832
|
-
button:
|
|
4833
|
-
previewMode:
|
|
4834
|
-
switchToSubscription:
|
|
4835
|
-
disableDowngrade:
|
|
5005
|
+
button: import_zod94.z.object({ kind: import_zod94.z.enum(["plain", "primary", "secondary"]).optional() }).optional(),
|
|
5006
|
+
previewMode: import_zod94.z.boolean().optional(),
|
|
5007
|
+
switchToSubscription: import_zod94.z.object({
|
|
5008
|
+
disableDowngrade: import_zod94.z.boolean().optional(),
|
|
4836
5009
|
language: LineItemEditorSwitchLanguageV1.optional()
|
|
4837
5010
|
}).optional(),
|
|
4838
|
-
switchToSubscriptionEnabled:
|
|
4839
|
-
tracking:
|
|
4840
|
-
enableAttribution:
|
|
4841
|
-
enableSource:
|
|
4842
|
-
enableWidget:
|
|
5011
|
+
switchToSubscriptionEnabled: import_zod94.z.boolean().optional(),
|
|
5012
|
+
tracking: import_zod94.z.object({
|
|
5013
|
+
enableAttribution: import_zod94.z.boolean().optional(),
|
|
5014
|
+
enableSource: import_zod94.z.boolean().optional(),
|
|
5015
|
+
enableWidget: import_zod94.z.boolean().optional()
|
|
4843
5016
|
}).optional(),
|
|
4844
|
-
type:
|
|
4845
|
-
version:
|
|
5017
|
+
type: import_zod94.z.literal(WidgetType.ui_extension_line_item_editor).default(WidgetType.ui_extension_line_item_editor),
|
|
5018
|
+
version: import_zod94.z.literal(1)
|
|
4846
5019
|
});
|
|
4847
|
-
var LineItemEditor =
|
|
5020
|
+
var LineItemEditor = import_zod94.z.discriminatedUnion("version", [
|
|
4848
5021
|
LineItemEditorV1,
|
|
4849
5022
|
CABRootSection.extend({
|
|
4850
|
-
type:
|
|
5023
|
+
type: import_zod94.z.literal(WidgetType.ui_extension_line_item_editor).default(WidgetType.ui_extension_line_item_editor)
|
|
4851
5024
|
})
|
|
4852
5025
|
]);
|
|
4853
5026
|
|
|
4854
5027
|
// src/schema/widgets/progressBar.ts
|
|
4855
|
-
var
|
|
4856
|
-
var ProgressBar =
|
|
4857
|
-
type:
|
|
5028
|
+
var import_zod95 = require("zod");
|
|
5029
|
+
var ProgressBar = import_zod95.z.looseObject({
|
|
5030
|
+
type: import_zod95.z.literal(WidgetType.ui_extension_progress_bar).default(WidgetType.ui_extension_progress_bar)
|
|
4858
5031
|
});
|
|
4859
5032
|
|
|
4860
5033
|
// src/schema/widgets/rebuyButton.ts
|
|
4861
|
-
var
|
|
4862
|
-
var RebuyButtonV1 =
|
|
4863
|
-
type:
|
|
4864
|
-
version:
|
|
5034
|
+
var import_zod96 = require("zod");
|
|
5035
|
+
var RebuyButtonV1 = import_zod96.z.looseObject({
|
|
5036
|
+
type: import_zod96.z.literal(WidgetType.ui_extension_button).default(WidgetType.ui_extension_button),
|
|
5037
|
+
version: import_zod96.z.literal(1)
|
|
4865
5038
|
});
|
|
4866
|
-
var RebuyButton =
|
|
5039
|
+
var RebuyButton = import_zod96.z.discriminatedUnion("version", [
|
|
4867
5040
|
RebuyButtonV1,
|
|
4868
5041
|
CABRootSection.extend({
|
|
4869
|
-
type:
|
|
5042
|
+
type: import_zod96.z.literal(WidgetType.ui_extension_button).default(WidgetType.ui_extension_button)
|
|
4870
5043
|
})
|
|
4871
5044
|
]);
|
|
4872
5045
|
|
|
4873
5046
|
// src/schema/widgets/rebuyMonetize.ts
|
|
4874
|
-
var
|
|
4875
|
-
var RebuyMonetize =
|
|
4876
|
-
type:
|
|
5047
|
+
var import_zod97 = require("zod");
|
|
5048
|
+
var RebuyMonetize = import_zod97.z.looseObject({
|
|
5049
|
+
type: import_zod97.z.literal(WidgetType.ui_extension_ad).default(WidgetType.ui_extension_ad)
|
|
4877
5050
|
});
|
|
4878
|
-
var RebuyMonetizeV1 =
|
|
4879
|
-
name:
|
|
4880
|
-
previewMode:
|
|
5051
|
+
var RebuyMonetizeV1 = import_zod97.z.object({
|
|
5052
|
+
name: import_zod97.z.string().nullable().optional(),
|
|
5053
|
+
previewMode: import_zod97.z.boolean().optional(),
|
|
4881
5054
|
/** Privacy Policy footer href → the marker section's `privacyPolicyUrl`. */
|
|
4882
|
-
privacyPolicyUrl:
|
|
5055
|
+
privacyPolicyUrl: import_zod97.z.string().nullable().optional(),
|
|
4883
5056
|
/** Ads-taxonomy sub-vertical id — one of the admin Monetize editor's two configurables. */
|
|
4884
|
-
subVertical:
|
|
4885
|
-
tracking:
|
|
4886
|
-
enableAttribution:
|
|
4887
|
-
enableSource:
|
|
4888
|
-
enableWidget:
|
|
5057
|
+
subVertical: import_zod97.z.string().nullable().optional(),
|
|
5058
|
+
tracking: import_zod97.z.object({
|
|
5059
|
+
enableAttribution: import_zod97.z.boolean().optional(),
|
|
5060
|
+
enableSource: import_zod97.z.boolean().optional(),
|
|
5061
|
+
enableWidget: import_zod97.z.boolean().optional()
|
|
4889
5062
|
}).optional(),
|
|
4890
|
-
type:
|
|
4891
|
-
version:
|
|
5063
|
+
type: import_zod97.z.literal(WidgetType.ui_extension_ad).default(WidgetType.ui_extension_ad),
|
|
5064
|
+
version: import_zod97.z.literal(1),
|
|
4892
5065
|
/** Ads-taxonomy vertical id — one of the admin Monetize editor's two configurables. */
|
|
4893
|
-
vertical:
|
|
5066
|
+
vertical: import_zod97.z.string().nullable().optional()
|
|
4894
5067
|
});
|
|
4895
5068
|
|
|
4896
5069
|
// src/schema/widgetData.ts
|
|
@@ -4904,7 +5077,7 @@ var extensionWidgetTypes = [
|
|
|
4904
5077
|
WidgetType.ui_extension_line_item_editor,
|
|
4905
5078
|
WidgetType.ui_extension_progress_bar
|
|
4906
5079
|
];
|
|
4907
|
-
var WidgetData =
|
|
5080
|
+
var WidgetData = import_zod98.z.discriminatedUnion("type", [
|
|
4908
5081
|
ABTestingPlaceholder,
|
|
4909
5082
|
CheckoutExtension,
|
|
4910
5083
|
ContentBlock,
|
|
@@ -5264,36 +5437,36 @@ var SWITCH_LABELS = {
|
|
|
5264
5437
|
};
|
|
5265
5438
|
|
|
5266
5439
|
// src/schema/widgets/post-purchase-offer/postPurchaseOffer.ts
|
|
5267
|
-
var
|
|
5440
|
+
var import_zod100 = require("zod");
|
|
5268
5441
|
|
|
5269
5442
|
// src/schema/widgets/post-purchase-offer/postPurchaseWidget.ts
|
|
5270
|
-
var
|
|
5271
|
-
var PostPurchaseWidgetLinkedFlow =
|
|
5272
|
-
id:
|
|
5273
|
-
name:
|
|
5274
|
-
});
|
|
5275
|
-
var PostPurchaseWidget =
|
|
5276
|
-
classification:
|
|
5277
|
-
createdAtTime:
|
|
5278
|
-
customEndpointName:
|
|
5279
|
-
id:
|
|
5280
|
-
lastViewed:
|
|
5281
|
-
linkedCustomEndpointId:
|
|
5282
|
-
linkedFlows:
|
|
5283
|
-
name:
|
|
5284
|
-
owner:
|
|
5443
|
+
var import_zod99 = require("zod");
|
|
5444
|
+
var PostPurchaseWidgetLinkedFlow = import_zod99.z.object({
|
|
5445
|
+
id: import_zod99.z.number(),
|
|
5446
|
+
name: import_zod99.z.string()
|
|
5447
|
+
});
|
|
5448
|
+
var PostPurchaseWidget = import_zod99.z.object({
|
|
5449
|
+
classification: import_zod99.z.literal("post_purchase_offer_page").default("post_purchase_offer_page"),
|
|
5450
|
+
createdAtTime: import_zod99.z.iso.datetime({ offset: true }).optional(),
|
|
5451
|
+
customEndpointName: import_zod99.z.string().nullish(),
|
|
5452
|
+
id: import_zod99.z.number().default(0),
|
|
5453
|
+
lastViewed: import_zod99.z.iso.datetime({ offset: true }).nullish(),
|
|
5454
|
+
linkedCustomEndpointId: import_zod99.z.number().nullish(),
|
|
5455
|
+
linkedFlows: import_zod99.z.array(PostPurchaseWidgetLinkedFlow).optional(),
|
|
5456
|
+
name: import_zod99.z.string().default(""),
|
|
5457
|
+
owner: import_zod99.z.number().nullish(),
|
|
5285
5458
|
settings: PostPurchaseSettings
|
|
5286
5459
|
});
|
|
5287
5460
|
|
|
5288
5461
|
// src/schema/widgets/post-purchase-offer/postPurchaseOffer.ts
|
|
5289
|
-
var PostPurchaseOffer =
|
|
5290
|
-
|
|
5291
|
-
errors:
|
|
5292
|
-
message:
|
|
5293
|
-
successful:
|
|
5462
|
+
var PostPurchaseOffer = import_zod100.z.discriminatedUnion("successful", [
|
|
5463
|
+
import_zod100.z.strictObject({
|
|
5464
|
+
errors: import_zod100.z.array(import_zod100.z.object({ message: import_zod100.z.string() })),
|
|
5465
|
+
message: import_zod100.z.string(),
|
|
5466
|
+
successful: import_zod100.z.literal(false)
|
|
5294
5467
|
}),
|
|
5295
|
-
|
|
5296
|
-
successful:
|
|
5468
|
+
import_zod100.z.strictObject({
|
|
5469
|
+
successful: import_zod100.z.literal(true),
|
|
5297
5470
|
widget: PostPurchaseWidget
|
|
5298
5471
|
})
|
|
5299
5472
|
]);
|
|
@@ -6206,6 +6379,15 @@ var DISCOUNTED_FROM = {
|
|
|
6206
6379
|
original_price: "price",
|
|
6207
6380
|
price: "price"
|
|
6208
6381
|
};
|
|
6382
|
+
var variantLabelsOf = (language3) => {
|
|
6383
|
+
const labels = Object.fromEntries(
|
|
6384
|
+
["variantOption", "variantOptions"].flatMap((key) => {
|
|
6385
|
+
const value = language3?.[key];
|
|
6386
|
+
return typeof value === "string" && value.trim() ? [[key, value]] : [];
|
|
6387
|
+
})
|
|
6388
|
+
);
|
|
6389
|
+
return Object.keys(labels).length ? labels : void 0;
|
|
6390
|
+
};
|
|
6209
6391
|
var dataSourceDiscount = (discount) => {
|
|
6210
6392
|
if (!discount?.type || discount.type === "none") return void 0;
|
|
6211
6393
|
const discountedFrom = discount.discountedFrom ? DISCOUNTED_FROM[discount.discountedFrom] : void 0;
|
|
@@ -6287,6 +6469,7 @@ var convertOfferToV2 = ({ id, name, settings }) => {
|
|
|
6287
6469
|
const listLayout = { direction: "rows", offersDirection };
|
|
6288
6470
|
const horizontalCard = offersDirection === "vertical";
|
|
6289
6471
|
const discount = dataSourceDiscount(settings.discount);
|
|
6472
|
+
const variantLabels = variantLabelsOf(settings.language);
|
|
6290
6473
|
const dataSource = {
|
|
6291
6474
|
...settings.endpoint && { dataSourcePath: settings.endpoint },
|
|
6292
6475
|
...discount && { discount },
|
|
@@ -6297,7 +6480,8 @@ var convertOfferToV2 = ({ id, name, settings }) => {
|
|
|
6297
6480
|
...settings.productType && { productType: settings.productType },
|
|
6298
6481
|
sectionType: "dataSource",
|
|
6299
6482
|
...settings.subscriptionIsDefault && { subscriptionIsDefault: true },
|
|
6300
|
-
...settings.treatAsGwp && { treatAsGwp: true }
|
|
6483
|
+
...settings.treatAsGwp && { treatAsGwp: true },
|
|
6484
|
+
...variantLabels && { variantLabels }
|
|
6301
6485
|
};
|
|
6302
6486
|
const container = settings.displaySettings?.container;
|
|
6303
6487
|
const containerBorder = {
|