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