@rebuy/rebuy 3.41.0 → 3.42.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 +698 -632
- package/dist/index.mjs +698 -632
- package/dist/schema/index.d.ts +1 -0
- package/dist/schema/postPurchaseAdmission.d.ts +33 -0
- package/dist/schema/postPurchaseFollowups.d.ts +47 -0
- package/dist/schema/postPurchaseProductCollectionView.d.ts +38 -0
- package/dist/schema/postPurchaseProductView.d.ts +40 -0
- package/dist/schema/postPurchaseRecovery.d.ts +47 -0
- package/dist/schema/postPurchaseUpgrade.d.ts +117 -0
- package/dist/server/index.cjs +133 -120
- package/dist/server/index.mjs +133 -120
- package/dist/server/preparePostPurchaseAdmissionView.d.ts +32 -0
- package/dist/server/preparePostPurchaseCollectionGroup.d.ts +32 -0
- package/dist/server/preparePostPurchaseCollectionView.d.ts +32 -0
- package/dist/server/preparePostPurchaseGroupAdmissionView.d.ts +32 -0
- package/dist/server/preparePostPurchaseGroupDefault.d.ts +32 -0
- package/dist/server/preparePostPurchaseGroupView.d.ts +32 -0
- package/dist/server/preparePostPurchaseMemberView.d.ts +96 -0
- package/dist/server/preparePostPurchaseQuantityAdmissionView.d.ts +32 -0
- package/dist/server/preparePostPurchaseQuantityView.d.ts +32 -0
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -254,6 +254,7 @@ __export(src_exports, {
|
|
|
254
254
|
ProgressTierExclusionType: () => ProgressTierExclusionType,
|
|
255
255
|
ProgressTierType: () => ProgressTierType,
|
|
256
256
|
ProgressTierUnit: () => ProgressTierUnit,
|
|
257
|
+
PurchaseAdmissionModeSchema: () => PurchaseAdmissionModeSchema,
|
|
257
258
|
PurchaseAnalyticsRequestSchema: () => PurchaseAnalyticsRequestSchema,
|
|
258
259
|
PurchaseAnalyticsResponseSchema: () => PurchaseAnalyticsResponseSchema,
|
|
259
260
|
PurchaseAnalyticsStatusSchema: () => PurchaseAnalyticsStatusSchema,
|
|
@@ -330,6 +331,11 @@ __export(src_exports, {
|
|
|
330
331
|
TiptapParagraph: () => TiptapParagraph,
|
|
331
332
|
TiptapText: () => TiptapText,
|
|
332
333
|
UI_LABELS: () => UI_LABELS,
|
|
334
|
+
UpgradeCompensationProgressSchema: () => UpgradeCompensationProgressSchema,
|
|
335
|
+
UpgradeProgressSchema: () => UpgradeProgressSchema,
|
|
336
|
+
UpgradeRefundProgressSchema: () => UpgradeRefundProgressSchema,
|
|
337
|
+
UpgradeReviewProgressSchema: () => UpgradeReviewProgressSchema,
|
|
338
|
+
UpgradeReviewReasonSchema: () => UpgradeReviewReasonSchema,
|
|
333
339
|
UserConfig: () => UserConfig,
|
|
334
340
|
VariableEffect: () => VariableEffect,
|
|
335
341
|
VariableType: () => VariableType,
|
|
@@ -2885,6 +2891,8 @@ var PostPurchaseProductChangeset = import_zod23.z.object({
|
|
|
2885
2891
|
});
|
|
2886
2892
|
|
|
2887
2893
|
// src/schema/postPurchaseAdmission.ts
|
|
2894
|
+
var PurchaseAdmissionModeSchema = import_zod24.z.enum(["purchase", "upgrade"]);
|
|
2895
|
+
var selection = PreparedPostPurchaseProduct.shape.selection;
|
|
2888
2896
|
var PurchaseExpectedSchema = import_zod24.z.object({
|
|
2889
2897
|
buyerConsentToSubscriptions: import_zod24.z.boolean().optional(),
|
|
2890
2898
|
changeset: PostPurchaseProductChangeset.extend({
|
|
@@ -2892,16 +2900,20 @@ var PurchaseExpectedSchema = import_zod24.z.object({
|
|
|
2892
2900
|
}),
|
|
2893
2901
|
entry: DecisionEntrySchema,
|
|
2894
2902
|
member: PostPurchaseMemberIdentity.optional(),
|
|
2903
|
+
mode: PurchaseAdmissionModeSchema.optional(),
|
|
2895
2904
|
progressRevision: import_zod24.z.number().int().nonnegative().optional(),
|
|
2896
|
-
selection
|
|
2905
|
+
selection
|
|
2897
2906
|
}).refine(
|
|
2898
2907
|
({ member, progressRevision }) => !member || progressRevision !== void 0,
|
|
2899
2908
|
"Captured member requires progress"
|
|
2900
|
-
).refine(
|
|
2909
|
+
).refine(
|
|
2910
|
+
({ mode, selection: { sellingPlanId } }) => mode !== "upgrade" || sellingPlanId !== void 0,
|
|
2911
|
+
"An upgrade selects a subscription"
|
|
2912
|
+
).refine(({ buyerConsentToSubscriptions: consent, changeset, selection: selection3 }) => {
|
|
2901
2913
|
const [change, shipping] = changeset.changes;
|
|
2902
|
-
if (
|
|
2903
|
-
return consent !== true && change?.type === "add_variant" && change.variantId ===
|
|
2904
|
-
return consent === true && changeset.changes.length === 1 && change.type === "add_subscription" && change.sellingPlanId ===
|
|
2914
|
+
if (selection3.sellingPlanId === void 0)
|
|
2915
|
+
return consent !== true && change?.type === "add_variant" && change.variantId === selection3.variantId && change.quantity === selection3.quantity && (shipping === void 0 || shipping.type === "add_shipping_line");
|
|
2916
|
+
return consent === true && changeset.changes.length === 1 && change.type === "add_subscription" && change.sellingPlanId === selection3.sellingPlanId && change.variantId === selection3.variantId && change.quantity === selection3.quantity;
|
|
2905
2917
|
}, "Selection, change and buyer consent must agree");
|
|
2906
2918
|
var PurchaseRequestSchema = DecideRequestSchema.extend({
|
|
2907
2919
|
expected: PurchaseExpectedSchema,
|
|
@@ -2910,12 +2922,18 @@ var PurchaseRequestSchema = DecideRequestSchema.extend({
|
|
|
2910
2922
|
var PurchaseReceiptSchema = import_zod24.z.object({
|
|
2911
2923
|
admittedAt: PostPurchaseTimestampSchema,
|
|
2912
2924
|
changesetToken: import_zod24.z.string().min(1),
|
|
2925
|
+
mode: PurchaseAdmissionModeSchema.optional(),
|
|
2913
2926
|
operationId: import_zod24.z.uuid(),
|
|
2927
|
+
/** The server-bound one-time line an upgrade refunds; its quantity is the order's, not the selection's. */
|
|
2928
|
+
originalLine: import_zod24.z.strictObject({ quantity: selection.shape.quantity, variantId: selection.shape.variantId }).optional(),
|
|
2914
2929
|
requiresSubscriptionConsent: import_zod24.z.boolean(),
|
|
2915
|
-
selection
|
|
2930
|
+
selection
|
|
2916
2931
|
}).refine(
|
|
2917
|
-
({ requiresSubscriptionConsent, selection:
|
|
2932
|
+
({ requiresSubscriptionConsent, selection: selection3 }) => requiresSubscriptionConsent === (selection3.sellingPlanId !== void 0),
|
|
2918
2933
|
"Receipt consent must match its selected plan"
|
|
2934
|
+
).refine(
|
|
2935
|
+
({ mode, originalLine, selection: { sellingPlanId, variantId } }) => mode === "upgrade" ? sellingPlanId !== void 0 && originalLine?.variantId === variantId : originalLine === void 0,
|
|
2936
|
+
"An upgrade Receipt binds the original line of its subscribed variant, and only an upgrade does"
|
|
2919
2937
|
);
|
|
2920
2938
|
var PurchaseResponseSchema = import_zod24.z.object({ data: PurchaseReceiptSchema, successful: import_zod24.z.literal(true) });
|
|
2921
2939
|
|
|
@@ -3110,10 +3128,10 @@ var ExitPolicySchema = import_zod36.z.discriminatedUnion("status", [
|
|
|
3110
3128
|
]);
|
|
3111
3129
|
|
|
3112
3130
|
// src/schema/postPurchaseFinish.ts
|
|
3113
|
-
var
|
|
3131
|
+
var import_zod43 = require("zod");
|
|
3114
3132
|
|
|
3115
3133
|
// src/schema/postPurchaseFollowups.ts
|
|
3116
|
-
var
|
|
3134
|
+
var import_zod41 = require("zod");
|
|
3117
3135
|
|
|
3118
3136
|
// src/schema/postPurchaseHealthProgress.ts
|
|
3119
3137
|
var import_zod38 = require("zod");
|
|
@@ -3205,63 +3223,106 @@ var PurchaseObservationResponseSchema = import_zod39.z.object({
|
|
|
3205
3223
|
successful: import_zod39.z.literal(true)
|
|
3206
3224
|
});
|
|
3207
3225
|
|
|
3226
|
+
// src/schema/postPurchaseUpgrade.ts
|
|
3227
|
+
var import_zod40 = require("zod");
|
|
3228
|
+
var AttemptSchema2 = import_zod40.z.strictObject({ attemptedAt: PostPurchaseTimestampSchema, status: import_zod40.z.literal("attempted") });
|
|
3229
|
+
var FinishedSchema = AttemptSchema2.extend({ finishedAt: PostPurchaseTimestampSchema });
|
|
3230
|
+
var UpgradeRefundProgressSchema = import_zod40.z.union([
|
|
3231
|
+
AttemptSchema2,
|
|
3232
|
+
FinishedSchema.extend({ refundId: import_zod40.z.string().min(1), status: import_zod40.z.literal("refunded") }),
|
|
3233
|
+
FinishedSchema.extend({ status: import_zod40.z.enum(["failed", "unknown"]) })
|
|
3234
|
+
]);
|
|
3235
|
+
var UpgradeCompensationProgressSchema = import_zod40.z.union([
|
|
3236
|
+
AttemptSchema2,
|
|
3237
|
+
FinishedSchema.extend({ status: import_zod40.z.enum(["removed", "failed", "unknown"]) })
|
|
3238
|
+
]);
|
|
3239
|
+
var UpgradeReviewReasonSchema = import_zod40.z.enum(["refund-unknown", "compensation-failed", "compensation-unknown"]);
|
|
3240
|
+
var UpgradeReviewProgressSchema = import_zod40.z.strictObject({
|
|
3241
|
+
markedAt: PostPurchaseTimestampSchema,
|
|
3242
|
+
marker: AcceptedMetafieldResultSchema.shape.status,
|
|
3243
|
+
reason: UpgradeReviewReasonSchema
|
|
3244
|
+
});
|
|
3245
|
+
var reviewReason = (refund, compensation) => {
|
|
3246
|
+
if (refund?.status === "unknown") return "refund-unknown";
|
|
3247
|
+
if (compensation?.status === "failed" || compensation?.status === "unknown")
|
|
3248
|
+
return `compensation-${compensation.status}`;
|
|
3249
|
+
return null;
|
|
3250
|
+
};
|
|
3251
|
+
var UpgradeProgressSchema = import_zod40.z.strictObject({
|
|
3252
|
+
compensation: UpgradeCompensationProgressSchema.nullable(),
|
|
3253
|
+
operationId: PurchaseReceiptSchema.shape.operationId,
|
|
3254
|
+
refund: UpgradeRefundProgressSchema.nullable(),
|
|
3255
|
+
review: UpgradeReviewProgressSchema.nullable()
|
|
3256
|
+
}).refine(
|
|
3257
|
+
({ compensation, refund }) => compensation === null || refund?.status === "failed",
|
|
3258
|
+
"Compensation follows a known refund failure only"
|
|
3259
|
+
).refine(
|
|
3260
|
+
({ compensation, refund, review }) => (review?.reason ?? null) === reviewReason(refund, compensation),
|
|
3261
|
+
"Review must match the unresolved outcome"
|
|
3262
|
+
);
|
|
3263
|
+
|
|
3208
3264
|
// src/schema/postPurchaseFollowups.ts
|
|
3209
|
-
var RequiredHealthSchema =
|
|
3265
|
+
var RequiredHealthSchema = import_zod41.z.union([
|
|
3210
3266
|
HealthSchedulingResponseSchema.shape.data,
|
|
3211
|
-
|
|
3267
|
+
import_zod41.z.strictObject({ status: import_zod41.z.literal("unavailable") })
|
|
3212
3268
|
]);
|
|
3213
|
-
var AcceptedFollowupsResponseSchema =
|
|
3214
|
-
data:
|
|
3215
|
-
acceptedEvent:
|
|
3269
|
+
var AcceptedFollowupsResponseSchema = import_zod41.z.object({
|
|
3270
|
+
data: import_zod41.z.object({
|
|
3271
|
+
acceptedEvent: import_zod41.z.union([
|
|
3216
3272
|
AcceptedEventResponseSchema.shape.data,
|
|
3217
|
-
|
|
3273
|
+
import_zod41.z.strictObject({ status: import_zod41.z.literal("unavailable") })
|
|
3218
3274
|
]),
|
|
3219
3275
|
acceptedMetafield: AcceptedMetafieldResultSchema,
|
|
3220
3276
|
health: RequiredHealthSchema,
|
|
3221
|
-
purchase: PurchaseObservationResponseSchema.shape.data
|
|
3277
|
+
purchase: PurchaseObservationResponseSchema.shape.data,
|
|
3278
|
+
/** Present only for an upgrade admission, and always for the same operation as `purchase`. */
|
|
3279
|
+
upgrade: UpgradeProgressSchema.optional()
|
|
3280
|
+
}).refine(({ purchase, upgrade }) => !upgrade || upgrade.operationId === purchase.operationId, {
|
|
3281
|
+
message: "Upgrade progress belongs to its operation",
|
|
3282
|
+
path: ["upgrade", "operationId"]
|
|
3222
3283
|
}),
|
|
3223
|
-
successful:
|
|
3284
|
+
successful: import_zod41.z.literal(true)
|
|
3224
3285
|
});
|
|
3225
3286
|
|
|
3226
3287
|
// src/schema/postPurchaseSessionClose.ts
|
|
3227
|
-
var
|
|
3228
|
-
var SessionClosureSchema =
|
|
3288
|
+
var import_zod42 = require("zod");
|
|
3289
|
+
var SessionClosureSchema = import_zod42.z.object({ closedAt: PostPurchaseTimestampSchema, status: import_zod42.z.literal("closed") });
|
|
3229
3290
|
var SessionCloseRequestSchema = DecideRequestSchema.strict();
|
|
3230
|
-
var SessionCloseResponseSchema =
|
|
3291
|
+
var SessionCloseResponseSchema = import_zod42.z.object({ data: SessionClosureSchema, successful: import_zod42.z.literal(true) });
|
|
3231
3292
|
|
|
3232
3293
|
// src/schema/postPurchaseFinish.ts
|
|
3233
|
-
var FinishedPurchaseSchema =
|
|
3234
|
-
|
|
3235
|
-
|
|
3294
|
+
var FinishedPurchaseSchema = import_zod43.z.union([
|
|
3295
|
+
import_zod43.z.strictObject({ status: import_zod43.z.literal("none") }),
|
|
3296
|
+
import_zod43.z.strictObject({
|
|
3236
3297
|
operationId: PurchaseReceiptSchema.shape.operationId,
|
|
3237
|
-
status:
|
|
3238
|
-
|
|
3298
|
+
status: import_zod43.z.union([
|
|
3299
|
+
import_zod43.z.literal("pending"),
|
|
3239
3300
|
...PurchaseObservationSchema.options.map((option) => option.shape.status)
|
|
3240
3301
|
])
|
|
3241
3302
|
})
|
|
3242
3303
|
]);
|
|
3243
3304
|
var SessionFinishRequestSchema = DecideRequestSchema.strict();
|
|
3244
|
-
var SessionFinishResponseSchema =
|
|
3305
|
+
var SessionFinishResponseSchema = import_zod43.z.object({
|
|
3245
3306
|
data: SessionClosureSchema.extend({
|
|
3246
3307
|
classification: ClassificationProgressSchema,
|
|
3247
3308
|
exitPolicy: ExitPolicySchema,
|
|
3248
3309
|
health: RequiredHealthSchema.nullable(),
|
|
3249
3310
|
purchase: FinishedPurchaseSchema
|
|
3250
3311
|
}),
|
|
3251
|
-
successful:
|
|
3312
|
+
successful: import_zod43.z.literal(true)
|
|
3252
3313
|
});
|
|
3253
3314
|
|
|
3254
3315
|
// src/schema/postPurchaseQuantity.ts
|
|
3255
|
-
var
|
|
3316
|
+
var import_zod66 = require("zod");
|
|
3256
3317
|
|
|
3257
3318
|
// src/schema/postPurchaseProductCollectionView.ts
|
|
3258
|
-
var
|
|
3319
|
+
var import_zod65 = require("zod");
|
|
3259
3320
|
|
|
3260
3321
|
// src/schema/postPurchaseProductView.ts
|
|
3261
|
-
var
|
|
3322
|
+
var import_zod64 = require("zod");
|
|
3262
3323
|
|
|
3263
3324
|
// src/schema/postPurchaseGroupCatalog.ts
|
|
3264
|
-
var
|
|
3325
|
+
var import_zod44 = require("zod");
|
|
3265
3326
|
var productId = PreparedPostPurchaseProduct.shape.selection.shape.productId;
|
|
3266
3327
|
var source = PostPurchaseProductSource.shape.data.element;
|
|
3267
3328
|
var PostPurchaseGroupDescription = source.pick({ description: true, id: true, image: true, images: true, title: true }).extend({
|
|
@@ -3269,17 +3330,17 @@ var PostPurchaseGroupDescription = source.pick({ description: true, id: true, im
|
|
|
3269
3330
|
image: source.shape.image.default(null),
|
|
3270
3331
|
options: PostPurchaseVariantCatalog.shape.options.default([])
|
|
3271
3332
|
});
|
|
3272
|
-
var PostPurchaseGroupCatalog =
|
|
3333
|
+
var PostPurchaseGroupCatalog = import_zod44.z.object({
|
|
3273
3334
|
memberProductId: productId,
|
|
3274
|
-
options:
|
|
3335
|
+
options: import_zod44.z.array(import_zod44.z.object({ productId, title: import_zod44.z.string(), variantCatalog: PostPurchaseVariantCatalog }))
|
|
3275
3336
|
});
|
|
3276
|
-
var PostPurchaseGroupSelection =
|
|
3337
|
+
var PostPurchaseGroupSelection = import_zod44.z.object({
|
|
3277
3338
|
memberProductId: productId,
|
|
3278
3339
|
productId
|
|
3279
3340
|
});
|
|
3280
3341
|
|
|
3281
3342
|
// src/schema/widgets/checkout-and-beyond/root.ts
|
|
3282
|
-
var
|
|
3343
|
+
var import_zod63 = require("zod");
|
|
3283
3344
|
|
|
3284
3345
|
// src/schema/widgets/checkout-and-beyond/constants.ts
|
|
3285
3346
|
var import_es_toolkit3 = require("es-toolkit");
|
|
@@ -3334,18 +3395,18 @@ var targetAreas = {
|
|
|
3334
3395
|
|
|
3335
3396
|
// src/schema/widgets/checkout-and-beyond/layout.ts
|
|
3336
3397
|
var import_uuid15 = require("uuid");
|
|
3337
|
-
var
|
|
3398
|
+
var import_zod62 = require("zod");
|
|
3338
3399
|
|
|
3339
3400
|
// src/schema/widgets/checkout-and-beyond/shared.ts
|
|
3340
|
-
var
|
|
3401
|
+
var import_zod61 = require("zod");
|
|
3341
3402
|
|
|
3342
3403
|
// src/schema/widgets/checkout-and-beyond/banner.ts
|
|
3343
|
-
var
|
|
3344
|
-
var CABBannerSection =
|
|
3404
|
+
var import_zod45 = require("zod");
|
|
3405
|
+
var CABBannerSection = import_zod45.z.lazy(
|
|
3345
3406
|
() => CABLayoutSection.omit({ sectionType: true }).extend({
|
|
3346
|
-
buttonField:
|
|
3347
|
-
color:
|
|
3348
|
-
dismissible:
|
|
3407
|
+
buttonField: import_zod45.z.enum(buttonFields).optional(),
|
|
3408
|
+
color: import_zod45.z.enum(bannerColors).default("info"),
|
|
3409
|
+
dismissible: import_zod45.z.boolean().default(true),
|
|
3349
3410
|
/**
|
|
3350
3411
|
* The `s-banner` heading — localized content (a buyer can see a merchant-composed banner). Absent OR
|
|
3351
3412
|
* blank ⇒ no heading; the renderer emits no heading slot for `''` rather than an empty one.
|
|
@@ -3361,18 +3422,18 @@ var CABBannerSection = import_zod44.z.lazy(
|
|
|
3361
3422
|
* not a 500. Nothing emits `heading` yet; the first converter that maps merchant banner copy into it
|
|
3362
3423
|
* either strips first or teaches `normalizeTextContent` to strip this field.
|
|
3363
3424
|
*/
|
|
3364
|
-
heading:
|
|
3365
|
-
sectionType:
|
|
3425
|
+
heading: import_zod45.z.record(import_zod45.z.string(), import_zod45.z.string().refine(checkForHTML, NO_HTML)).optional(),
|
|
3426
|
+
sectionType: import_zod45.z.literal(SectionType.banner).default(SectionType.banner)
|
|
3366
3427
|
})
|
|
3367
3428
|
);
|
|
3368
3429
|
|
|
3369
3430
|
// src/schema/widgets/checkout-and-beyond/button.ts
|
|
3370
3431
|
var import_uuid5 = require("uuid");
|
|
3371
|
-
var
|
|
3432
|
+
var import_zod47 = require("zod");
|
|
3372
3433
|
|
|
3373
3434
|
// src/schema/widgets/checkout-and-beyond/image.ts
|
|
3374
3435
|
var import_uuid4 = require("uuid");
|
|
3375
|
-
var
|
|
3436
|
+
var import_zod46 = require("zod");
|
|
3376
3437
|
|
|
3377
3438
|
// src/schema/widgets/checkout-and-beyond/icons.ts
|
|
3378
3439
|
var iconNames = [
|
|
@@ -3459,17 +3520,17 @@ var iconTones = ["auto", "critical", "custom", "info", "neutral", "success", "wa
|
|
|
3459
3520
|
var IconTone = freezeEnum(iconTones);
|
|
3460
3521
|
|
|
3461
3522
|
// src/schema/widgets/checkout-and-beyond/image.ts
|
|
3462
|
-
var CABImageSectionFields =
|
|
3523
|
+
var CABImageSectionFields = import_zod46.z.object({
|
|
3463
3524
|
...CABVariableFields,
|
|
3464
|
-
altText:
|
|
3525
|
+
altText: import_zod46.z.string().refine(checkForHTML, NO_HTML).default(""),
|
|
3465
3526
|
/**
|
|
3466
3527
|
* Image width÷height (e.g. `46` for the progress-bar fill); `null` renders at natural size. Any POSITIVE
|
|
3467
3528
|
* ratio — never limited to 1, but never `0`/negative either: a renderer dividing by it would get `Infinity`,
|
|
3468
3529
|
* and CSS `aspect-ratio` drops a negative value and silently reverts to natural size.
|
|
3469
3530
|
*/
|
|
3470
|
-
aspectRatio:
|
|
3471
|
-
border:
|
|
3472
|
-
buttonField:
|
|
3531
|
+
aspectRatio: import_zod46.z.number().positive().nullable().default(null),
|
|
3532
|
+
border: import_zod46.z.lazy(() => CABBorder),
|
|
3533
|
+
buttonField: import_zod46.z.enum(buttonFields).optional(),
|
|
3473
3534
|
/**
|
|
3474
3535
|
* `icon` renders `source` as a single `s-icon` by name (the uber-image path covers icons too), reading
|
|
3475
3536
|
* `iconSize`/`iconTone`. The other values are a harmless informational holdover from the previous
|
|
@@ -3488,29 +3549,29 @@ var CABImageSectionFields = import_zod45.z.object({
|
|
|
3488
3549
|
* behavior degraded gracefully and told us about it. The client-assembled half of the invariant was never
|
|
3489
3550
|
* the risky half.
|
|
3490
3551
|
*/
|
|
3491
|
-
category:
|
|
3552
|
+
category: import_zod46.z.enum(["gallery", "icon", "icons", "payment-methods", "secure-checkout"]).nullable().default(null),
|
|
3492
3553
|
/** `icon`-mode only: the `s-icon` `size`; `null` ⇒ the component default (`base`). Ignored by image treatments. */
|
|
3493
|
-
iconSize:
|
|
3554
|
+
iconSize: import_zod46.z.enum(iconSizes).nullable().default(null),
|
|
3494
3555
|
/** `icon`-mode only: the `s-icon` `tone`; `null` ⇒ the component default (`auto`). Ignored by image treatments. */
|
|
3495
|
-
iconTone:
|
|
3496
|
-
name:
|
|
3497
|
-
naturalHeight:
|
|
3498
|
-
naturalWidth:
|
|
3556
|
+
iconTone: import_zod46.z.enum(iconTones).nullable().default(null),
|
|
3557
|
+
name: import_zod46.z.string().optional(),
|
|
3558
|
+
naturalHeight: import_zod46.z.number().default(0),
|
|
3559
|
+
naturalWidth: import_zod46.z.number().default(0),
|
|
3499
3560
|
/**
|
|
3500
3561
|
* `contain` (the component default): dimensionless images render in s-image's 1/1 default frame, and
|
|
3501
3562
|
* `cover` would crop non-square art (payment badges lost their edges — 15993); `contain` letterboxes.
|
|
3502
3563
|
*/
|
|
3503
|
-
objectFit:
|
|
3504
|
-
sectionId:
|
|
3505
|
-
sectionType:
|
|
3564
|
+
objectFit: import_zod46.z.enum(objectFits).default(ObjectFit.contain),
|
|
3565
|
+
sectionId: import_zod46.z.uuid().default(() => (0, import_uuid4.v7)()),
|
|
3566
|
+
sectionType: import_zod46.z.literal(SectionType.image).default(SectionType.image),
|
|
3506
3567
|
/**
|
|
3507
3568
|
* An image URL or dynamic token, an empty default, or — when `category: 'icon'` — an icon NAME. Icon mode
|
|
3508
3569
|
* takes a name or `''` only, NOT a token: no renderer resolves a token to an icon today, so accepting one
|
|
3509
3570
|
* would promise a capability that doesn't exist. Widen the refine's carve-out to `DYNAMIC_TOKEN_REGEX` when a
|
|
3510
3571
|
* server-chosen tier icon actually needs it.
|
|
3511
3572
|
*/
|
|
3512
|
-
source:
|
|
3513
|
-
width:
|
|
3573
|
+
source: import_zod46.z.union([import_zod46.z.url(), import_zod46.z.literal(""), import_zod46.z.string().regex(DYNAMIC_TOKEN_REGEX), import_zod46.z.enum(iconNames)]).default(""),
|
|
3574
|
+
width: import_zod46.z.number().default(100)
|
|
3514
3575
|
});
|
|
3515
3576
|
var iconNameSet = new Set(iconNames);
|
|
3516
3577
|
var isIconName = (source2) => iconNameSet.has(source2);
|
|
@@ -3530,35 +3591,35 @@ var CABImageSection = CABImageSectionFields.superRefine(({ category, source: sou
|
|
|
3530
3591
|
});
|
|
3531
3592
|
|
|
3532
3593
|
// src/schema/widgets/checkout-and-beyond/button.ts
|
|
3533
|
-
var CABButtonContent =
|
|
3534
|
-
() =>
|
|
3594
|
+
var CABButtonContent = import_zod47.z.lazy(
|
|
3595
|
+
() => import_zod47.z.discriminatedUnion("sectionType", [CABImageSection, CABLayoutSection, CABTextSection])
|
|
3535
3596
|
);
|
|
3536
|
-
var CABButtonSection =
|
|
3597
|
+
var CABButtonSection = import_zod47.z.object({
|
|
3537
3598
|
...CABVariableFields,
|
|
3538
|
-
action:
|
|
3539
|
-
buttonStyle:
|
|
3540
|
-
custom:
|
|
3541
|
-
color:
|
|
3542
|
-
height:
|
|
3543
|
-
width:
|
|
3599
|
+
action: import_zod47.z.union([import_zod47.z.literal(""), import_zod47.z.enum(buttonActions)]).default(""),
|
|
3600
|
+
buttonStyle: import_zod47.z.enum(buttonStyles).default(ButtonStyle.primary),
|
|
3601
|
+
custom: import_zod47.z.object({
|
|
3602
|
+
color: import_zod47.z.string().regex(HEX_COLOR_REGEX).default("#005bd3"),
|
|
3603
|
+
height: import_zod47.z.number().default(52),
|
|
3604
|
+
width: import_zod47.z.number().default(300)
|
|
3544
3605
|
}).default({
|
|
3545
3606
|
color: "#005bd3",
|
|
3546
3607
|
height: 52,
|
|
3547
3608
|
width: 300
|
|
3548
3609
|
}),
|
|
3549
|
-
disableDowngrade:
|
|
3550
|
-
name:
|
|
3551
|
-
optionId:
|
|
3552
|
-
popover:
|
|
3553
|
-
alignment:
|
|
3554
|
-
position:
|
|
3610
|
+
disableDowngrade: import_zod47.z.boolean().default(false),
|
|
3611
|
+
name: import_zod47.z.string().optional(),
|
|
3612
|
+
optionId: import_zod47.z.number().optional(),
|
|
3613
|
+
popover: import_zod47.z.object({
|
|
3614
|
+
alignment: import_zod47.z.enum(textAlignments).default(TextAlignment.center),
|
|
3615
|
+
position: import_zod47.z.enum(popoverPositions).default(PopoverPosition.blockStart)
|
|
3555
3616
|
}).optional().default(() => ({
|
|
3556
3617
|
alignment: TextAlignment.center,
|
|
3557
3618
|
position: PopoverPosition.blockStart
|
|
3558
3619
|
})),
|
|
3559
|
-
sectionId:
|
|
3560
|
-
sections:
|
|
3561
|
-
sectionType:
|
|
3620
|
+
sectionId: import_zod47.z.uuid().default(() => (0, import_uuid5.v7)()),
|
|
3621
|
+
sections: import_zod47.z.union([import_zod47.z.array(CABButtonContent), import_zod47.z.strictObject({}).transform(() => [])]).default(() => []),
|
|
3622
|
+
sectionType: import_zod47.z.literal(SectionType.button).default(SectionType.button),
|
|
3562
3623
|
/**
|
|
3563
3624
|
* The smart-cart tier this button acts on (`addGift`/`removeGift`): scopes the click to one tier's gift. The
|
|
3564
3625
|
* client resolves the tier's gift (productId) from the progress-bar context by this `tierId` — the button node
|
|
@@ -3573,96 +3634,96 @@ var CABButtonSection = import_zod46.z.object({
|
|
|
3573
3634
|
* lookup finds no tier and the click resolves to nothing. Safe to bound — the field is new, so there are no
|
|
3574
3635
|
* stored payloads to grandfather, and the producer is client code, not a merchant form.
|
|
3575
3636
|
*/
|
|
3576
|
-
tier:
|
|
3637
|
+
tier: import_zod47.z.object({ tierId: import_zod47.z.string().min(1) }).optional(),
|
|
3577
3638
|
/** Fire-and-forget pixel POSTed when the button is clicked (e.g. a Monetize decline). */
|
|
3578
|
-
trackingUrl:
|
|
3639
|
+
trackingUrl: import_zod47.z.string().optional(),
|
|
3579
3640
|
/**
|
|
3580
3641
|
* Secondary effects applied to in-scope variables on click, alongside (never instead of) the primary
|
|
3581
3642
|
* `action` — an `addToOrder` button can also flip a variable. Applied in array order.
|
|
3582
3643
|
*/
|
|
3583
|
-
variableEffects:
|
|
3644
|
+
variableEffects: import_zod47.z.array(CABVariableEffect).optional()
|
|
3584
3645
|
});
|
|
3585
3646
|
|
|
3586
3647
|
// src/schema/widgets/checkout-and-beyond/carousel.ts
|
|
3587
|
-
var
|
|
3648
|
+
var import_zod52 = require("zod");
|
|
3588
3649
|
|
|
3589
3650
|
// src/schema/widgets/checkout-and-beyond/offers.ts
|
|
3590
|
-
var
|
|
3651
|
+
var import_zod51 = require("zod");
|
|
3591
3652
|
|
|
3592
3653
|
// src/schema/widgets/checkout-and-beyond/dataSource.ts
|
|
3593
3654
|
var import_uuid6 = require("uuid");
|
|
3594
|
-
var
|
|
3595
|
-
var CABDiscount =
|
|
3596
|
-
amount:
|
|
3597
|
-
discountedBy:
|
|
3598
|
-
discountedFrom:
|
|
3599
|
-
type:
|
|
3600
|
-
});
|
|
3601
|
-
var CABIntegrations =
|
|
3602
|
-
judgeme:
|
|
3603
|
-
junip:
|
|
3604
|
-
klaviyo:
|
|
3605
|
-
loox:
|
|
3606
|
-
okendo:
|
|
3607
|
-
opinew:
|
|
3608
|
-
reviewsio:
|
|
3609
|
-
stamped:
|
|
3610
|
-
yotpo:
|
|
3611
|
-
});
|
|
3612
|
-
var CABVariantLabels =
|
|
3613
|
-
variantOption:
|
|
3614
|
-
variantOptions:
|
|
3615
|
-
});
|
|
3616
|
-
var CABDataSourceSection =
|
|
3617
|
-
dataSourceId:
|
|
3618
|
-
dataSourcePath:
|
|
3655
|
+
var import_zod48 = require("zod");
|
|
3656
|
+
var CABDiscount = import_zod48.z.object({
|
|
3657
|
+
amount: import_zod48.z.union([import_zod48.z.number(), import_zod48.z.string()]).catch(0),
|
|
3658
|
+
discountedBy: import_zod48.z.string().optional(),
|
|
3659
|
+
discountedFrom: import_zod48.z.enum(discountSources).optional().catch(void 0),
|
|
3660
|
+
type: import_zod48.z.enum(discountTypes).catch("none")
|
|
3661
|
+
});
|
|
3662
|
+
var CABIntegrations = import_zod48.z.object({
|
|
3663
|
+
judgeme: import_zod48.z.boolean().default(false),
|
|
3664
|
+
junip: import_zod48.z.boolean().default(false),
|
|
3665
|
+
klaviyo: import_zod48.z.boolean().default(false),
|
|
3666
|
+
loox: import_zod48.z.boolean().default(false),
|
|
3667
|
+
okendo: import_zod48.z.boolean().default(false),
|
|
3668
|
+
opinew: import_zod48.z.boolean().default(false),
|
|
3669
|
+
reviewsio: import_zod48.z.boolean().default(false),
|
|
3670
|
+
stamped: import_zod48.z.boolean().default(false),
|
|
3671
|
+
yotpo: import_zod48.z.boolean().default(false)
|
|
3672
|
+
});
|
|
3673
|
+
var CABVariantLabels = import_zod48.z.object({
|
|
3674
|
+
variantOption: import_zod48.z.string().optional().catch(void 0),
|
|
3675
|
+
variantOptions: import_zod48.z.string().optional().catch(void 0)
|
|
3676
|
+
});
|
|
3677
|
+
var CABDataSourceSection = import_zod48.z.object({
|
|
3678
|
+
dataSourceId: import_zod48.z.number().nullable().default(null),
|
|
3679
|
+
dataSourcePath: import_zod48.z.string().default(DEFAULT_ENDPOINTS[0].value),
|
|
3619
3680
|
discount: CABDiscount.optional(),
|
|
3620
3681
|
integrations: CABIntegrations.optional(),
|
|
3621
|
-
limit:
|
|
3622
|
-
matchVariant:
|
|
3623
|
-
matchVariantOutOfStock:
|
|
3624
|
-
name:
|
|
3625
|
-
productType:
|
|
3626
|
-
sectionId:
|
|
3627
|
-
sectionType:
|
|
3682
|
+
limit: import_zod48.z.number().default(1),
|
|
3683
|
+
matchVariant: import_zod48.z.boolean().default(false),
|
|
3684
|
+
matchVariantOutOfStock: import_zod48.z.boolean().default(false),
|
|
3685
|
+
name: import_zod48.z.string().default(DEFAULT_ENDPOINTS[0].label),
|
|
3686
|
+
productType: import_zod48.z.enum(productTypes).optional(),
|
|
3687
|
+
sectionId: import_zod48.z.uuid().default(() => (0, import_uuid6.v7)()),
|
|
3688
|
+
sectionType: import_zod48.z.literal(SectionType.dataSource).default(SectionType.dataSource),
|
|
3628
3689
|
/** Default subscribe-vs-one-time for `productType: both` (legacy `subscription_is_default`). */
|
|
3629
|
-
subscriptionIsDefault:
|
|
3630
|
-
treatAsGwp:
|
|
3690
|
+
subscriptionIsDefault: import_zod48.z.boolean().default(false),
|
|
3691
|
+
treatAsGwp: import_zod48.z.boolean().default(false),
|
|
3631
3692
|
variantLabels: CABVariantLabels.optional().catch(void 0)
|
|
3632
3693
|
});
|
|
3633
3694
|
|
|
3634
3695
|
// src/schema/widgets/checkout-and-beyond/products.ts
|
|
3635
3696
|
var import_uuid8 = require("uuid");
|
|
3636
|
-
var
|
|
3697
|
+
var import_zod50 = require("zod");
|
|
3637
3698
|
|
|
3638
3699
|
// src/schema/widgets/checkout-and-beyond/product.ts
|
|
3639
3700
|
var import_uuid7 = require("uuid");
|
|
3640
|
-
var
|
|
3641
|
-
var CABVariantContent =
|
|
3642
|
-
() =>
|
|
3701
|
+
var import_zod49 = require("zod");
|
|
3702
|
+
var CABVariantContent = import_zod49.z.lazy(
|
|
3703
|
+
() => import_zod49.z.discriminatedUnion("sectionType", [CABButtonSection, CABTextSection])
|
|
3643
3704
|
);
|
|
3644
|
-
var CABProductSection =
|
|
3705
|
+
var CABProductSection = import_zod49.z.object({
|
|
3645
3706
|
...CABVariableFields,
|
|
3646
|
-
name:
|
|
3647
|
-
productId:
|
|
3648
|
-
sectionId:
|
|
3649
|
-
sections:
|
|
3650
|
-
sectionType:
|
|
3651
|
-
selectors:
|
|
3652
|
-
variantMode:
|
|
3707
|
+
name: import_zod49.z.string().optional(),
|
|
3708
|
+
productId: import_zod49.z.number().nullable().default(null),
|
|
3709
|
+
sectionId: import_zod49.z.uuid().default(() => (0, import_uuid7.v7)()),
|
|
3710
|
+
sections: import_zod49.z.union([import_zod49.z.array(CABVariantContent), import_zod49.z.strictObject({}).transform(() => [])]).default(() => []),
|
|
3711
|
+
sectionType: import_zod49.z.literal(SectionType.product).default(SectionType.product),
|
|
3712
|
+
selectors: import_zod49.z.record(import_zod49.z.string(), import_zod49.z.enum(variantSelectors).default(VariantSelector.menu)).default(() => ({})),
|
|
3713
|
+
variantMode: import_zod49.z.enum(variantModes).default(VariantMode.multiple)
|
|
3653
3714
|
});
|
|
3654
3715
|
|
|
3655
3716
|
// src/schema/widgets/checkout-and-beyond/products.ts
|
|
3656
|
-
var CABProductsSection =
|
|
3717
|
+
var CABProductsSection = import_zod50.z.object({
|
|
3657
3718
|
...CABVariableFields,
|
|
3658
|
-
name:
|
|
3659
|
-
sectionId:
|
|
3660
|
-
sections:
|
|
3661
|
-
sectionType:
|
|
3719
|
+
name: import_zod50.z.string().optional(),
|
|
3720
|
+
sectionId: import_zod50.z.uuid().default(() => (0, import_uuid8.v7)()),
|
|
3721
|
+
sections: import_zod50.z.union([import_zod50.z.array(import_zod50.z.lazy(() => CABProductSection)), import_zod50.z.strictObject({}).transform(() => [])]).default(() => []),
|
|
3722
|
+
sectionType: import_zod50.z.literal(SectionType.products).default(SectionType.products)
|
|
3662
3723
|
});
|
|
3663
3724
|
|
|
3664
3725
|
// src/schema/widgets/checkout-and-beyond/offers.ts
|
|
3665
|
-
var CABOffersSection =
|
|
3726
|
+
var CABOffersSection = import_zod51.z.lazy(
|
|
3666
3727
|
() => CABLayoutSection.omit({ sections: true, sectionType: true }).extend({
|
|
3667
3728
|
/**
|
|
3668
3729
|
* A rule between consecutive cards in the vertical list — legacy checkout-offers' `<Divider />`,
|
|
@@ -3670,8 +3731,8 @@ var CABOffersSection = import_zod50.z.lazy(
|
|
|
3670
3731
|
* run of products). Optional, not defaulted: only the v1 converter sets it (REB-24265); a
|
|
3671
3732
|
* hand-built tree keeps React CAB's dividerless rendering.
|
|
3672
3733
|
*/
|
|
3673
|
-
divider:
|
|
3674
|
-
sections:
|
|
3734
|
+
divider: import_zod51.z.boolean().optional(),
|
|
3735
|
+
sections: import_zod51.z.union([import_zod51.z.array(import_zod51.z.lazy(() => CABSection)), import_zod51.z.strictObject({}).transform(() => [])]).default(() => [
|
|
3675
3736
|
CABBannerSection.parse({
|
|
3676
3737
|
buttonField: "undoAddToOrder",
|
|
3677
3738
|
color: "success",
|
|
@@ -3685,77 +3746,77 @@ var CABOffersSection = import_zod50.z.lazy(
|
|
|
3685
3746
|
CABDataSourceSection.parse({}),
|
|
3686
3747
|
CABProductsSection.parse({})
|
|
3687
3748
|
]),
|
|
3688
|
-
sectionType:
|
|
3749
|
+
sectionType: import_zod51.z.literal(SectionType.offers).default(SectionType.offers)
|
|
3689
3750
|
})
|
|
3690
3751
|
);
|
|
3691
3752
|
|
|
3692
3753
|
// src/schema/widgets/checkout-and-beyond/carousel.ts
|
|
3693
|
-
var CABCarouselSection =
|
|
3754
|
+
var CABCarouselSection = import_zod52.z.lazy(
|
|
3694
3755
|
() => CABLayoutSection.omit({ sections: true, sectionType: true }).extend({
|
|
3695
|
-
autoAdvanceInterval:
|
|
3696
|
-
itemsAtOnce:
|
|
3756
|
+
autoAdvanceInterval: import_zod52.z.number().default(0),
|
|
3757
|
+
itemsAtOnce: import_zod52.z.number().min(1).default(1),
|
|
3697
3758
|
/** Card arrangement for the offers child (`horizontal` = side-by-side) — NOT the carousel's own `direction`. */
|
|
3698
|
-
offersDirection:
|
|
3699
|
-
sections:
|
|
3700
|
-
sectionType:
|
|
3759
|
+
offersDirection: import_zod52.z.enum(offersDirections).default("vertical"),
|
|
3760
|
+
sections: import_zod52.z.union([import_zod52.z.array(import_zod52.z.lazy(() => CABSection)), import_zod52.z.strictObject({}).transform(() => [])]).default(() => [CABOffersSection.parse({})]),
|
|
3761
|
+
sectionType: import_zod52.z.literal(SectionType.carousel).default(SectionType.carousel)
|
|
3701
3762
|
})
|
|
3702
3763
|
);
|
|
3703
3764
|
|
|
3704
3765
|
// src/schema/widgets/checkout-and-beyond/cartLine.ts
|
|
3705
|
-
var
|
|
3706
|
-
var CABCartLineSection =
|
|
3766
|
+
var import_zod53 = require("zod");
|
|
3767
|
+
var CABCartLineSection = import_zod53.z.lazy(
|
|
3707
3768
|
() => CABLayoutSection.omit({ sections: true, sectionType: true }).extend({
|
|
3708
|
-
sections:
|
|
3709
|
-
sectionType:
|
|
3769
|
+
sections: import_zod53.z.union([import_zod53.z.array(import_zod53.z.lazy(() => CABSection)), import_zod53.z.strictObject({}).transform(() => [])]).default(() => [CABButtonSection.parse({ action: ButtonAction.switchToSubscription })]),
|
|
3770
|
+
sectionType: import_zod53.z.literal(SectionType.cartLine).default(SectionType.cartLine)
|
|
3710
3771
|
})
|
|
3711
3772
|
);
|
|
3712
3773
|
|
|
3713
3774
|
// src/schema/widgets/checkout-and-beyond/discount.ts
|
|
3714
3775
|
var import_uuid9 = require("uuid");
|
|
3715
|
-
var
|
|
3716
|
-
var CABDiscountSection =
|
|
3776
|
+
var import_zod54 = require("zod");
|
|
3777
|
+
var CABDiscountSection = import_zod54.z.object({
|
|
3717
3778
|
...CABVariableFields,
|
|
3718
|
-
amount:
|
|
3719
|
-
discountedBy:
|
|
3720
|
-
discountedFrom:
|
|
3721
|
-
message:
|
|
3722
|
-
name:
|
|
3723
|
-
quantity:
|
|
3724
|
-
sectionId:
|
|
3725
|
-
sectionType:
|
|
3726
|
-
type:
|
|
3779
|
+
amount: import_zod54.z.union([import_zod54.z.number(), import_zod54.z.string()]).catch(0),
|
|
3780
|
+
discountedBy: import_zod54.z.string().optional(),
|
|
3781
|
+
discountedFrom: import_zod54.z.enum(discountSources).optional().catch(void 0),
|
|
3782
|
+
message: import_zod54.z.string().optional(),
|
|
3783
|
+
name: import_zod54.z.string().optional(),
|
|
3784
|
+
quantity: import_zod54.z.number().default(1),
|
|
3785
|
+
sectionId: import_zod54.z.uuid().default(() => (0, import_uuid9.v7)()),
|
|
3786
|
+
sectionType: import_zod54.z.literal(SectionType.discount).default(SectionType.discount),
|
|
3787
|
+
type: import_zod54.z.enum(discountTypes).catch("none")
|
|
3727
3788
|
});
|
|
3728
3789
|
|
|
3729
3790
|
// src/schema/widgets/checkout-and-beyond/monetize.ts
|
|
3730
3791
|
var import_uuid10 = require("uuid");
|
|
3731
|
-
var
|
|
3732
|
-
var CABMonetizeAds =
|
|
3733
|
-
requestId:
|
|
3792
|
+
var import_zod55 = require("zod");
|
|
3793
|
+
var CABMonetizeAds = import_zod55.z.object({
|
|
3794
|
+
requestId: import_zod55.z.string().optional(),
|
|
3734
3795
|
/** Defaulted here, never in the beacon: absence of information is `ads` itself being absent. */
|
|
3735
|
-
testing:
|
|
3796
|
+
testing: import_zod55.z.boolean().default(false)
|
|
3736
3797
|
});
|
|
3737
|
-
var CABMonetizeSection =
|
|
3798
|
+
var CABMonetizeSection = import_zod55.z.object({
|
|
3738
3799
|
...CABVariableFields,
|
|
3739
3800
|
ads: CABMonetizeAds.optional(),
|
|
3740
|
-
name:
|
|
3801
|
+
name: import_zod55.z.string().optional(),
|
|
3741
3802
|
/**
|
|
3742
3803
|
* Server-hydrated offer cards (inline hydration): when `/cab/sections` was asked with a `monetize`
|
|
3743
3804
|
* context block, the composed cards ride the marker itself — `[]` means "hydrated, no fill" (render
|
|
3744
3805
|
* nothing, skip the fetch); ABSENT means "not hydrated" (the client fetches via `/cab/monetize`).
|
|
3745
3806
|
*/
|
|
3746
|
-
offers:
|
|
3807
|
+
offers: import_zod55.z.array(import_zod55.z.lazy(() => CABSection)).optional(),
|
|
3747
3808
|
/** 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. */
|
|
3748
|
-
privacyPolicyUrl:
|
|
3749
|
-
sectionId:
|
|
3750
|
-
sectionType:
|
|
3809
|
+
privacyPolicyUrl: import_zod55.z.string().optional(),
|
|
3810
|
+
sectionId: import_zod55.z.uuid().default(() => (0, import_uuid10.v7)()),
|
|
3811
|
+
sectionType: import_zod55.z.literal(SectionType.monetize).default(SectionType.monetize),
|
|
3751
3812
|
/** Ads-taxonomy sub-vertical id (the widget's `sub_vertical` setting); paired with `vertical`. */
|
|
3752
|
-
subVertical:
|
|
3813
|
+
subVertical: import_zod55.z.string().optional(),
|
|
3753
3814
|
/** Ads-taxonomy vertical id (the widget's `vertical` setting) — with `subVertical`, the admin Monetize editor's two configurables. */
|
|
3754
|
-
vertical:
|
|
3815
|
+
vertical: import_zod55.z.string().optional()
|
|
3755
3816
|
});
|
|
3756
3817
|
|
|
3757
3818
|
// src/schema/widgets/checkout-and-beyond/progressBar.ts
|
|
3758
|
-
var
|
|
3819
|
+
var import_zod56 = require("zod");
|
|
3759
3820
|
|
|
3760
3821
|
// src/schema/widgets/checkout-and-beyond/giftLabels.ts
|
|
3761
3822
|
var GIFT_LABELS = {
|
|
@@ -3874,34 +3935,34 @@ var GIFT_LABELS = {
|
|
|
3874
3935
|
};
|
|
3875
3936
|
|
|
3876
3937
|
// src/schema/widgets/checkout-and-beyond/progressBar.ts
|
|
3877
|
-
var CABProgressTierExclusion =
|
|
3878
|
-
collectionIds:
|
|
3879
|
-
productIds:
|
|
3880
|
-
tags:
|
|
3881
|
-
type:
|
|
3938
|
+
var CABProgressTierExclusion = import_zod56.z.object({
|
|
3939
|
+
collectionIds: import_zod56.z.array(import_zod56.z.number().int().positive()).default(() => []),
|
|
3940
|
+
productIds: import_zod56.z.array(import_zod56.z.number().int().positive()).default(() => []),
|
|
3941
|
+
tags: import_zod56.z.array(import_zod56.z.string().min(1)).default(() => []),
|
|
3942
|
+
type: import_zod56.z.enum(progressTierExclusionTypes)
|
|
3882
3943
|
});
|
|
3883
|
-
var CABProgressTier =
|
|
3944
|
+
var CABProgressTier = import_zod56.z.object({
|
|
3884
3945
|
/**
|
|
3885
3946
|
* Order-discount tiers only (onsite `discount`): the reward the order-discount Function applies at
|
|
3886
3947
|
* cart time, carried so the client can resolve the `{{discountAmount}}` token in this tier's copy.
|
|
3887
3948
|
* `fixedAmount`: shop-currency CENTS (FX-scaled by the client, like {@link CABProgressTier.threshold});
|
|
3888
3949
|
* `percentage`: the whole-percent number rendered raw (`{n}%`). Absent on non-discount tiers.
|
|
3889
3950
|
*/
|
|
3890
|
-
discount:
|
|
3951
|
+
discount: import_zod56.z.object({ amount: import_zod56.z.number().nonnegative(), type: import_zod56.z.enum(["fixedAmount", "percentage"]) }).optional(),
|
|
3891
3952
|
/**
|
|
3892
3953
|
* Per-tier exclusion rules (onsite `exclusions` when `exclusions_enabled`): lines they match don't count
|
|
3893
3954
|
* toward this tier. Empty (the default, and the converter's output for a disabled or ruleless tier) means
|
|
3894
3955
|
* the tier measures the plain bar-level adjusted progress. Consumers read ONLY the list named by the rule's
|
|
3895
3956
|
* `type` — the converter leaves the other two at `[]`, so a populated off-type list never reaches the tree.
|
|
3896
3957
|
*/
|
|
3897
|
-
exclusions:
|
|
3958
|
+
exclusions: import_zod56.z.array(CABProgressTierExclusion).default(() => []),
|
|
3898
3959
|
/**
|
|
3899
3960
|
* Smart-cart product (gift) tiers only (onsite `filter_oos_variants`): when set, the client drops this
|
|
3900
3961
|
* tier entirely once its gift has NO in-stock eligible variant — the milestone, fill slot and gift
|
|
3901
3962
|
* controls all disappear, mirroring onsite removing the tier from `bar.tiers` before it renders. Absent
|
|
3902
3963
|
* on shipping/discount/decorative tiers and left off by default (the tier renders regardless of stock).
|
|
3903
3964
|
*/
|
|
3904
|
-
filterOosVariants:
|
|
3965
|
+
filterOosVariants: import_zod56.z.boolean().default(false),
|
|
3905
3966
|
/**
|
|
3906
3967
|
* Smart-cart product (gift) tiers only: the reward unlocked at this tier. The client enriches
|
|
3907
3968
|
* `productId`/`variantIds` to live variants (availability, price) and adds the chosen one to the cart
|
|
@@ -3909,10 +3970,10 @@ var CABProgressTier = import_zod55.z.object({
|
|
|
3909
3970
|
* tiers and on tiers with no configured product. Cart add/remove is a later stage; carried here so the
|
|
3910
3971
|
* tree is complete.
|
|
3911
3972
|
*/
|
|
3912
|
-
gift:
|
|
3913
|
-
productId:
|
|
3914
|
-
title:
|
|
3915
|
-
variantIds:
|
|
3973
|
+
gift: import_zod56.z.object({
|
|
3974
|
+
productId: import_zod56.z.number().int().positive(),
|
|
3975
|
+
title: import_zod56.z.string().optional(),
|
|
3976
|
+
variantIds: import_zod56.z.array(import_zod56.z.number().int().positive()).default(() => [])
|
|
3916
3977
|
}).optional(),
|
|
3917
3978
|
/**
|
|
3918
3979
|
* The step-row icon's square size in PIXELS (onsite `product_tier_element_size`, an admin px string the
|
|
@@ -3932,7 +3993,7 @@ var CABProgressTier = import_zod55.z.object({
|
|
|
3932
3993
|
* renderer never spells a fallback), which also makes a tree authored before this field render at
|
|
3933
3994
|
* React's size rather than the old hardcoded 20.
|
|
3934
3995
|
*/
|
|
3935
|
-
iconSizePx:
|
|
3996
|
+
iconSizePx: import_zod56.z.number().int().min(1).max(64).default(18),
|
|
3936
3997
|
/**
|
|
3937
3998
|
* The step-row label at this tier's slot (onsite `getTierLabel`): the merchant custom label, else the
|
|
3938
3999
|
* type default — 'Free Shipping' or '{n}% Discount'. A PRODUCT tier gets NO converter label: its name is
|
|
@@ -3942,35 +4003,35 @@ var CABProgressTier = import_zod55.z.object({
|
|
|
3942
4003
|
* turns a blank label into an absent key, and a client-authored blank means the same thing — the renderer
|
|
3943
4004
|
* emits no caption slot rather than an empty one). Plain text — a compact icon+label.
|
|
3944
4005
|
*/
|
|
3945
|
-
label:
|
|
4006
|
+
label: import_zod56.z.record(import_zod56.z.string(), import_zod56.z.string()).optional(),
|
|
3946
4007
|
/**
|
|
3947
4008
|
* Smart-cart product (gift) tiers only (onsite `product_tier_image`): show the gift's product image in
|
|
3948
4009
|
* the step-row slot instead of the generic bag icon. The converter can't supply the image URL (config
|
|
3949
4010
|
* carries only product IDs), so the client resolves it (authoritative Shopify featured image, React
|
|
3950
4011
|
* parity) and falls back to the bag icon when the flag is off or no image resolves. Default false.
|
|
3951
4012
|
*/
|
|
3952
|
-
productTierImage:
|
|
4013
|
+
productTierImage: import_zod56.z.boolean().default(false),
|
|
3953
4014
|
/**
|
|
3954
4015
|
* The tier's goal, measured per `unit`. `currency` (default): SHOP-currency cents — the canonical
|
|
3955
4016
|
* fallback: when the buyer's presentment currency has no entry in `thresholds`, the client
|
|
3956
4017
|
* multiplies this by the live FX rate (converter maps the v1 `unlock_price`, e.g. `75` → `7500`).
|
|
3957
4018
|
* `item`: a raw item count — no cents, no FX, no `thresholds` overrides.
|
|
3958
4019
|
*/
|
|
3959
|
-
threshold:
|
|
4020
|
+
threshold: import_zod56.z.number().int().nonnegative(),
|
|
3960
4021
|
/**
|
|
3961
4022
|
* Per-presentment-currency goal overrides — lowercased ISO currency code → cents (e.g. `{ cad: 9900 }`).
|
|
3962
4023
|
* When the buyer's currency has an entry, the client uses it verbatim INSTEAD of FX-converting
|
|
3963
4024
|
* `threshold`, so merchants show intentional, clean per-market amounts (Shopify Markets) rather than a
|
|
3964
4025
|
* converted base. Defaults to `{}` — no overrides means always fall back to `threshold`.
|
|
3965
4026
|
*/
|
|
3966
|
-
thresholds:
|
|
4027
|
+
thresholds: import_zod56.z.record(import_zod56.z.string(), import_zod56.z.number().int().nonnegative()).default(() => ({})),
|
|
3967
4028
|
/**
|
|
3968
4029
|
* Smart-cart tier identifier, mirrored onto the gift cart line's `_tier` attribute so the client can
|
|
3969
4030
|
* match an in-cart gift back to its tier (add on reach, remove on downgrade/decline). Absent on the
|
|
3970
4031
|
* shipping bar (single unlabeled tier, no gift).
|
|
3971
4032
|
*/
|
|
3972
|
-
tierId:
|
|
3973
|
-
tierType:
|
|
4033
|
+
tierId: import_zod56.z.string().optional(),
|
|
4034
|
+
tierType: import_zod56.z.enum(progressTierTypes).default(ProgressTierType.shipping),
|
|
3974
4035
|
/**
|
|
3975
4036
|
* What this tier's progress is measured in — PER TIER (onsite's `unlock_condition_type` model, NOT
|
|
3976
4037
|
* the React port's bar-level `tiers[0]` shortcut). `currency` compares money cents against the
|
|
@@ -3981,9 +4042,9 @@ var CABProgressTier = import_zod55.z.object({
|
|
|
3981
4042
|
* count carries no injected noun (no English `item`/`items` inflection on localized copy); merchant
|
|
3982
4043
|
* template text supplies grammatically-neutral wording around the token.
|
|
3983
4044
|
*/
|
|
3984
|
-
unit:
|
|
4045
|
+
unit: import_zod56.z.enum(progressTierUnits).default(ProgressTierUnit.currency)
|
|
3985
4046
|
});
|
|
3986
|
-
var CABProgressBarSection =
|
|
4047
|
+
var CABProgressBarSection = import_zod56.z.lazy(
|
|
3987
4048
|
() => CABLayoutSection.omit({ sectionType: true }).extend({
|
|
3988
4049
|
/**
|
|
3989
4050
|
* The onsite bar id (smart-cart TPB bars only). The client mirrors it to the cart's `_barId` attribute
|
|
@@ -3992,35 +4053,35 @@ var CABProgressBarSection = import_zod55.z.lazy(
|
|
|
3992
4053
|
* checkout reaches the extension without it, so the client writes it or the tier gift's 100% discount
|
|
3993
4054
|
* (and any tier order discount) never applies. Absent on the v1 shipping bar (no gift tiers, no id).
|
|
3994
4055
|
*/
|
|
3995
|
-
barId:
|
|
4056
|
+
barId: import_zod56.z.string().optional(),
|
|
3996
4057
|
/** Empty = shown everywhere; otherwise uppercase ISO country codes. */
|
|
3997
|
-
countryCodes:
|
|
4058
|
+
countryCodes: import_zod56.z.array(import_zod56.z.string().transform((code) => code.trim().toUpperCase())).default(() => []),
|
|
3998
4059
|
/**
|
|
3999
4060
|
* Uppercase ISO codes where a higher-precedence geo bar applies, so this (default, non-geo) bar is
|
|
4000
4061
|
* hidden there — replicates React `getbar`'s geo-match-over-default precedence. Empty = never excluded.
|
|
4001
4062
|
*/
|
|
4002
|
-
excludeCountryCodes:
|
|
4063
|
+
excludeCountryCodes: import_zod56.z.array(import_zod56.z.string().transform((code) => code.trim().toUpperCase())).default(() => []),
|
|
4003
4064
|
/**
|
|
4004
4065
|
* Measure progress against the PRE-discount subtotal (onsite `exclude_discount_in_subtotal`, and
|
|
4005
4066
|
* forced on for bars with a discount tier so its own reward can't un-reach the tier). The client
|
|
4006
4067
|
* adds the cart's discount allocations back to the live subtotal.
|
|
4007
4068
|
*/
|
|
4008
|
-
excludeDiscountInSubtotal:
|
|
4069
|
+
excludeDiscountInSubtotal: import_zod56.z.boolean().default(false),
|
|
4009
4070
|
/** Variant ids the client subtracts from the adjusted subtotal (React `bar.excluded_products`). */
|
|
4010
|
-
excludedVariantIds:
|
|
4071
|
+
excludedVariantIds: import_zod56.z.array(import_zod56.z.number().int().positive()).default(() => []),
|
|
4011
4072
|
/**
|
|
4012
4073
|
* When the cart holds a subscription item, treat the bar as reached regardless of subtotal (React
|
|
4013
4074
|
* `free_shipping_on_subscription(s)`). `freeShippingOnAll` is already a zero-threshold tier instead.
|
|
4014
4075
|
*/
|
|
4015
|
-
freeShippingOnSubscription:
|
|
4076
|
+
freeShippingOnSubscription: import_zod56.z.boolean().default(false),
|
|
4016
4077
|
/** Localized heading over the gift controls (onsite `gift_area_title`, default 'FREE GIFTS'). */
|
|
4017
|
-
giftAreaTitle:
|
|
4078
|
+
giftAreaTitle: import_zod56.z.record(import_zod56.z.string(), import_zod56.z.string()).default(() => ({ en: "FREE GIFTS" })),
|
|
4018
4079
|
/** Localized gift-control labels (add/remove/heading); a tier's gift `title` beats `yourGift`. */
|
|
4019
|
-
giftLabels:
|
|
4020
|
-
addGift:
|
|
4021
|
-
remove:
|
|
4022
|
-
selectOptions:
|
|
4023
|
-
yourGift:
|
|
4080
|
+
giftLabels: import_zod56.z.object({
|
|
4081
|
+
addGift: import_zod56.z.record(import_zod56.z.string(), import_zod56.z.string()).default(() => ({ ...GIFT_LABELS.addGift })),
|
|
4082
|
+
remove: import_zod56.z.record(import_zod56.z.string(), import_zod56.z.string()).default(() => ({ ...GIFT_LABELS.remove })),
|
|
4083
|
+
selectOptions: import_zod56.z.record(import_zod56.z.string(), import_zod56.z.string()).default(() => ({ ...GIFT_LABELS.selectOptions })),
|
|
4084
|
+
yourGift: import_zod56.z.record(import_zod56.z.string(), import_zod56.z.string()).default(() => ({ ...GIFT_LABELS.yourGift }))
|
|
4024
4085
|
}).default(() => ({
|
|
4025
4086
|
addGift: { ...GIFT_LABELS.addGift },
|
|
4026
4087
|
remove: { ...GIFT_LABELS.remove },
|
|
@@ -4028,38 +4089,38 @@ var CABProgressBarSection = import_zod55.z.lazy(
|
|
|
4028
4089
|
yourGift: { ...GIFT_LABELS.yourGift }
|
|
4029
4090
|
})),
|
|
4030
4091
|
/** The bar's a11y label; the merchant names it in the editor, else this default (React parity). */
|
|
4031
|
-
name:
|
|
4092
|
+
name: import_zod56.z.string().default("Order progress"),
|
|
4032
4093
|
/**
|
|
4033
4094
|
* Bar fill color. An explicit (widget-authored) value is used verbatim; when absent the server
|
|
4034
4095
|
* fills it with the live shop theme's `buttonBackground` (React `useRebuyTheme` parity). Still
|
|
4035
4096
|
* absent after that ⇒ the theme fetch failed and the client renders its platform-default bar —
|
|
4036
4097
|
* optional, not defaulted, so "merchant chose no color" stays distinguishable from any real value.
|
|
4037
4098
|
*/
|
|
4038
|
-
progressColor:
|
|
4039
|
-
sectionType:
|
|
4099
|
+
progressColor: import_zod56.z.string().optional(),
|
|
4100
|
+
sectionType: import_zod56.z.literal(SectionType.progressBar).default(SectionType.progressBar),
|
|
4040
4101
|
/**
|
|
4041
4102
|
* The bar's milestones in the merchant's CONFIGURED order — the renderer does NOT sort them (022
|
|
4042
4103
|
* O-B2: sorting by resolved threshold reversed configured milestones on out-of-order or mixed-unit
|
|
4043
4104
|
* count-vs-cents bars). Drives the fill (even slot per tier) and, for smart-cart product tiers, the
|
|
4044
4105
|
* gift add/remove. The visual tier display lives in `sections` (composable), NOT here.
|
|
4045
4106
|
*/
|
|
4046
|
-
tiers:
|
|
4107
|
+
tiers: import_zod56.z.union([import_zod56.z.array(CABProgressTier), import_zod56.z.strictObject({}).transform(() => [])]).default(() => [])
|
|
4047
4108
|
})
|
|
4048
4109
|
);
|
|
4049
4110
|
|
|
4050
4111
|
// src/schema/widgets/checkout-and-beyond/quantity.ts
|
|
4051
4112
|
var import_uuid11 = require("uuid");
|
|
4052
|
-
var
|
|
4053
|
-
var CABQuantitySection =
|
|
4113
|
+
var import_zod57 = require("zod");
|
|
4114
|
+
var CABQuantitySection = import_zod57.z.object({
|
|
4054
4115
|
...CABVariableFields,
|
|
4055
|
-
errorMessages:
|
|
4056
|
-
|
|
4057
|
-
|
|
4116
|
+
errorMessages: import_zod57.z.record(
|
|
4117
|
+
import_zod57.z.string(),
|
|
4118
|
+
import_zod57.z.object({
|
|
4058
4119
|
/** `{{step}}` is interpolated at render — the off-increment message React never gave a merchant key. */
|
|
4059
|
-
increment:
|
|
4060
|
-
max:
|
|
4061
|
-
min:
|
|
4062
|
-
neg:
|
|
4120
|
+
increment: import_zod57.z.string().optional(),
|
|
4121
|
+
max: import_zod57.z.string().optional(),
|
|
4122
|
+
min: import_zod57.z.string().optional(),
|
|
4123
|
+
neg: import_zod57.z.string().optional()
|
|
4063
4124
|
})
|
|
4064
4125
|
).default({
|
|
4065
4126
|
en: {
|
|
@@ -4069,18 +4130,18 @@ var CABQuantitySection = import_zod56.z.object({
|
|
|
4069
4130
|
neg: "Quantity cannot be negative"
|
|
4070
4131
|
}
|
|
4071
4132
|
}),
|
|
4072
|
-
inputType:
|
|
4073
|
-
max:
|
|
4074
|
-
min:
|
|
4133
|
+
inputType: import_zod57.z.enum(quantityInputs).default(QuantityInput.select),
|
|
4134
|
+
max: import_zod57.z.number().min(1).max(100).default(10),
|
|
4135
|
+
min: import_zod57.z.number().min(1).default(1),
|
|
4075
4136
|
/** The a11y label for the quantity control; the merchant names it in the editor, else this default. */
|
|
4076
|
-
name:
|
|
4077
|
-
sectionId:
|
|
4078
|
-
sectionType:
|
|
4137
|
+
name: import_zod57.z.string().default("Quantity"),
|
|
4138
|
+
sectionId: import_zod57.z.uuid().default(() => (0, import_uuid11.v7)()),
|
|
4139
|
+
sectionType: import_zod57.z.literal(SectionType.quantity).default(SectionType.quantity)
|
|
4079
4140
|
});
|
|
4080
4141
|
|
|
4081
4142
|
// src/schema/widgets/checkout-and-beyond/reviews.ts
|
|
4082
4143
|
var import_uuid12 = require("uuid");
|
|
4083
|
-
var
|
|
4144
|
+
var import_zod58 = require("zod");
|
|
4084
4145
|
|
|
4085
4146
|
// src/schema/widgets/checkout-and-beyond/reviewLabels.ts
|
|
4086
4147
|
var REVIEW_LABELS = {
|
|
@@ -4143,68 +4204,68 @@ var REVIEW_LABELS = {
|
|
|
4143
4204
|
};
|
|
4144
4205
|
|
|
4145
4206
|
// src/schema/widgets/checkout-and-beyond/reviews.ts
|
|
4146
|
-
var CABReviewsSection =
|
|
4207
|
+
var CABReviewsSection = import_zod58.z.object({
|
|
4147
4208
|
...CABVariableFields,
|
|
4148
|
-
color:
|
|
4209
|
+
color: import_zod58.z.string().default("#fadb14"),
|
|
4149
4210
|
/**
|
|
4150
4211
|
* Localized review-count templates (`{{reviewCount}}`), one/other plural forms; the client picks the
|
|
4151
4212
|
* form via `Intl.PluralRules`. Defaults here (schema-first) so every tree localizes without converter
|
|
4152
4213
|
* or merchant work.
|
|
4153
4214
|
*/
|
|
4154
|
-
countLabels:
|
|
4155
|
-
one:
|
|
4156
|
-
other:
|
|
4215
|
+
countLabels: import_zod58.z.object({
|
|
4216
|
+
one: import_zod58.z.record(import_zod58.z.string(), import_zod58.z.string()).default(() => ({ ...REVIEW_LABELS.one })),
|
|
4217
|
+
other: import_zod58.z.record(import_zod58.z.string(), import_zod58.z.string()).default(() => ({ ...REVIEW_LABELS.other }))
|
|
4157
4218
|
}).default(() => ({ one: { ...REVIEW_LABELS.one }, other: { ...REVIEW_LABELS.other } })),
|
|
4158
|
-
name:
|
|
4159
|
-
sectionId:
|
|
4160
|
-
sectionType:
|
|
4161
|
-
size:
|
|
4219
|
+
name: import_zod58.z.string().optional(),
|
|
4220
|
+
sectionId: import_zod58.z.uuid().default(() => (0, import_uuid12.v7)()),
|
|
4221
|
+
sectionType: import_zod58.z.literal(SectionType.reviews).default(SectionType.reviews),
|
|
4222
|
+
size: import_zod58.z.enum(reviewsSizes).default(ReviewsSize.default),
|
|
4162
4223
|
/**
|
|
4163
4224
|
* Star outline color, interpolated into a style by the renderer, so it is hex-constrained like
|
|
4164
4225
|
* `CABButtonSection.color`. The legacy source (`PostPurchaseSettings.styles.starStrokeColor`) is a free
|
|
4165
4226
|
* string: its converter must validate and fall back to this default rather than let one odd value drop
|
|
4166
4227
|
* the whole reviews section.
|
|
4167
4228
|
*/
|
|
4168
|
-
strokeColor:
|
|
4229
|
+
strokeColor: import_zod58.z.string().regex(HEX_COLOR_REGEX).default("#fadb14"),
|
|
4169
4230
|
/** Star outline width in px; `0` draws no outline. The legacy `styles.strokeWidth` is a STRING ('1') — its converter coerces. */
|
|
4170
|
-
strokeWidth:
|
|
4231
|
+
strokeWidth: import_zod58.z.number().nonnegative().default(0)
|
|
4171
4232
|
});
|
|
4172
4233
|
|
|
4173
4234
|
// src/schema/widgets/checkout-and-beyond/separator.ts
|
|
4174
4235
|
var import_uuid13 = require("uuid");
|
|
4175
|
-
var
|
|
4176
|
-
var CABSeparatorSection =
|
|
4236
|
+
var import_zod59 = require("zod");
|
|
4237
|
+
var CABSeparatorSection = import_zod59.z.object({
|
|
4177
4238
|
...CABVariableFields,
|
|
4178
|
-
sectionId:
|
|
4179
|
-
sectionType:
|
|
4239
|
+
sectionId: import_zod59.z.uuid().default(() => (0, import_uuid13.v7)()),
|
|
4240
|
+
sectionType: import_zod59.z.literal(SectionType.separator).default(SectionType.separator)
|
|
4180
4241
|
});
|
|
4181
4242
|
|
|
4182
4243
|
// src/schema/widgets/checkout-and-beyond/variants.ts
|
|
4183
4244
|
var import_compat5 = require("es-toolkit/compat");
|
|
4184
4245
|
var import_uuid14 = require("uuid");
|
|
4185
|
-
var
|
|
4186
|
-
var CABVariantsSection =
|
|
4246
|
+
var import_zod60 = require("zod");
|
|
4247
|
+
var CABVariantsSection = import_zod60.z.object({
|
|
4187
4248
|
...CABVariableFields,
|
|
4188
|
-
hideOutOfStockVariants:
|
|
4189
|
-
name:
|
|
4190
|
-
sectionId:
|
|
4191
|
-
sectionType:
|
|
4192
|
-
selector:
|
|
4193
|
-
variantMode:
|
|
4249
|
+
hideOutOfStockVariants: import_zod60.z.boolean().default(false),
|
|
4250
|
+
name: import_zod60.z.string().optional(),
|
|
4251
|
+
sectionId: import_zod60.z.uuid().default(() => (0, import_uuid14.v7)()),
|
|
4252
|
+
sectionType: import_zod60.z.literal(SectionType.variants).default(SectionType.variants),
|
|
4253
|
+
selector: import_zod60.z.enum((0, import_compat5.slice)(variantSelectors, 0, 3)).default(VariantSelector.menu),
|
|
4254
|
+
variantMode: import_zod60.z.enum(variantModes).default(VariantMode.multiple)
|
|
4194
4255
|
});
|
|
4195
4256
|
|
|
4196
4257
|
// src/schema/widgets/checkout-and-beyond/shared.ts
|
|
4197
|
-
var CABBorder =
|
|
4198
|
-
radius:
|
|
4199
|
-
style:
|
|
4200
|
-
width:
|
|
4258
|
+
var CABBorder = import_zod61.z.object({
|
|
4259
|
+
radius: import_zod61.z.enum(borderRadii).default(BorderRadius.base),
|
|
4260
|
+
style: import_zod61.z.enum(borderStyles).default(BorderStyle.none),
|
|
4261
|
+
width: import_zod61.z.enum(borderWidths).default(BorderWidth.base)
|
|
4201
4262
|
}).default({
|
|
4202
4263
|
radius: BorderRadius.base,
|
|
4203
4264
|
style: BorderStyle.none,
|
|
4204
4265
|
width: BorderWidth.base
|
|
4205
4266
|
});
|
|
4206
|
-
var CABSection =
|
|
4207
|
-
() =>
|
|
4267
|
+
var CABSection = import_zod61.z.lazy(
|
|
4268
|
+
() => import_zod61.z.discriminatedUnion("sectionType", [
|
|
4208
4269
|
CABBannerSection,
|
|
4209
4270
|
CABButtonSection,
|
|
4210
4271
|
CABCarouselSection,
|
|
@@ -4227,41 +4288,41 @@ var CABSection = import_zod60.z.lazy(
|
|
|
4227
4288
|
);
|
|
4228
4289
|
|
|
4229
4290
|
// src/schema/widgets/checkout-and-beyond/layout.ts
|
|
4230
|
-
var GridItem =
|
|
4231
|
-
var CABLayoutWrapping =
|
|
4232
|
-
breakAt:
|
|
4233
|
-
maxPerLine:
|
|
4291
|
+
var GridItem = import_zod62.z.union([import_zod62.z.literal("auto"), import_zod62.z.literal("fill"), import_zod62.z.string().regex(/^\d+%$/), import_zod62.z.number()]);
|
|
4292
|
+
var CABLayoutWrapping = import_zod62.z.object({
|
|
4293
|
+
breakAt: import_zod62.z.number().positive(),
|
|
4294
|
+
maxPerLine: import_zod62.z.number().int().positive()
|
|
4234
4295
|
});
|
|
4235
|
-
var CABLayoutSection =
|
|
4296
|
+
var CABLayoutSection = import_zod62.z.object({
|
|
4236
4297
|
...CABVariableFields,
|
|
4237
|
-
alignment:
|
|
4238
|
-
horizontal:
|
|
4239
|
-
vertical:
|
|
4298
|
+
alignment: import_zod62.z.object({
|
|
4299
|
+
horizontal: import_zod62.z.enum(horizontalAlignments).default(HorizontalAlignment.start),
|
|
4300
|
+
vertical: import_zod62.z.enum(verticalAlignments).default(VerticalAlignment.top)
|
|
4240
4301
|
}).default({
|
|
4241
4302
|
horizontal: HorizontalAlignment.start,
|
|
4242
4303
|
vertical: VerticalAlignment.top
|
|
4243
4304
|
}),
|
|
4244
|
-
border:
|
|
4245
|
-
buttonField:
|
|
4246
|
-
direction:
|
|
4305
|
+
border: import_zod62.z.lazy(() => CABBorder),
|
|
4306
|
+
buttonField: import_zod62.z.enum(buttonFields).optional(),
|
|
4307
|
+
direction: import_zod62.z.enum(directions).default(Direction.rows),
|
|
4247
4308
|
/**
|
|
4248
4309
|
* Platform chrome around the section, not a layout behavior: `callout` is a subdued box with block borders
|
|
4249
4310
|
* (the legacy post-purchase callout banner), `offer-content` the post-purchase offer's own content card.
|
|
4250
4311
|
*/
|
|
4251
|
-
frame:
|
|
4252
|
-
grid:
|
|
4253
|
-
columns:
|
|
4254
|
-
rows:
|
|
4312
|
+
frame: import_zod62.z.enum(layoutFrames).optional(),
|
|
4313
|
+
grid: import_zod62.z.object({
|
|
4314
|
+
columns: import_zod62.z.union([import_zod62.z.array(GridItem), import_zod62.z.undefined()]).default(() => ["auto"]),
|
|
4315
|
+
rows: import_zod62.z.union([import_zod62.z.array(GridItem), import_zod62.z.undefined()]).default(() => ["auto"])
|
|
4255
4316
|
}).default({ columns: ["auto"], rows: ["auto"] }).optional(),
|
|
4256
|
-
name:
|
|
4257
|
-
padding:
|
|
4258
|
-
sectionId:
|
|
4259
|
-
sections:
|
|
4260
|
-
sectionType:
|
|
4261
|
-
spacing:
|
|
4317
|
+
name: import_zod62.z.string().optional(),
|
|
4318
|
+
padding: import_zod62.z.enum(spacings).default(Spacing.none),
|
|
4319
|
+
sectionId: import_zod62.z.uuid().default(() => (0, import_uuid15.v7)()),
|
|
4320
|
+
sections: import_zod62.z.union([import_zod62.z.array(import_zod62.z.lazy(() => CABSection)), import_zod62.z.strictObject({}).transform(() => [])]).default(() => []),
|
|
4321
|
+
sectionType: import_zod62.z.literal(SectionType.layout).default(SectionType.layout),
|
|
4322
|
+
spacing: import_zod62.z.enum(spacings).default(Spacing.base),
|
|
4262
4323
|
/** Fire-and-forget impression pixel POSTed once when the section is shown (e.g. a Monetize offer view). */
|
|
4263
|
-
viewUrl:
|
|
4264
|
-
width:
|
|
4324
|
+
viewUrl: import_zod62.z.string().optional(),
|
|
4325
|
+
width: import_zod62.z.number().default(100),
|
|
4265
4326
|
wrapping: CABLayoutWrapping.optional()
|
|
4266
4327
|
});
|
|
4267
4328
|
|
|
@@ -4283,8 +4344,8 @@ var UI_LABELS = {
|
|
|
4283
4344
|
};
|
|
4284
4345
|
|
|
4285
4346
|
// src/schema/widgets/checkout-and-beyond/root.ts
|
|
4286
|
-
var localized = (fallback) =>
|
|
4287
|
-
var CABUILabels =
|
|
4347
|
+
var localized = (fallback) => import_zod63.z.record(import_zod63.z.string(), import_zod63.z.string()).default(() => ({ ...fallback })).transform((labels) => Object.keys(labels).length > 0 ? labels : { ...fallback });
|
|
4348
|
+
var CABUILabels = import_zod63.z.object({
|
|
4288
4349
|
currentPage: localized(UI_LABELS.currentPage),
|
|
4289
4350
|
guest: localized(UI_LABELS.guest),
|
|
4290
4351
|
loadingOptions: localized(UI_LABELS.loadingOptions),
|
|
@@ -4309,47 +4370,48 @@ var CABUILabels = import_zod62.z.object({
|
|
|
4309
4370
|
subscriptionOptions: { ...UI_LABELS.subscriptionOptions },
|
|
4310
4371
|
updating: { ...UI_LABELS.updating }
|
|
4311
4372
|
}));
|
|
4312
|
-
var TargetArea =
|
|
4313
|
-
fill:
|
|
4314
|
-
flip:
|
|
4315
|
-
icon:
|
|
4316
|
-
label:
|
|
4317
|
-
width:
|
|
4373
|
+
var TargetArea = import_zod63.z.object({
|
|
4374
|
+
fill: import_zod63.z.boolean().optional(),
|
|
4375
|
+
flip: import_zod63.z.enum(["both", "horizontal", "vertical"]).optional(),
|
|
4376
|
+
icon: import_zod63.z.string(),
|
|
4377
|
+
label: import_zod63.z.string(),
|
|
4378
|
+
width: import_zod63.z.string()
|
|
4318
4379
|
}).default(targetAreas[EditorMode.checkoutExtension][1]);
|
|
4319
|
-
var CABTracking =
|
|
4320
|
-
enableAttribution:
|
|
4321
|
-
enableSource:
|
|
4322
|
-
enableWidget:
|
|
4380
|
+
var CABTracking = import_zod63.z.object({
|
|
4381
|
+
enableAttribution: import_zod63.z.boolean().nullish().transform((value) => value ?? true),
|
|
4382
|
+
enableSource: import_zod63.z.boolean().nullish().transform((value) => value ?? true),
|
|
4383
|
+
enableWidget: import_zod63.z.boolean().nullish().transform((value) => value ?? true)
|
|
4323
4384
|
}).nullish().transform((value) => value ?? { enableAttribution: true, enableSource: true, enableWidget: true });
|
|
4324
|
-
var CABExperiment =
|
|
4325
|
-
elementId:
|
|
4326
|
-
experimentId:
|
|
4327
|
-
experimentType:
|
|
4328
|
-
selectedId:
|
|
4385
|
+
var CABExperiment = import_zod63.z.object({
|
|
4386
|
+
elementId: import_zod63.z.number(),
|
|
4387
|
+
experimentId: import_zod63.z.number(),
|
|
4388
|
+
experimentType: import_zod63.z.string(),
|
|
4389
|
+
selectedId: import_zod63.z.number()
|
|
4329
4390
|
});
|
|
4330
4391
|
var CABRootSection = CABLayoutSection.extend({
|
|
4331
|
-
editorMode:
|
|
4392
|
+
editorMode: import_zod63.z.enum(editorModes).default(EditorMode.checkoutExtension),
|
|
4332
4393
|
experiment: CABExperiment.optional(),
|
|
4333
4394
|
// Same rule as CABTracking above: the v1 converters pass raw legacy `previewMode` through, so a
|
|
4334
4395
|
// `null` must fall back rather than throw the widget; malformed values still throw.
|
|
4335
|
-
previewMode:
|
|
4336
|
-
storeId:
|
|
4396
|
+
previewMode: import_zod63.z.boolean().nullish().transform((value) => value ?? false),
|
|
4397
|
+
storeId: import_zod63.z.number().nullable().default(null),
|
|
4337
4398
|
targetArea: TargetArea.nullable(),
|
|
4338
4399
|
tracking: CABTracking,
|
|
4339
|
-
type:
|
|
4400
|
+
type: import_zod63.z.enum(widgetTypes).default(WidgetType.ui_extension_content_block),
|
|
4340
4401
|
uiLabels: CABUILabels,
|
|
4341
|
-
version:
|
|
4342
|
-
widgetId:
|
|
4402
|
+
version: import_zod63.z.literal(2).default(2),
|
|
4403
|
+
widgetId: import_zod63.z.number().nullable().default(null)
|
|
4343
4404
|
});
|
|
4344
4405
|
|
|
4345
4406
|
// src/schema/postPurchaseProductView.ts
|
|
4346
|
-
var PostPurchaseProductView =
|
|
4347
|
-
|
|
4407
|
+
var PostPurchaseProductView = import_zod64.z.union([
|
|
4408
|
+
import_zod64.z.object({
|
|
4409
|
+
changeset: PostPurchaseProductChangeset.optional(),
|
|
4348
4410
|
groupCatalog: PostPurchaseGroupCatalog.optional(),
|
|
4349
4411
|
initialVariant: PostPurchaseVariantSelector.optional(),
|
|
4350
4412
|
planCatalog: PostPurchasePlanCatalog.nullable().optional(),
|
|
4351
4413
|
preparation: PreparedPostPurchaseProduct.extend({
|
|
4352
|
-
display: PreparedPostPurchaseProduct.shape.display.extend({ description:
|
|
4414
|
+
display: PreparedPostPurchaseProduct.shape.display.extend({ description: import_zod64.z.string().nullable() }).refine(
|
|
4353
4415
|
({ description, descriptionDocument }) => description === null === (descriptionDocument !== void 0),
|
|
4354
4416
|
"Exactly one of the plain and rich descriptions is shown"
|
|
4355
4417
|
)
|
|
@@ -4358,33 +4420,33 @@ var PostPurchaseProductView = import_zod63.z.union([
|
|
|
4358
4420
|
sections: CABRootSection,
|
|
4359
4421
|
variantCatalog: PostPurchaseVariantCatalog.optional()
|
|
4360
4422
|
}),
|
|
4361
|
-
|
|
4423
|
+
import_zod64.z.object({
|
|
4362
4424
|
groupCatalog: PostPurchaseGroupCatalog.optional(),
|
|
4363
4425
|
initialVariant: PostPurchaseVariantSelector.optional(),
|
|
4364
4426
|
planCatalog: PostPurchasePlanCatalog.nullable().optional(),
|
|
4365
4427
|
preparation: PostPurchasePreparation.options[1],
|
|
4366
4428
|
purchaseOptions: PostPurchaseOptions.optional(),
|
|
4367
|
-
sections:
|
|
4429
|
+
sections: import_zod64.z.null(),
|
|
4368
4430
|
variantCatalog: PostPurchaseVariantCatalog.optional()
|
|
4369
4431
|
})
|
|
4370
4432
|
]);
|
|
4371
4433
|
|
|
4372
4434
|
// src/schema/postPurchaseProductCollectionView.ts
|
|
4373
|
-
var PostPurchaseProductCollectionView =
|
|
4374
|
-
members:
|
|
4375
|
-
|
|
4435
|
+
var PostPurchaseProductCollectionView = import_zod65.z.object({
|
|
4436
|
+
members: import_zod65.z.array(
|
|
4437
|
+
import_zod65.z.object({
|
|
4376
4438
|
productId: PostPurchaseProductId,
|
|
4377
|
-
productIndex:
|
|
4439
|
+
productIndex: import_zod65.z.number().int().nonnegative(),
|
|
4378
4440
|
view: PostPurchaseProductView
|
|
4379
4441
|
})
|
|
4380
4442
|
)
|
|
4381
4443
|
});
|
|
4382
|
-
var PostPurchaseCollectionChoice =
|
|
4444
|
+
var PostPurchaseCollectionChoice = import_zod65.z.object({
|
|
4383
4445
|
choice: PostPurchaseChoice.optional(),
|
|
4384
4446
|
productId: PostPurchaseProductId,
|
|
4385
4447
|
variantId: PostPurchaseVariantSelector.shape.variantId.optional()
|
|
4386
4448
|
}).strict();
|
|
4387
|
-
var PostPurchaseExcludedProductIds =
|
|
4449
|
+
var PostPurchaseExcludedProductIds = import_zod65.z.array(PostPurchaseProductId).default([]);
|
|
4388
4450
|
var PostPurchaseMemberSelector = PostPurchaseProgressSchema.shape.members.element.pick({ productId: true }).extend({ progressRevision: PostPurchaseProgressSchema.shape.revision });
|
|
4389
4451
|
var PostPurchaseMemberPointer = PostPurchaseProgressSchema.shape.members.element.omit({ status: true }).extend({
|
|
4390
4452
|
entryRevision: PostPurchaseProgressSchema.shape.entryRevision,
|
|
@@ -4397,7 +4459,7 @@ var PostPurchaseQuantityChoice = PostPurchaseCollectionChoice.extend({ quantity:
|
|
|
4397
4459
|
var PostPurchaseQuantityPolicy = PostPurchaseSettings.shape.quantityInputs.omit({ defaultQuantity: true }).extend({
|
|
4398
4460
|
initialQuantity: quantity,
|
|
4399
4461
|
maxValue: quantity,
|
|
4400
|
-
minValue:
|
|
4462
|
+
minValue: import_zod66.z.literal(0).transform(() => 1).or(quantity)
|
|
4401
4463
|
}).refine(({ maxValue, minValue }) => minValue <= maxValue, "Quantity bounds are reversed");
|
|
4402
4464
|
|
|
4403
4465
|
// src/schema/postPurchaseGroup.ts
|
|
@@ -4406,33 +4468,33 @@ var PostPurchaseGroupChoice = PostPurchaseQuantityChoice.extend({
|
|
|
4406
4468
|
});
|
|
4407
4469
|
|
|
4408
4470
|
// src/schema/postPurchaseHealth.ts
|
|
4409
|
-
var
|
|
4471
|
+
var import_zod69 = require("zod");
|
|
4410
4472
|
|
|
4411
4473
|
// src/schema/postPurchaseHealthSchedule.ts
|
|
4412
|
-
var
|
|
4474
|
+
var import_zod68 = require("zod");
|
|
4413
4475
|
|
|
4414
4476
|
// src/schema/postPurchaseReleaseSchedule.ts
|
|
4415
|
-
var
|
|
4416
|
-
var postPurchaseTaskNameSchema = (queue, id) =>
|
|
4417
|
-
var SessionReleaseScheduleRequestSchema =
|
|
4477
|
+
var import_zod67 = require("zod");
|
|
4478
|
+
var postPurchaseTaskNameSchema = (queue, id) => import_zod67.z.string().regex(new RegExp(`^projects/[a-zA-Z0-9.:-]+/locations/us-central1/queues/${queue}/tasks/${id}$`));
|
|
4479
|
+
var SessionReleaseScheduleRequestSchema = import_zod67.z.strictObject({
|
|
4418
4480
|
deadline: PostPurchaseTimestampSchema,
|
|
4419
4481
|
orderId: PostPurchaseOrderIdSchema,
|
|
4420
4482
|
releaseOwner: ReleaseOwnerSchema,
|
|
4421
4483
|
sessionId: PostPurchaseSessionIdSchema
|
|
4422
4484
|
});
|
|
4423
|
-
var SessionReleaseScheduleResponseSchema =
|
|
4424
|
-
data:
|
|
4485
|
+
var SessionReleaseScheduleResponseSchema = import_zod67.z.object({
|
|
4486
|
+
data: import_zod67.z.discriminatedUnion("status", [
|
|
4425
4487
|
SessionReleaseScheduleRequestSchema.extend({
|
|
4426
|
-
releaseOwner:
|
|
4427
|
-
status:
|
|
4488
|
+
releaseOwner: import_zod67.z.literal("rebuy"),
|
|
4489
|
+
status: import_zod67.z.literal("queued"),
|
|
4428
4490
|
taskName: postPurchaseTaskNameSchema("post-purchase-order-hold-release", "[a-f0-9]{64}-release")
|
|
4429
4491
|
}),
|
|
4430
4492
|
SessionReleaseScheduleRequestSchema.extend({
|
|
4431
|
-
releaseOwner:
|
|
4432
|
-
status:
|
|
4493
|
+
releaseOwner: import_zod67.z.literal("shopify"),
|
|
4494
|
+
status: import_zod67.z.literal("native")
|
|
4433
4495
|
})
|
|
4434
4496
|
]),
|
|
4435
|
-
successful:
|
|
4497
|
+
successful: import_zod67.z.literal(true)
|
|
4436
4498
|
});
|
|
4437
4499
|
|
|
4438
4500
|
// src/schema/postPurchaseHealthSchedule.ts
|
|
@@ -4441,15 +4503,15 @@ var PostPurchaseHealthTaskNameSchema = postPurchaseTaskNameSchema(
|
|
|
4441
4503
|
"post-purchase-health-check",
|
|
4442
4504
|
"[a-z0-9][a-z0-9-]*--[1-9][0-9]*"
|
|
4443
4505
|
);
|
|
4444
|
-
var HealthScheduleAcknowledgementSchema =
|
|
4506
|
+
var HealthScheduleAcknowledgementSchema = import_zod68.z.strictObject({
|
|
4445
4507
|
data: HealthScheduleSchema.extend({
|
|
4446
|
-
status:
|
|
4508
|
+
status: import_zod68.z.literal("queued"),
|
|
4447
4509
|
taskName: PostPurchaseHealthTaskNameSchema
|
|
4448
4510
|
}).refine(
|
|
4449
4511
|
(data) => data.taskName.endsWith(`/tasks/${postPurchaseHealthTaskId(data)}`),
|
|
4450
4512
|
"taskName must be this order's health task"
|
|
4451
4513
|
),
|
|
4452
|
-
successful:
|
|
4514
|
+
successful: import_zod68.z.literal(true)
|
|
4453
4515
|
});
|
|
4454
4516
|
|
|
4455
4517
|
// src/schema/postPurchaseHealth.ts
|
|
@@ -4458,90 +4520,90 @@ var HealthFactSchema = HealthScheduleSchema.pick({
|
|
|
4458
4520
|
operationId: true,
|
|
4459
4521
|
removePartialOrder: true
|
|
4460
4522
|
});
|
|
4461
|
-
var HealthScheduleReceiptSchema =
|
|
4523
|
+
var HealthScheduleReceiptSchema = import_zod69.z.strictObject({
|
|
4462
4524
|
recordedAt: PostPurchaseTimestampSchema,
|
|
4463
4525
|
taskName: PostPurchaseHealthTaskNameSchema
|
|
4464
4526
|
});
|
|
4465
4527
|
var StoredHealthFactSchema = HealthFactSchema.extend({ scheduleReceipt: HealthScheduleReceiptSchema.optional() });
|
|
4466
4528
|
var HealthAttemptSchema = StoredHealthFactSchema.extend({
|
|
4467
4529
|
attemptedAt: PostPurchaseTimestampSchema,
|
|
4468
|
-
attemptId:
|
|
4469
|
-
status:
|
|
4530
|
+
attemptId: import_zod69.z.uuid(),
|
|
4531
|
+
status: import_zod69.z.literal("attempted")
|
|
4470
4532
|
});
|
|
4471
4533
|
var HealthResultSchema = HealthAttemptSchema.extend({
|
|
4472
4534
|
finishedAt: PostPurchaseTimestampSchema,
|
|
4473
|
-
status:
|
|
4535
|
+
status: import_zod69.z.enum(["returned", "unknown"])
|
|
4474
4536
|
});
|
|
4475
|
-
var HealthStateSchema =
|
|
4476
|
-
StoredHealthFactSchema.extend({ status:
|
|
4537
|
+
var HealthStateSchema = import_zod69.z.union([
|
|
4538
|
+
StoredHealthFactSchema.extend({ status: import_zod69.z.literal("pending") }),
|
|
4477
4539
|
HealthAttemptSchema,
|
|
4478
4540
|
HealthResultSchema
|
|
4479
4541
|
]);
|
|
4480
4542
|
var HealthPrepareRequestSchema = DecideRequestSchema.extend({
|
|
4481
4543
|
operationId: HealthScheduleSchema.shape.operationId
|
|
4482
4544
|
}).strict();
|
|
4483
|
-
var HealthPrepareResponseSchema =
|
|
4484
|
-
var HealthClaimRequestSchema =
|
|
4545
|
+
var HealthPrepareResponseSchema = import_zod69.z.object({ data: HealthScheduleSchema, successful: import_zod69.z.literal(true) });
|
|
4546
|
+
var HealthClaimRequestSchema = import_zod69.z.strictObject({
|
|
4485
4547
|
orderId: PostPurchaseOrderIdSchema,
|
|
4486
|
-
removePartialOrder:
|
|
4548
|
+
removePartialOrder: import_zod69.z.boolean(),
|
|
4487
4549
|
shop: ShopifyDomainSchema
|
|
4488
4550
|
});
|
|
4489
4551
|
var HealthClaimFactSchema = HealthClaimRequestSchema.extend({
|
|
4490
4552
|
healthScheduledAt: HealthFactSchema.shape.healthScheduledAt
|
|
4491
4553
|
});
|
|
4492
|
-
var HealthClaimResponseSchema =
|
|
4493
|
-
data:
|
|
4494
|
-
|
|
4495
|
-
HealthClaimFactSchema.extend({ status:
|
|
4496
|
-
HealthClaimFactSchema.extend({ attemptId: HealthAttemptSchema.shape.attemptId, status:
|
|
4554
|
+
var HealthClaimResponseSchema = import_zod69.z.object({
|
|
4555
|
+
data: import_zod69.z.union([
|
|
4556
|
+
import_zod69.z.strictObject({ status: import_zod69.z.literal("missing") }),
|
|
4557
|
+
HealthClaimFactSchema.extend({ status: import_zod69.z.enum(["pending", "attempted", "returned", "unknown"]) }),
|
|
4558
|
+
HealthClaimFactSchema.extend({ attemptId: HealthAttemptSchema.shape.attemptId, status: import_zod69.z.literal("claimed") })
|
|
4497
4559
|
]),
|
|
4498
|
-
successful:
|
|
4560
|
+
successful: import_zod69.z.literal(true)
|
|
4499
4561
|
});
|
|
4500
4562
|
var HealthResultRequestSchema = HealthClaimRequestSchema.extend({
|
|
4501
4563
|
attemptId: HealthAttemptSchema.shape.attemptId,
|
|
4502
4564
|
outcome: HealthResultSchema.shape.status
|
|
4503
4565
|
});
|
|
4504
|
-
var HealthResultResponseSchema =
|
|
4566
|
+
var HealthResultResponseSchema = import_zod69.z.object({
|
|
4505
4567
|
data: HealthClaimFactSchema.extend({
|
|
4506
4568
|
finishedAt: HealthResultSchema.shape.finishedAt,
|
|
4507
4569
|
status: HealthResultSchema.shape.status
|
|
4508
4570
|
}),
|
|
4509
|
-
successful:
|
|
4571
|
+
successful: import_zod69.z.literal(true)
|
|
4510
4572
|
});
|
|
4511
4573
|
|
|
4512
4574
|
// src/schema/postPurchaseLifecycle.ts
|
|
4513
|
-
var
|
|
4514
|
-
var Presentation =
|
|
4575
|
+
var import_zod70 = require("zod");
|
|
4576
|
+
var Presentation = import_zod70.z.strictObject({
|
|
4515
4577
|
member: PostPurchaseMemberIdentity,
|
|
4516
4578
|
selectedProductId: PostPurchaseMemberIdentity.shape.productId.optional(),
|
|
4517
4579
|
variant: PostPurchaseVariantSelector
|
|
4518
4580
|
});
|
|
4519
4581
|
var LifecycleObservationRequestSchema = DecideRequestSchema.extend({
|
|
4520
4582
|
entryRevision: PostPurchaseProgressSchema.shape.entryRevision,
|
|
4521
|
-
eventType:
|
|
4583
|
+
eventType: import_zod70.z.enum(["OFFER_VIEWED", "OFFER_TIMER_EXPIRED"]),
|
|
4522
4584
|
presentation: Presentation.nullable(),
|
|
4523
4585
|
progressRevision: PostPurchaseProgressSchema.shape.revision,
|
|
4524
|
-
requestId:
|
|
4586
|
+
requestId: import_zod70.z.uuid()
|
|
4525
4587
|
}).strict().refine(
|
|
4526
4588
|
({ eventType, presentation }) => eventType !== "OFFER_VIEWED" || presentation !== null,
|
|
4527
4589
|
"Viewed observations require a presented product"
|
|
4528
4590
|
);
|
|
4529
|
-
var LifecycleObservationResponseSchema =
|
|
4530
|
-
data:
|
|
4591
|
+
var LifecycleObservationResponseSchema = import_zod70.z.object({
|
|
4592
|
+
data: import_zod70.z.strictObject({
|
|
4531
4593
|
requestId: LifecycleObservationRequestSchema.shape.requestId,
|
|
4532
|
-
status:
|
|
4594
|
+
status: import_zod70.z.union([AcceptedEventOutcomeSchema, import_zod70.z.literal("unavailable")])
|
|
4533
4595
|
}),
|
|
4534
|
-
successful:
|
|
4596
|
+
successful: import_zod70.z.literal(true)
|
|
4535
4597
|
});
|
|
4536
4598
|
|
|
4537
4599
|
// src/schema/postPurchaseOffer.ts
|
|
4538
|
-
var
|
|
4600
|
+
var import_zod72 = require("zod");
|
|
4539
4601
|
|
|
4540
4602
|
// src/schema/postPurchaseSkipTrace.ts
|
|
4541
|
-
var
|
|
4603
|
+
var import_zod71 = require("zod");
|
|
4542
4604
|
var POST_PURCHASE_SKIP_LIMIT = 32;
|
|
4543
|
-
var PostPurchaseSkipTraceSchema =
|
|
4544
|
-
|
|
4605
|
+
var PostPurchaseSkipTraceSchema = import_zod71.z.array(
|
|
4606
|
+
import_zod71.z.object({
|
|
4545
4607
|
entry: DecisionEntrySchema,
|
|
4546
4608
|
reason: PostPurchaseSkipReasonSchema
|
|
4547
4609
|
})
|
|
@@ -4549,66 +4611,66 @@ var PostPurchaseSkipTraceSchema = import_zod70.z.array(
|
|
|
4549
4611
|
|
|
4550
4612
|
// src/schema/postPurchaseOffer.ts
|
|
4551
4613
|
var OfferPreparationRequestSchema = DecideRequestSchema.strict();
|
|
4552
|
-
var OfferPreparationResponseSchema =
|
|
4553
|
-
data:
|
|
4554
|
-
successful:
|
|
4614
|
+
var OfferPreparationResponseSchema = import_zod72.z.object({
|
|
4615
|
+
data: import_zod72.z.object({ attemptedSkips: PostPurchaseSkipTraceSchema.optional(), progress: PostPurchaseProgressSchema }),
|
|
4616
|
+
successful: import_zod72.z.literal(true)
|
|
4555
4617
|
});
|
|
4556
4618
|
|
|
4557
4619
|
// src/schema/postPurchaseOfferEligibility.ts
|
|
4558
|
-
var
|
|
4559
|
-
var
|
|
4560
|
-
var PostPurchaseOfferSkipReason =
|
|
4561
|
-
var PostPurchaseOfferEligibilityContext =
|
|
4620
|
+
var import_zod73 = require("zod");
|
|
4621
|
+
var selection2 = PreparedPostPurchaseProduct.shape.selection;
|
|
4622
|
+
var PostPurchaseOfferSkipReason = import_zod73.z.enum(["empty", "no-eligible-subscription"]);
|
|
4623
|
+
var PostPurchaseOfferEligibilityContext = import_zod73.z.object({
|
|
4562
4624
|
excludedProductIds: PostPurchaseExcludedProductIds,
|
|
4563
|
-
originalLineItems:
|
|
4625
|
+
originalLineItems: import_zod73.z.array(selection2.pick({ productId: true, sellingPlanId: true, variantId: true }))
|
|
4564
4626
|
});
|
|
4565
|
-
var PostPurchaseOfferEligibility =
|
|
4566
|
-
|
|
4567
|
-
members:
|
|
4568
|
-
|
|
4627
|
+
var PostPurchaseOfferEligibility = import_zod73.z.discriminatedUnion("status", [
|
|
4628
|
+
import_zod73.z.object({
|
|
4629
|
+
members: import_zod73.z.array(
|
|
4630
|
+
import_zod73.z.object({ productId: selection2.shape.productId, productIndex: import_zod73.z.number().int().nonnegative() })
|
|
4569
4631
|
),
|
|
4570
|
-
status:
|
|
4632
|
+
status: import_zod73.z.literal("retain")
|
|
4571
4633
|
}),
|
|
4572
|
-
|
|
4573
|
-
|
|
4634
|
+
import_zod73.z.object({ reason: PostPurchaseOfferSkipReason, status: import_zod73.z.literal("skip") }),
|
|
4635
|
+
import_zod73.z.object({ reason: import_zod73.z.literal("eligible-upgrade").optional(), status: import_zod73.z.literal("unavailable") })
|
|
4574
4636
|
]);
|
|
4575
4637
|
|
|
4576
4638
|
// src/schema/postPurchaseOfferPresentation.ts
|
|
4577
|
-
var
|
|
4639
|
+
var import_zod74 = require("zod");
|
|
4578
4640
|
var language2 = PostPurchaseSettings.shape.language.shape.global.unwrap().unwrap();
|
|
4579
|
-
var PostPurchaseOfferPresentation =
|
|
4641
|
+
var PostPurchaseOfferPresentation = import_zod74.z.strictObject({
|
|
4580
4642
|
labels: language2.pick({ declineAll: true, declineThisOffer: true }),
|
|
4581
4643
|
layout: PostPurchaseSettings.shape.offersLayout,
|
|
4582
4644
|
sections: CABRootSection.nullable(),
|
|
4583
4645
|
showDeclineAll: PostPurchaseSettings.shape.productOptions.shape.showDeclineAll
|
|
4584
4646
|
});
|
|
4585
4647
|
var OfferPresentationRequestSchema = DecideRequestSchema.strict();
|
|
4586
|
-
var OfferPresentationResponseSchema =
|
|
4587
|
-
data:
|
|
4648
|
+
var OfferPresentationResponseSchema = import_zod74.z.object({
|
|
4649
|
+
data: import_zod74.z.strictObject({
|
|
4588
4650
|
presentation: PostPurchaseOfferPresentation.nullable(),
|
|
4589
4651
|
progress: PostPurchaseProgressSchema.nullable(),
|
|
4590
4652
|
serverNow: PostPurchaseTimestampSchema
|
|
4591
4653
|
}),
|
|
4592
|
-
successful:
|
|
4654
|
+
successful: import_zod74.z.literal(true)
|
|
4593
4655
|
});
|
|
4594
4656
|
|
|
4595
4657
|
// src/schema/postPurchaseOrderDecision.ts
|
|
4596
|
-
var
|
|
4597
|
-
var OrderDecisionSchema =
|
|
4598
|
-
|
|
4599
|
-
|
|
4658
|
+
var import_zod75 = require("zod");
|
|
4659
|
+
var OrderDecisionSchema = import_zod75.z.discriminatedUnion("owner", [
|
|
4660
|
+
import_zod75.z.object({ owner: import_zod75.z.literal("session"), sessionId: PostPurchaseSessionIdSchema }),
|
|
4661
|
+
import_zod75.z.object({ owner: import_zod75.z.literal("release"), sessionId: import_zod75.z.null() })
|
|
4600
4662
|
]);
|
|
4601
4663
|
|
|
4602
4664
|
// src/schema/postPurchasePolicy.ts
|
|
4603
|
-
var
|
|
4604
|
-
var HoldSettingSchema =
|
|
4605
|
-
|
|
4606
|
-
|
|
4665
|
+
var import_zod76 = require("zod");
|
|
4666
|
+
var HoldSettingSchema = import_zod76.z.discriminatedUnion("enabled", [
|
|
4667
|
+
import_zod76.z.object({ durationMinutes: import_zod76.z.number().int().min(1).max(60), enabled: import_zod76.z.literal(true) }),
|
|
4668
|
+
import_zod76.z.object({ durationMinutes: import_zod76.z.null(), enabled: import_zod76.z.literal(false) })
|
|
4607
4669
|
]);
|
|
4608
|
-
var TimingSettingsSchema =
|
|
4670
|
+
var TimingSettingsSchema = import_zod76.z.object({ flowHold: HoldSettingSchema, shopHold: HoldSettingSchema });
|
|
4609
4671
|
var SessionPolicySchema = TimingSettingsSchema.extend({
|
|
4610
|
-
durationMinutes:
|
|
4611
|
-
source:
|
|
4672
|
+
durationMinutes: import_zod76.z.number().int().min(1).max(60).nullable(),
|
|
4673
|
+
source: import_zod76.z.enum(["shop", "flow", "native"])
|
|
4612
4674
|
}).refine(
|
|
4613
4675
|
(policy) => {
|
|
4614
4676
|
const expectedSource = policy.shopHold.enabled ? "shop" : policy.flowHold.enabled ? "flow" : "native";
|
|
@@ -4622,8 +4684,8 @@ var SessionPolicySchema = TimingSettingsSchema.extend({
|
|
|
4622
4684
|
);
|
|
4623
4685
|
|
|
4624
4686
|
// src/schema/postPurchasePreparationOptions.ts
|
|
4625
|
-
var
|
|
4626
|
-
var PostPurchasePreparationOptions =
|
|
4687
|
+
var import_zod77 = require("zod");
|
|
4688
|
+
var PostPurchasePreparationOptions = import_zod77.z.object({
|
|
4627
4689
|
choice: PostPurchaseChoice.optional(),
|
|
4628
4690
|
member: PostPurchaseMemberSelector.strict().optional(),
|
|
4629
4691
|
quantity: PreparedPostPurchaseProduct.shape.selection.shape.quantity.optional(),
|
|
@@ -4635,8 +4697,8 @@ var PostPurchasePreparationOptions = import_zod76.z.object({
|
|
|
4635
4697
|
);
|
|
4636
4698
|
|
|
4637
4699
|
// src/schema/postPurchaseProductSettings.ts
|
|
4638
|
-
var
|
|
4639
|
-
var amount =
|
|
4700
|
+
var import_zod78 = require("zod");
|
|
4701
|
+
var amount = import_zod78.z.union([import_zod78.z.number().nonnegative(), PostPurchaseAmount.transform(Number)]);
|
|
4640
4702
|
var PostPurchaseProductSettings = PostPurchaseSettings.pick({
|
|
4641
4703
|
discountedFrom: true,
|
|
4642
4704
|
language: true,
|
|
@@ -4648,62 +4710,66 @@ var PostPurchaseProductSettings = PostPurchaseSettings.pick({
|
|
|
4648
4710
|
subscriptionIsDefault: true,
|
|
4649
4711
|
upgradeToSubscription: true
|
|
4650
4712
|
}).extend({
|
|
4651
|
-
advance:
|
|
4652
|
-
blocks:
|
|
4713
|
+
advance: import_zod78.z.unknown().default({}),
|
|
4714
|
+
blocks: import_zod78.z.array(import_zod78.z.unknown()).optional(),
|
|
4653
4715
|
discount: PostPurchaseSettings.shape.discount.extend({ amount: amount.default(30) }),
|
|
4654
|
-
integrations:
|
|
4716
|
+
integrations: import_zod78.z.unknown().default({}),
|
|
4655
4717
|
shipping: PostPurchaseSettings.shape.shipping.extend({ amount: amount.default(10) }),
|
|
4656
|
-
styles:
|
|
4718
|
+
styles: import_zod78.z.unknown().default({}),
|
|
4657
4719
|
subImages: PostPurchaseSettings.shape.subImages.catch(null),
|
|
4658
|
-
subscription:
|
|
4720
|
+
subscription: import_zod78.z.unknown().default(PostPurchaseSettings.shape.subscription.parse(void 0))
|
|
4659
4721
|
});
|
|
4660
4722
|
|
|
4661
4723
|
// src/schema/postPurchaseRecovery.ts
|
|
4662
|
-
var
|
|
4724
|
+
var import_zod79 = require("zod");
|
|
4663
4725
|
var PurchaseRecoveryRequestSchema = DecideRequestSchema.strict();
|
|
4664
|
-
var PurchaseRecoveryResponseSchema =
|
|
4665
|
-
data:
|
|
4666
|
-
operation:
|
|
4726
|
+
var PurchaseRecoveryResponseSchema = import_zod79.z.object({
|
|
4727
|
+
data: import_zod79.z.object({
|
|
4728
|
+
operation: import_zod79.z.object({
|
|
4667
4729
|
observation: RecordedPurchaseObservationSchema.nullable(),
|
|
4668
|
-
operationId: PurchaseReceiptSchema.shape.operationId
|
|
4669
|
-
|
|
4730
|
+
operationId: PurchaseReceiptSchema.shape.operationId,
|
|
4731
|
+
upgrade: UpgradeProgressSchema.optional()
|
|
4732
|
+
}).strict().refine(({ operationId, upgrade }) => !upgrade || upgrade.operationId === operationId, {
|
|
4733
|
+
message: "Upgrade progress belongs to its operation",
|
|
4734
|
+
path: ["upgrade", "operationId"]
|
|
4735
|
+
}).nullable(),
|
|
4670
4736
|
progress: PostPurchaseProgressSchema.nullable().optional()
|
|
4671
4737
|
}),
|
|
4672
|
-
successful:
|
|
4738
|
+
successful: import_zod79.z.literal(true)
|
|
4673
4739
|
});
|
|
4674
4740
|
|
|
4675
4741
|
// src/schema/postPurchaseReleaseClaim.ts
|
|
4676
|
-
var
|
|
4742
|
+
var import_zod80 = require("zod");
|
|
4677
4743
|
var ReleaseClaimRequestSchema = ReleaseAuthorityRequestSchema;
|
|
4678
|
-
var ReleaseClaimResponseSchema =
|
|
4679
|
-
data:
|
|
4680
|
-
|
|
4744
|
+
var ReleaseClaimResponseSchema = import_zod80.z.object({
|
|
4745
|
+
data: import_zod80.z.discriminatedUnion("status", [
|
|
4746
|
+
import_zod80.z.object({ status: import_zod80.z.literal("release-permitted") }),
|
|
4681
4747
|
PendingReleaseAuthoritySchema,
|
|
4682
4748
|
ReadyReleaseAuthoritySchema
|
|
4683
4749
|
]),
|
|
4684
|
-
successful:
|
|
4750
|
+
successful: import_zod80.z.literal(true)
|
|
4685
4751
|
});
|
|
4686
4752
|
|
|
4687
4753
|
// src/schema/postPurchaseSelection.ts
|
|
4688
|
-
var
|
|
4754
|
+
var import_zod81 = require("zod");
|
|
4689
4755
|
var SelectionClaimsSchema = DecideRequestSchema.extend({
|
|
4690
4756
|
appId: PostPurchaseAppIdSchema,
|
|
4691
4757
|
entry: DecisionEntrySchema,
|
|
4692
|
-
iss:
|
|
4693
|
-
purpose:
|
|
4758
|
+
iss: import_zod81.z.literal("rebuy-api"),
|
|
4759
|
+
purpose: import_zod81.z.literal("post-purchase-selection")
|
|
4694
4760
|
});
|
|
4695
4761
|
var SessionStartRequestSchema = DecideRequestSchema.extend({
|
|
4696
|
-
selectionToken:
|
|
4762
|
+
selectionToken: import_zod81.z.string().min(1).max(8192).optional()
|
|
4697
4763
|
}).strict();
|
|
4698
4764
|
|
|
4699
4765
|
// src/schema/postPurchaseSession.ts
|
|
4700
|
-
var
|
|
4766
|
+
var import_zod82 = require("zod");
|
|
4701
4767
|
var SessionIdentitySchema = DecideRequestSchema.extend({ appId: PostPurchaseAppIdSchema });
|
|
4702
|
-
var SessionOrderTimingSchema =
|
|
4768
|
+
var SessionOrderTimingSchema = import_zod82.z.object({
|
|
4703
4769
|
nativeDeadline: PostPurchaseTimestampSchema,
|
|
4704
4770
|
orderCreatedAt: PostPurchaseTimestampSchema,
|
|
4705
4771
|
orderId: PostPurchaseOrderIdSchema,
|
|
4706
|
-
timingSource:
|
|
4772
|
+
timingSource: import_zod82.z.literal("shopify-order-created-at")
|
|
4707
4773
|
});
|
|
4708
4774
|
var ReadySessionTimingSchema = SessionOrderTimingSchema.extend({
|
|
4709
4775
|
deadline: PostPurchaseTimestampSchema,
|
|
@@ -4720,33 +4786,33 @@ var ReadySessionTimingSchema = SessionOrderTimingSchema.extend({
|
|
|
4720
4786
|
message: "deadline must not exceed nativeDeadline",
|
|
4721
4787
|
path: ["deadline"]
|
|
4722
4788
|
});
|
|
4723
|
-
var SessionStartResponseSchema =
|
|
4724
|
-
data:
|
|
4725
|
-
phase:
|
|
4789
|
+
var SessionStartResponseSchema = import_zod82.z.object({
|
|
4790
|
+
data: import_zod82.z.object({
|
|
4791
|
+
phase: import_zod82.z.literal("render"),
|
|
4726
4792
|
serverNow: PostPurchaseTimestampSchema,
|
|
4727
4793
|
session: ReadySessionTimingSchema,
|
|
4728
|
-
workflowPhase:
|
|
4794
|
+
workflowPhase: import_zod82.z.literal("start")
|
|
4729
4795
|
}),
|
|
4730
|
-
successful:
|
|
4796
|
+
successful: import_zod82.z.literal(true)
|
|
4731
4797
|
});
|
|
4732
4798
|
|
|
4733
4799
|
// src/schema/postPurchaseShadow.ts
|
|
4734
|
-
var
|
|
4735
|
-
var PostPurchaseShadowSelectionSchema =
|
|
4736
|
-
|
|
4737
|
-
|
|
4800
|
+
var import_zod83 = require("zod");
|
|
4801
|
+
var PostPurchaseShadowSelectionSchema = import_zod83.z.discriminatedUnion("verdict", [
|
|
4802
|
+
import_zod83.z.object({ entry: DecisionEntrySchema, verdict: import_zod83.z.literal("render") }),
|
|
4803
|
+
import_zod83.z.object({ verdict: import_zod83.z.literal("skip") })
|
|
4738
4804
|
]);
|
|
4739
|
-
var PostPurchaseShadowReportFields =
|
|
4740
|
-
differences:
|
|
4805
|
+
var PostPurchaseShadowReportFields = import_zod83.z.object({
|
|
4806
|
+
differences: import_zod83.z.array(import_zod83.z.enum(["verdict", "entry", "targeting", "incomplete-capture", "unsupported-configuration"])).refine((differences) => new Set(differences).size === differences.length, {
|
|
4741
4807
|
message: "differences must not contain duplicate entries"
|
|
4742
4808
|
}),
|
|
4743
4809
|
legacySelection: PostPurchaseShadowSelectionSchema,
|
|
4744
|
-
phase:
|
|
4745
|
-
sampleId:
|
|
4810
|
+
phase: import_zod83.z.literal("shouldRender"),
|
|
4811
|
+
sampleId: import_zod83.z.string(),
|
|
4746
4812
|
serverSelection: PostPurchaseShadowSelectionSchema.optional(),
|
|
4747
|
-
status:
|
|
4748
|
-
targetingFlowIds:
|
|
4749
|
-
workflowPhase:
|
|
4813
|
+
status: import_zod83.z.enum(["match", "diverged", "incomplete"]),
|
|
4814
|
+
targetingFlowIds: import_zod83.z.array(import_zod83.z.number().int().positive()),
|
|
4815
|
+
workflowPhase: import_zod83.z.literal("decide")
|
|
4750
4816
|
});
|
|
4751
4817
|
var PostPurchaseShadowReportSchema = PostPurchaseShadowReportFields.refine(
|
|
4752
4818
|
(report) => report.status !== "match" || report.differences.length === 0,
|
|
@@ -4760,20 +4826,20 @@ var PostPurchaseShadowReportSchema = PostPurchaseShadowReportFields.refine(
|
|
|
4760
4826
|
});
|
|
4761
4827
|
|
|
4762
4828
|
// src/schema/postPurchaseSubscriptionDisplay.ts
|
|
4763
|
-
var
|
|
4764
|
-
var Minor2 =
|
|
4765
|
-
var PostPurchaseSubscriptionDisplay =
|
|
4829
|
+
var import_zod84 = require("zod");
|
|
4830
|
+
var Minor2 = import_zod84.z.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER);
|
|
4831
|
+
var PostPurchaseSubscriptionDisplay = import_zod84.z.object({
|
|
4766
4832
|
comparisonMinor: Minor2,
|
|
4767
|
-
currencyCode:
|
|
4833
|
+
currencyCode: import_zod84.z.string().regex(/^[A-Z]{3}$/),
|
|
4768
4834
|
priceMinor: Minor2,
|
|
4769
4835
|
savingMinor: Minor2,
|
|
4770
|
-
savingPercent:
|
|
4836
|
+
savingPercent: import_zod84.z.number().int().min(0).max(100)
|
|
4771
4837
|
});
|
|
4772
4838
|
|
|
4773
4839
|
// src/schema/postPurchaseSubscriptionProduct.ts
|
|
4774
|
-
var
|
|
4840
|
+
var import_zod85 = require("zod");
|
|
4775
4841
|
var PreparedPostPurchaseSubscription = PreparedPostPurchaseProduct.extend({
|
|
4776
|
-
selection: PreparedPostPurchaseProduct.shape.selection.extend({ sellingPlanId:
|
|
4842
|
+
selection: PreparedPostPurchaseProduct.shape.selection.extend({ sellingPlanId: import_zod85.z.number().int().positive() }),
|
|
4777
4843
|
terms: PreparedPostPurchaseProduct.shape.terms.extend({
|
|
4778
4844
|
subscription: PostPurchaseSubscriptionTerms
|
|
4779
4845
|
}).refine(
|
|
@@ -4786,108 +4852,108 @@ var readPostPurchaseSubscription = (prepared) => {
|
|
|
4786
4852
|
};
|
|
4787
4853
|
|
|
4788
4854
|
// src/schema/postPurchaseTransition.ts
|
|
4789
|
-
var
|
|
4855
|
+
var import_zod86 = require("zod");
|
|
4790
4856
|
var OfferTransitionRequestSchema = DecideRequestSchema.extend({
|
|
4791
4857
|
entryRevision: PostPurchaseProgressSchema.shape.entryRevision,
|
|
4792
4858
|
progressRevision: PostPurchaseProgressSchema.shape.revision
|
|
4793
4859
|
}).strict();
|
|
4794
|
-
var OfferTransitionResponseSchema =
|
|
4795
|
-
data:
|
|
4860
|
+
var OfferTransitionResponseSchema = import_zod86.z.object({
|
|
4861
|
+
data: import_zod86.z.object({
|
|
4796
4862
|
attemptedSkips: PostPurchaseSkipTraceSchema.optional(),
|
|
4797
4863
|
progress: PostPurchaseProgressSchema,
|
|
4798
|
-
status:
|
|
4864
|
+
status: import_zod86.z.enum(["advanced", "no-child", "unavailable"])
|
|
4799
4865
|
}),
|
|
4800
|
-
successful:
|
|
4866
|
+
successful: import_zod86.z.literal(true)
|
|
4801
4867
|
});
|
|
4802
4868
|
|
|
4803
4869
|
// src/schema/postPurchaseVariantDefault.ts
|
|
4804
|
-
var
|
|
4870
|
+
var import_zod87 = require("zod");
|
|
4805
4871
|
var values = PostPurchaseVariantValues.partial().extend({
|
|
4806
4872
|
option1: PostPurchaseVariantValues.shape.option1.nullish()
|
|
4807
4873
|
});
|
|
4808
4874
|
var variant = values.extend({
|
|
4809
4875
|
id: PostPurchaseVariantId,
|
|
4810
|
-
inventoryManagement:
|
|
4811
|
-
inventoryPolicy:
|
|
4812
|
-
inventoryQuantity:
|
|
4876
|
+
inventoryManagement: import_zod87.z.string().nullable(),
|
|
4877
|
+
inventoryPolicy: import_zod87.z.string(),
|
|
4878
|
+
inventoryQuantity: import_zod87.z.number()
|
|
4813
4879
|
});
|
|
4814
|
-
var options =
|
|
4815
|
-
var PostPurchaseVariantDefaultProduct =
|
|
4880
|
+
var options = import_zod87.z.array(PostPurchaseVariantOption.pick({ name: true, values: true }));
|
|
4881
|
+
var PostPurchaseVariantDefaultProduct = import_zod87.z.object({
|
|
4816
4882
|
id: PostPurchaseProductId,
|
|
4817
4883
|
options,
|
|
4818
4884
|
selectedVariant: variant.optional(),
|
|
4819
|
-
variants:
|
|
4885
|
+
variants: import_zod87.z.array(variant)
|
|
4820
4886
|
});
|
|
4821
4887
|
var PostPurchaseVariantDefaultSettings = PostPurchaseSettings.shape.productOptions.pick({
|
|
4822
4888
|
hideOutOfStockVariants: true,
|
|
4823
4889
|
matchVariant: true
|
|
4824
4890
|
});
|
|
4825
|
-
var PostPurchaseOrderAttributes =
|
|
4826
|
-
var PostPurchaseOriginalVariants =
|
|
4827
|
-
|
|
4891
|
+
var PostPurchaseOrderAttributes = import_zod87.z.record(import_zod87.z.string(), import_zod87.z.array(import_zod87.z.string())).default({});
|
|
4892
|
+
var PostPurchaseOriginalVariants = import_zod87.z.array(
|
|
4893
|
+
import_zod87.z.object({ productId: PostPurchaseProductId, variantId: PostPurchaseVariantId })
|
|
4828
4894
|
);
|
|
4829
|
-
var PostPurchaseAttributeProducts =
|
|
4830
|
-
|
|
4895
|
+
var PostPurchaseAttributeProducts = import_zod87.z.array(
|
|
4896
|
+
import_zod87.z.object({ id: PostPurchaseProductId, options, variants: import_zod87.z.array(values.extend({ id: PostPurchaseVariantId })) })
|
|
4831
4897
|
);
|
|
4832
4898
|
|
|
4833
4899
|
// src/schema/postPurchaseVariantDefaultContext.ts
|
|
4834
|
-
var
|
|
4835
|
-
var PostPurchaseVariantDefaultContext =
|
|
4836
|
-
enrichedLineItems:
|
|
4900
|
+
var import_zod88 = require("zod");
|
|
4901
|
+
var PostPurchaseVariantDefaultContext = import_zod88.z.object({
|
|
4902
|
+
enrichedLineItems: import_zod88.z.unknown().optional(),
|
|
4837
4903
|
originalVariants: PostPurchaseOriginalVariants
|
|
4838
4904
|
});
|
|
4839
4905
|
|
|
4840
4906
|
// src/schema/shopConfig.ts
|
|
4841
|
-
var
|
|
4842
|
-
var ShopConfig =
|
|
4843
|
-
activeExperiments:
|
|
4844
|
-
|
|
4845
|
-
data:
|
|
4846
|
-
|
|
4847
|
-
aliasName:
|
|
4848
|
-
cssInput:
|
|
4849
|
-
elementId:
|
|
4850
|
-
id:
|
|
4851
|
-
javascriptInput:
|
|
4852
|
-
traffic:
|
|
4907
|
+
var import_zod89 = require("zod");
|
|
4908
|
+
var ShopConfig = import_zod89.z.object({
|
|
4909
|
+
activeExperiments: import_zod89.z.array(
|
|
4910
|
+
import_zod89.z.object({
|
|
4911
|
+
data: import_zod89.z.array(
|
|
4912
|
+
import_zod89.z.object({
|
|
4913
|
+
aliasName: import_zod89.z.string(),
|
|
4914
|
+
cssInput: import_zod89.z.string().nullish(),
|
|
4915
|
+
elementId: import_zod89.z.coerce.number(),
|
|
4916
|
+
id: import_zod89.z.coerce.number(),
|
|
4917
|
+
javascriptInput: import_zod89.z.string().nullish(),
|
|
4918
|
+
traffic: import_zod89.z.coerce.number()
|
|
4853
4919
|
})
|
|
4854
4920
|
),
|
|
4855
|
-
id:
|
|
4856
|
-
name:
|
|
4857
|
-
pageTarget:
|
|
4858
|
-
pageTargetUrl:
|
|
4859
|
-
placeholderId:
|
|
4860
|
-
type:
|
|
4921
|
+
id: import_zod89.z.coerce.number(),
|
|
4922
|
+
name: import_zod89.z.string(),
|
|
4923
|
+
pageTarget: import_zod89.z.string().nullable(),
|
|
4924
|
+
pageTargetUrl: import_zod89.z.string().nullable(),
|
|
4925
|
+
placeholderId: import_zod89.z.coerce.number().nullable(),
|
|
4926
|
+
type: import_zod89.z.string()
|
|
4861
4927
|
})
|
|
4862
4928
|
),
|
|
4863
|
-
activePackages:
|
|
4864
|
-
|
|
4865
|
-
cancelledAt:
|
|
4866
|
-
id:
|
|
4867
|
-
installedAt:
|
|
4868
|
-
isActive:
|
|
4869
|
-
isBillable:
|
|
4870
|
-
packageId:
|
|
4871
|
-
packageName:
|
|
4872
|
-
shortName:
|
|
4873
|
-
trialDays:
|
|
4874
|
-
uninstalledAt:
|
|
4929
|
+
activePackages: import_zod89.z.array(
|
|
4930
|
+
import_zod89.z.object({
|
|
4931
|
+
cancelledAt: import_zod89.z.string().nullable(),
|
|
4932
|
+
id: import_zod89.z.number(),
|
|
4933
|
+
installedAt: import_zod89.z.string().nullable(),
|
|
4934
|
+
isActive: import_zod89.z.boolean(),
|
|
4935
|
+
isBillable: import_zod89.z.boolean(),
|
|
4936
|
+
packageId: import_zod89.z.number(),
|
|
4937
|
+
packageName: import_zod89.z.string(),
|
|
4938
|
+
shortName: import_zod89.z.string(),
|
|
4939
|
+
trialDays: import_zod89.z.number(),
|
|
4940
|
+
uninstalledAt: import_zod89.z.string().nullable()
|
|
4875
4941
|
})
|
|
4876
4942
|
),
|
|
4877
|
-
apiKey:
|
|
4878
|
-
billingVersion:
|
|
4879
|
-
cacheKey:
|
|
4880
|
-
carousel:
|
|
4881
|
-
currency:
|
|
4882
|
-
currencySymbol:
|
|
4883
|
-
domain:
|
|
4884
|
-
enabledJquery:
|
|
4885
|
-
enabledPresentmentCurrencies:
|
|
4886
|
-
hasSmartCollectionsEnabled:
|
|
4887
|
-
hasSmartSearchEnabled:
|
|
4888
|
-
id:
|
|
4889
|
-
integrations:
|
|
4890
|
-
|
|
4943
|
+
apiKey: import_zod89.z.string(),
|
|
4944
|
+
billingVersion: import_zod89.z.string().nullable(),
|
|
4945
|
+
cacheKey: import_zod89.z.coerce.number(),
|
|
4946
|
+
carousel: import_zod89.z.enum(["flickity", "splide"]),
|
|
4947
|
+
currency: import_zod89.z.string(),
|
|
4948
|
+
currencySymbol: import_zod89.z.string(),
|
|
4949
|
+
domain: import_zod89.z.string(),
|
|
4950
|
+
enabledJquery: import_zod89.z.boolean(),
|
|
4951
|
+
enabledPresentmentCurrencies: import_zod89.z.array(import_zod89.z.string()),
|
|
4952
|
+
hasSmartCollectionsEnabled: import_zod89.z.boolean(),
|
|
4953
|
+
hasSmartSearchEnabled: import_zod89.z.boolean(),
|
|
4954
|
+
id: import_zod89.z.coerce.number(),
|
|
4955
|
+
integrations: import_zod89.z.record(
|
|
4956
|
+
import_zod89.z.enum([
|
|
4891
4957
|
"attentive",
|
|
4892
4958
|
"judgeme",
|
|
4893
4959
|
"junip",
|
|
@@ -4900,170 +4966,170 @@ var ShopConfig = import_zod88.z.object({
|
|
|
4900
4966
|
"stamped",
|
|
4901
4967
|
"yotpo"
|
|
4902
4968
|
]),
|
|
4903
|
-
|
|
4969
|
+
import_zod89.z.union([import_zod89.z.boolean(), import_zod89.z.unknown()])
|
|
4904
4970
|
),
|
|
4905
|
-
markets:
|
|
4906
|
-
enabled:
|
|
4971
|
+
markets: import_zod89.z.object({
|
|
4972
|
+
enabled: import_zod89.z.boolean()
|
|
4907
4973
|
}),
|
|
4908
|
-
monetize:
|
|
4909
|
-
publisherKey:
|
|
4974
|
+
monetize: import_zod89.z.object({
|
|
4975
|
+
publisherKey: import_zod89.z.string().nullable()
|
|
4910
4976
|
}).nullish(),
|
|
4911
|
-
moneyFormat:
|
|
4912
|
-
myshopifyDomain:
|
|
4913
|
-
primaryLocale:
|
|
4914
|
-
productGroupsEnabled:
|
|
4915
|
-
rechargeCustomDomain:
|
|
4916
|
-
sellingPlansEnabled:
|
|
4917
|
-
shopId:
|
|
4918
|
-
shopifySellingPlansEnabled:
|
|
4919
|
-
shopName:
|
|
4920
|
-
storefrontAccessToken:
|
|
4921
|
-
useRebuyIcons:
|
|
4977
|
+
moneyFormat: import_zod89.z.string(),
|
|
4978
|
+
myshopifyDomain: import_zod89.z.string(),
|
|
4979
|
+
primaryLocale: import_zod89.z.string(),
|
|
4980
|
+
productGroupsEnabled: import_zod89.z.enum(["no", "yes"]).transform((value) => value === "yes"),
|
|
4981
|
+
rechargeCustomDomain: import_zod89.z.string().nullable(),
|
|
4982
|
+
sellingPlansEnabled: import_zod89.z.boolean(),
|
|
4983
|
+
shopId: import_zod89.z.number(),
|
|
4984
|
+
shopifySellingPlansEnabled: import_zod89.z.boolean(),
|
|
4985
|
+
shopName: import_zod89.z.string(),
|
|
4986
|
+
storefrontAccessToken: import_zod89.z.string().nullable(),
|
|
4987
|
+
useRebuyIcons: import_zod89.z.boolean()
|
|
4922
4988
|
});
|
|
4923
4989
|
|
|
4924
4990
|
// src/schema/userConfig.ts
|
|
4925
|
-
var
|
|
4926
|
-
var UserConfig =
|
|
4991
|
+
var import_zod90 = require("zod");
|
|
4992
|
+
var UserConfig = import_zod90.z.object({
|
|
4927
4993
|
shop: ShopConfig,
|
|
4928
4994
|
/**
|
|
4929
4995
|
* `.catch(undefined)` is the safety bar: smart-cart shape drift can NEVER fail `fetchUserConfig`,
|
|
4930
4996
|
* which resolves the apiKey for every offers/monetize/analytics/gift request.
|
|
4931
4997
|
*/
|
|
4932
4998
|
smartCart: SmartCartConfig.nullish().catch(void 0),
|
|
4933
|
-
smartFlows:
|
|
4999
|
+
smartFlows: import_zod90.z.array(import_zod90.z.unknown())
|
|
4934
5000
|
});
|
|
4935
5001
|
|
|
4936
5002
|
// src/schema/widgetData.ts
|
|
4937
|
-
var
|
|
5003
|
+
var import_zod99 = require("zod");
|
|
4938
5004
|
|
|
4939
5005
|
// src/schema/widgets/abTestingPlaceholder.ts
|
|
4940
|
-
var
|
|
4941
|
-
var ABTestingPlaceholder =
|
|
4942
|
-
type:
|
|
5006
|
+
var import_zod91 = require("zod");
|
|
5007
|
+
var ABTestingPlaceholder = import_zod91.z.looseObject({
|
|
5008
|
+
type: import_zod91.z.literal("placeholder")
|
|
4943
5009
|
});
|
|
4944
5010
|
|
|
4945
5011
|
// src/schema/widgets/checkoutExtension.ts
|
|
4946
|
-
var
|
|
4947
|
-
var CheckoutExtension =
|
|
4948
|
-
type:
|
|
5012
|
+
var import_zod92 = require("zod");
|
|
5013
|
+
var CheckoutExtension = import_zod92.z.looseObject({
|
|
5014
|
+
type: import_zod92.z.literal(WidgetType.shopify_checkout_extension).default(WidgetType.shopify_checkout_extension)
|
|
4949
5015
|
});
|
|
4950
5016
|
|
|
4951
5017
|
// src/schema/widgets/contentBlock.ts
|
|
4952
|
-
var
|
|
4953
|
-
var ContentBlockV1 =
|
|
4954
|
-
blockSpacing:
|
|
4955
|
-
imageBlocks:
|
|
4956
|
-
|
|
4957
|
-
|
|
4958
|
-
altText:
|
|
4959
|
-
description:
|
|
4960
|
-
id:
|
|
4961
|
-
imagePlacement:
|
|
4962
|
-
imageSize:
|
|
4963
|
-
imageUrl:
|
|
4964
|
-
textAlignment:
|
|
5018
|
+
var import_zod93 = require("zod");
|
|
5019
|
+
var ContentBlockV1 = import_zod93.z.object({
|
|
5020
|
+
blockSpacing: import_zod93.z.enum(spacings).optional(),
|
|
5021
|
+
imageBlocks: import_zod93.z.union([
|
|
5022
|
+
import_zod93.z.array(
|
|
5023
|
+
import_zod93.z.object({
|
|
5024
|
+
altText: import_zod93.z.string().nullable(),
|
|
5025
|
+
description: import_zod93.z.string().nullable(),
|
|
5026
|
+
id: import_zod93.z.uuid(),
|
|
5027
|
+
imagePlacement: import_zod93.z.enum(["top", "right", "bottom", "left"]),
|
|
5028
|
+
imageSize: import_zod93.z.number(),
|
|
5029
|
+
imageUrl: import_zod93.z.url(),
|
|
5030
|
+
textAlignment: import_zod93.z.enum(["left", "center", "right"]),
|
|
4965
5031
|
/** Inline scale only: an image caption can never be a block-level heading. */
|
|
4966
|
-
textSize:
|
|
5032
|
+
textSize: import_zod93.z.enum(inlineTextSizeNames)
|
|
4967
5033
|
})
|
|
4968
5034
|
),
|
|
4969
|
-
|
|
5035
|
+
import_zod93.z.strictObject({}).transform(() => [])
|
|
4970
5036
|
]).optional(),
|
|
4971
|
-
imageLayout:
|
|
4972
|
-
language:
|
|
4973
|
-
description:
|
|
4974
|
-
superTitle:
|
|
4975
|
-
title:
|
|
5037
|
+
imageLayout: import_zod93.z.enum(["row", "column"]).optional(),
|
|
5038
|
+
language: import_zod93.z.object({
|
|
5039
|
+
description: import_zod93.z.string(),
|
|
5040
|
+
superTitle: import_zod93.z.string(),
|
|
5041
|
+
title: import_zod93.z.string()
|
|
4976
5042
|
}),
|
|
4977
|
-
previewMode:
|
|
4978
|
-
type:
|
|
4979
|
-
version:
|
|
5043
|
+
previewMode: import_zod93.z.boolean(),
|
|
5044
|
+
type: import_zod93.z.literal(WidgetType.ui_extension_content_block).default(WidgetType.ui_extension_content_block),
|
|
5045
|
+
version: import_zod93.z.literal(1)
|
|
4980
5046
|
});
|
|
4981
|
-
var ContentBlock =
|
|
5047
|
+
var ContentBlock = import_zod93.z.discriminatedUnion("version", [
|
|
4982
5048
|
ContentBlockV1,
|
|
4983
5049
|
CABRootSection.extend({
|
|
4984
|
-
type:
|
|
5050
|
+
type: import_zod93.z.literal(WidgetType.ui_extension_content_block).default(WidgetType.ui_extension_content_block)
|
|
4985
5051
|
})
|
|
4986
5052
|
]);
|
|
4987
5053
|
|
|
4988
5054
|
// src/schema/widgets/giftWithPurchase.ts
|
|
4989
|
-
var
|
|
4990
|
-
var GiftWithPurchase =
|
|
4991
|
-
type:
|
|
5055
|
+
var import_zod94 = require("zod");
|
|
5056
|
+
var GiftWithPurchase = import_zod94.z.looseObject({
|
|
5057
|
+
type: import_zod94.z.literal(WidgetType.gift_with_purchase).default(WidgetType.gift_with_purchase)
|
|
4992
5058
|
});
|
|
4993
5059
|
|
|
4994
5060
|
// src/schema/widgets/lineItemEditor.ts
|
|
4995
|
-
var
|
|
4996
|
-
var LineItemEditorSwitchLanguageV1 =
|
|
4997
|
-
downgradeToOneTimeLabel:
|
|
5061
|
+
var import_zod95 = require("zod");
|
|
5062
|
+
var LineItemEditorSwitchLanguageV1 = import_zod95.z.object({
|
|
5063
|
+
downgradeToOneTimeLabel: import_zod95.z.string().optional(),
|
|
4998
5064
|
/** Frequency-option template (`{{frequency}}`/`{{interval}}`) for the plan select. */
|
|
4999
|
-
subscriptionOptionLabel:
|
|
5000
|
-
upgradeToSubscriptionLabel:
|
|
5001
|
-
upgradeToSubscriptionWithoutDiscountLabel:
|
|
5065
|
+
subscriptionOptionLabel: import_zod95.z.string().optional(),
|
|
5066
|
+
upgradeToSubscriptionLabel: import_zod95.z.string().optional(),
|
|
5067
|
+
upgradeToSubscriptionWithoutDiscountLabel: import_zod95.z.string().optional()
|
|
5002
5068
|
});
|
|
5003
|
-
var LineItemEditorV1 =
|
|
5069
|
+
var LineItemEditorV1 = import_zod95.z.object({
|
|
5004
5070
|
/** Legacy `getStyles` button style; the converter carries a valid kind, defaulting to `plain`. */
|
|
5005
|
-
button:
|
|
5006
|
-
previewMode:
|
|
5007
|
-
switchToSubscription:
|
|
5008
|
-
disableDowngrade:
|
|
5071
|
+
button: import_zod95.z.object({ kind: import_zod95.z.enum(["plain", "primary", "secondary"]).optional() }).optional(),
|
|
5072
|
+
previewMode: import_zod95.z.boolean().optional(),
|
|
5073
|
+
switchToSubscription: import_zod95.z.object({
|
|
5074
|
+
disableDowngrade: import_zod95.z.boolean().optional(),
|
|
5009
5075
|
language: LineItemEditorSwitchLanguageV1.optional()
|
|
5010
5076
|
}).optional(),
|
|
5011
|
-
switchToSubscriptionEnabled:
|
|
5012
|
-
tracking:
|
|
5013
|
-
enableAttribution:
|
|
5014
|
-
enableSource:
|
|
5015
|
-
enableWidget:
|
|
5077
|
+
switchToSubscriptionEnabled: import_zod95.z.boolean().optional(),
|
|
5078
|
+
tracking: import_zod95.z.object({
|
|
5079
|
+
enableAttribution: import_zod95.z.boolean().optional(),
|
|
5080
|
+
enableSource: import_zod95.z.boolean().optional(),
|
|
5081
|
+
enableWidget: import_zod95.z.boolean().optional()
|
|
5016
5082
|
}).optional(),
|
|
5017
|
-
type:
|
|
5018
|
-
version:
|
|
5083
|
+
type: import_zod95.z.literal(WidgetType.ui_extension_line_item_editor).default(WidgetType.ui_extension_line_item_editor),
|
|
5084
|
+
version: import_zod95.z.literal(1)
|
|
5019
5085
|
});
|
|
5020
|
-
var LineItemEditor =
|
|
5086
|
+
var LineItemEditor = import_zod95.z.discriminatedUnion("version", [
|
|
5021
5087
|
LineItemEditorV1,
|
|
5022
5088
|
CABRootSection.extend({
|
|
5023
|
-
type:
|
|
5089
|
+
type: import_zod95.z.literal(WidgetType.ui_extension_line_item_editor).default(WidgetType.ui_extension_line_item_editor)
|
|
5024
5090
|
})
|
|
5025
5091
|
]);
|
|
5026
5092
|
|
|
5027
5093
|
// src/schema/widgets/progressBar.ts
|
|
5028
|
-
var
|
|
5029
|
-
var ProgressBar =
|
|
5030
|
-
type:
|
|
5094
|
+
var import_zod96 = require("zod");
|
|
5095
|
+
var ProgressBar = import_zod96.z.looseObject({
|
|
5096
|
+
type: import_zod96.z.literal(WidgetType.ui_extension_progress_bar).default(WidgetType.ui_extension_progress_bar)
|
|
5031
5097
|
});
|
|
5032
5098
|
|
|
5033
5099
|
// src/schema/widgets/rebuyButton.ts
|
|
5034
|
-
var
|
|
5035
|
-
var RebuyButtonV1 =
|
|
5036
|
-
type:
|
|
5037
|
-
version:
|
|
5100
|
+
var import_zod97 = require("zod");
|
|
5101
|
+
var RebuyButtonV1 = import_zod97.z.looseObject({
|
|
5102
|
+
type: import_zod97.z.literal(WidgetType.ui_extension_button).default(WidgetType.ui_extension_button),
|
|
5103
|
+
version: import_zod97.z.literal(1)
|
|
5038
5104
|
});
|
|
5039
|
-
var RebuyButton =
|
|
5105
|
+
var RebuyButton = import_zod97.z.discriminatedUnion("version", [
|
|
5040
5106
|
RebuyButtonV1,
|
|
5041
5107
|
CABRootSection.extend({
|
|
5042
|
-
type:
|
|
5108
|
+
type: import_zod97.z.literal(WidgetType.ui_extension_button).default(WidgetType.ui_extension_button)
|
|
5043
5109
|
})
|
|
5044
5110
|
]);
|
|
5045
5111
|
|
|
5046
5112
|
// src/schema/widgets/rebuyMonetize.ts
|
|
5047
|
-
var
|
|
5048
|
-
var RebuyMonetize =
|
|
5049
|
-
type:
|
|
5113
|
+
var import_zod98 = require("zod");
|
|
5114
|
+
var RebuyMonetize = import_zod98.z.looseObject({
|
|
5115
|
+
type: import_zod98.z.literal(WidgetType.ui_extension_ad).default(WidgetType.ui_extension_ad)
|
|
5050
5116
|
});
|
|
5051
|
-
var RebuyMonetizeV1 =
|
|
5052
|
-
name:
|
|
5053
|
-
previewMode:
|
|
5117
|
+
var RebuyMonetizeV1 = import_zod98.z.object({
|
|
5118
|
+
name: import_zod98.z.string().nullable().optional(),
|
|
5119
|
+
previewMode: import_zod98.z.boolean().optional(),
|
|
5054
5120
|
/** Privacy Policy footer href → the marker section's `privacyPolicyUrl`. */
|
|
5055
|
-
privacyPolicyUrl:
|
|
5121
|
+
privacyPolicyUrl: import_zod98.z.string().nullable().optional(),
|
|
5056
5122
|
/** Ads-taxonomy sub-vertical id — one of the admin Monetize editor's two configurables. */
|
|
5057
|
-
subVertical:
|
|
5058
|
-
tracking:
|
|
5059
|
-
enableAttribution:
|
|
5060
|
-
enableSource:
|
|
5061
|
-
enableWidget:
|
|
5123
|
+
subVertical: import_zod98.z.string().nullable().optional(),
|
|
5124
|
+
tracking: import_zod98.z.object({
|
|
5125
|
+
enableAttribution: import_zod98.z.boolean().optional(),
|
|
5126
|
+
enableSource: import_zod98.z.boolean().optional(),
|
|
5127
|
+
enableWidget: import_zod98.z.boolean().optional()
|
|
5062
5128
|
}).optional(),
|
|
5063
|
-
type:
|
|
5064
|
-
version:
|
|
5129
|
+
type: import_zod98.z.literal(WidgetType.ui_extension_ad).default(WidgetType.ui_extension_ad),
|
|
5130
|
+
version: import_zod98.z.literal(1),
|
|
5065
5131
|
/** Ads-taxonomy vertical id — one of the admin Monetize editor's two configurables. */
|
|
5066
|
-
vertical:
|
|
5132
|
+
vertical: import_zod98.z.string().nullable().optional()
|
|
5067
5133
|
});
|
|
5068
5134
|
|
|
5069
5135
|
// src/schema/widgetData.ts
|
|
@@ -5077,7 +5143,7 @@ var extensionWidgetTypes = [
|
|
|
5077
5143
|
WidgetType.ui_extension_line_item_editor,
|
|
5078
5144
|
WidgetType.ui_extension_progress_bar
|
|
5079
5145
|
];
|
|
5080
|
-
var WidgetData =
|
|
5146
|
+
var WidgetData = import_zod99.z.discriminatedUnion("type", [
|
|
5081
5147
|
ABTestingPlaceholder,
|
|
5082
5148
|
CheckoutExtension,
|
|
5083
5149
|
ContentBlock,
|
|
@@ -5437,36 +5503,36 @@ var SWITCH_LABELS = {
|
|
|
5437
5503
|
};
|
|
5438
5504
|
|
|
5439
5505
|
// src/schema/widgets/post-purchase-offer/postPurchaseOffer.ts
|
|
5440
|
-
var
|
|
5506
|
+
var import_zod101 = require("zod");
|
|
5441
5507
|
|
|
5442
5508
|
// src/schema/widgets/post-purchase-offer/postPurchaseWidget.ts
|
|
5443
|
-
var
|
|
5444
|
-
var PostPurchaseWidgetLinkedFlow =
|
|
5445
|
-
id:
|
|
5446
|
-
name:
|
|
5447
|
-
});
|
|
5448
|
-
var PostPurchaseWidget =
|
|
5449
|
-
classification:
|
|
5450
|
-
createdAtTime:
|
|
5451
|
-
customEndpointName:
|
|
5452
|
-
id:
|
|
5453
|
-
lastViewed:
|
|
5454
|
-
linkedCustomEndpointId:
|
|
5455
|
-
linkedFlows:
|
|
5456
|
-
name:
|
|
5457
|
-
owner:
|
|
5509
|
+
var import_zod100 = require("zod");
|
|
5510
|
+
var PostPurchaseWidgetLinkedFlow = import_zod100.z.object({
|
|
5511
|
+
id: import_zod100.z.number(),
|
|
5512
|
+
name: import_zod100.z.string()
|
|
5513
|
+
});
|
|
5514
|
+
var PostPurchaseWidget = import_zod100.z.object({
|
|
5515
|
+
classification: import_zod100.z.literal("post_purchase_offer_page").default("post_purchase_offer_page"),
|
|
5516
|
+
createdAtTime: import_zod100.z.iso.datetime({ offset: true }).optional(),
|
|
5517
|
+
customEndpointName: import_zod100.z.string().nullish(),
|
|
5518
|
+
id: import_zod100.z.number().default(0),
|
|
5519
|
+
lastViewed: import_zod100.z.iso.datetime({ offset: true }).nullish(),
|
|
5520
|
+
linkedCustomEndpointId: import_zod100.z.number().nullish(),
|
|
5521
|
+
linkedFlows: import_zod100.z.array(PostPurchaseWidgetLinkedFlow).optional(),
|
|
5522
|
+
name: import_zod100.z.string().default(""),
|
|
5523
|
+
owner: import_zod100.z.number().nullish(),
|
|
5458
5524
|
settings: PostPurchaseSettings
|
|
5459
5525
|
});
|
|
5460
5526
|
|
|
5461
5527
|
// src/schema/widgets/post-purchase-offer/postPurchaseOffer.ts
|
|
5462
|
-
var PostPurchaseOffer =
|
|
5463
|
-
|
|
5464
|
-
errors:
|
|
5465
|
-
message:
|
|
5466
|
-
successful:
|
|
5528
|
+
var PostPurchaseOffer = import_zod101.z.discriminatedUnion("successful", [
|
|
5529
|
+
import_zod101.z.strictObject({
|
|
5530
|
+
errors: import_zod101.z.array(import_zod101.z.object({ message: import_zod101.z.string() })),
|
|
5531
|
+
message: import_zod101.z.string(),
|
|
5532
|
+
successful: import_zod101.z.literal(false)
|
|
5467
5533
|
}),
|
|
5468
|
-
|
|
5469
|
-
successful:
|
|
5534
|
+
import_zod101.z.strictObject({
|
|
5535
|
+
successful: import_zod101.z.literal(true),
|
|
5470
5536
|
widget: PostPurchaseWidget
|
|
5471
5537
|
})
|
|
5472
5538
|
]);
|
|
@@ -6554,7 +6620,7 @@ var convertOfferToV2 = ({ id, name, settings }) => {
|
|
|
6554
6620
|
|
|
6555
6621
|
// src/pricing/postPurchaseChangeset.ts
|
|
6556
6622
|
var postPurchaseChangeset = (prepared) => {
|
|
6557
|
-
const { selection:
|
|
6623
|
+
const { selection: selection3, terms } = prepared;
|
|
6558
6624
|
const subscription = readPostPurchaseSubscription(prepared);
|
|
6559
6625
|
const { discount, shipping } = terms;
|
|
6560
6626
|
const changesetDiscount = discount.type === "none" ? void 0 : {
|
|
@@ -6569,21 +6635,21 @@ var postPurchaseChangeset = (prepared) => {
|
|
|
6569
6635
|
{
|
|
6570
6636
|
...changesetDiscount ? { discount: changesetDiscount } : {},
|
|
6571
6637
|
initialShippingPrice,
|
|
6572
|
-
quantity:
|
|
6638
|
+
quantity: selection3.quantity,
|
|
6573
6639
|
recurringShippingPrice,
|
|
6574
6640
|
sellingPlanId: subscription.selection.sellingPlanId,
|
|
6575
6641
|
shippingOption,
|
|
6576
6642
|
type: "add_subscription",
|
|
6577
|
-
variantId:
|
|
6643
|
+
variantId: selection3.variantId
|
|
6578
6644
|
}
|
|
6579
6645
|
]
|
|
6580
6646
|
});
|
|
6581
6647
|
}
|
|
6582
6648
|
const changes = [
|
|
6583
6649
|
{
|
|
6584
|
-
quantity:
|
|
6650
|
+
quantity: selection3.quantity,
|
|
6585
6651
|
type: "add_variant",
|
|
6586
|
-
variantId:
|
|
6652
|
+
variantId: selection3.variantId,
|
|
6587
6653
|
...changesetDiscount && changesetDiscount.value > 0 ? { discount: changesetDiscount } : {}
|
|
6588
6654
|
}
|
|
6589
6655
|
];
|