@rebuy/rebuy 3.26.0 → 3.28.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 +902 -750
- package/dist/index.mjs +901 -749
- package/dist/schema/checkout-and-beyond/constants.cjs +5 -0
- package/dist/schema/checkout-and-beyond/constants.mjs +5 -0
- package/dist/schema/checkout-and-beyond/index.cjs +97 -68
- package/dist/schema/checkout-and-beyond/index.mjs +97 -68
- package/dist/schema/index.d.ts +6 -0
- package/dist/schema/postPurchaseEligibility.d.ts +2 -2
- package/dist/schema/postPurchaseExitPolicy.d.ts +20 -0
- package/dist/schema/postPurchaseIdentity.d.ts +9 -0
- package/dist/schema/postPurchaseOrderDecision.d.ts +10 -0
- package/dist/schema/postPurchasePolicy.d.ts +62 -0
- package/dist/schema/postPurchaseSelection.d.ts +29 -0
- package/dist/schema/postPurchaseSession.d.ts +112 -0
- package/dist/schema/postPurchaseSessionClose.d.ts +25 -0
- package/dist/schema/postPurchaseShadow.d.ts +56 -1
- package/dist/schema/postPurchaseSkipTrace.d.ts +2 -2
- package/dist/schema/widget-data.cjs +160 -135
- package/dist/schema/widget-data.mjs +160 -135
- package/dist/schema/widgetData.d.ts +24 -0
- package/dist/schema/widgets/checkout-and-beyond/banner.d.ts +8 -0
- package/dist/schema/widgets/checkout-and-beyond/carousel.d.ts +8 -0
- package/dist/schema/widgets/checkout-and-beyond/cartLine.d.ts +8 -0
- package/dist/schema/widgets/checkout-and-beyond/common.d.ts +13 -1
- package/dist/schema/widgets/checkout-and-beyond/index.d.ts +1 -0
- package/dist/schema/widgets/checkout-and-beyond/layout.d.ts +17 -1
- package/dist/schema/widgets/checkout-and-beyond/offers.d.ts +8 -0
- package/dist/schema/widgets/checkout-and-beyond/progressBar.d.ts +8 -0
- package/dist/schema/widgets/checkout-and-beyond/reviews.d.ts +2 -0
- package/dist/schema/widgets/checkout-and-beyond/root.d.ts +8 -0
- package/dist/schema/widgets/checkout-and-beyond/separator.d.ts +192 -0
- package/dist/schema/widgets/checkout-and-beyond/shared.d.ts +2 -1
- package/dist/schema/widgets/contentBlock.d.ts +8 -0
- package/dist/schema/widgets/lineItemEditor.d.ts +8 -0
- package/dist/schema/widgets/post-purchase-offer/constants.d.ts +2 -2
- package/dist/schema/widgets/rebuyButton.d.ts +8 -0
- package/dist/server/index.cjs +601 -188
- package/dist/server/index.mjs +601 -188
- package/dist/server/requestSchemas.d.ts +1 -1
- package/dist/transforms/index.cjs +481 -59
- package/dist/transforms/index.d.ts +2 -0
- package/dist/transforms/index.mjs +481 -59
- package/dist/transforms/postPurchase/convertCalloutBlock.d.ts +8 -0
- package/dist/transforms/postPurchase/convertMessagePreview.d.ts +8 -0
- package/dist/transforms/postPurchase/convertPayButtonBlock.d.ts +4 -0
- package/dist/transforms/postPurchase/convertSeparatorBlock.d.ts +4 -0
- package/dist/transforms/postPurchase/convertTextBlock.d.ts +4 -0
- package/dist/transforms/postPurchase/convertTimerBlock.d.ts +4 -0
- package/dist/transforms/postPurchase/styledTextRun.d.ts +3 -0
- package/dist/transforms/postPurchase/types.d.ts +8 -0
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1254,105 +1254,212 @@ var OfferProduct = z5.object({
|
|
|
1254
1254
|
|
|
1255
1255
|
// src/schema/postPurchaseEligibility.ts
|
|
1256
1256
|
import { z as z6 } from "zod";
|
|
1257
|
-
var
|
|
1257
|
+
var PostPurchaseSkipReasonSchema = z6.enum(["empty", "no-eligible-subscription"]);
|
|
1258
1258
|
|
|
1259
|
-
// src/schema/
|
|
1259
|
+
// src/schema/postPurchaseExitPolicy.ts
|
|
1260
1260
|
import { z as z7 } from "zod";
|
|
1261
|
-
var
|
|
1262
|
-
var
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1261
|
+
var EXIT_DELAY_MAX_MS = 60 * 60 * 1e3;
|
|
1262
|
+
var ExitPolicySchema = z7.discriminatedUnion("status", [
|
|
1263
|
+
z7.strictObject({ status: z7.literal("unavailable") }),
|
|
1264
|
+
z7.strictObject({
|
|
1265
|
+
delayMs: z7.number().int().nonnegative().max(EXIT_DELAY_MAX_MS),
|
|
1266
|
+
source: z7.enum(["admitted", "selected-flow"]),
|
|
1267
|
+
status: z7.literal("available")
|
|
1268
|
+
})
|
|
1269
|
+
]);
|
|
1270
|
+
|
|
1271
|
+
// src/schema/postPurchaseIdentity.ts
|
|
1272
|
+
import { z as z8 } from "zod";
|
|
1273
|
+
var POST_PURCHASE_ID_MAX = 128;
|
|
1274
|
+
var PostPurchaseTimestampSchema = z8.number().int().nonnegative();
|
|
1275
|
+
var PostPurchaseOrderIdSchema = z8.string().regex(/^gid:\/\/shopify\/Order\/[1-9]\d*$/);
|
|
1276
|
+
var ShopifyDomainSchema = z8.string().max(POST_PURCHASE_ID_MAX).regex(/^[a-z0-9]([a-z0-9-]*[a-z0-9])?\.myshopify\.com$/);
|
|
1277
|
+
var DecideRequestSchema = z8.object({
|
|
1278
|
+
checkoutToken: z8.string().min(1).max(POST_PURCHASE_ID_MAX),
|
|
1266
1279
|
shop: ShopifyDomainSchema
|
|
1267
1280
|
});
|
|
1268
|
-
var
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1281
|
+
var PostPurchaseAppIdSchema = z8.string().min(1).max(POST_PURCHASE_ID_MAX);
|
|
1282
|
+
var DecisionEntrySchema = z8.object({
|
|
1283
|
+
blockId: z8.number().int().positive(),
|
|
1284
|
+
blockIndex: z8.string(),
|
|
1285
|
+
blockParentIndex: z8.string(),
|
|
1286
|
+
flowId: z8.number().int().positive(),
|
|
1287
|
+
sectionId: z8.number().int().positive(),
|
|
1288
|
+
widgetId: z8.number().int().positive(),
|
|
1289
|
+
widgetTraffic: z8.number().min(0).max(100)
|
|
1290
|
+
});
|
|
1291
|
+
|
|
1292
|
+
// src/schema/postPurchaseOrderDecision.ts
|
|
1293
|
+
import { z as z9 } from "zod";
|
|
1294
|
+
var OrderDecisionSchema = z9.discriminatedUnion("owner", [
|
|
1295
|
+
z9.object({ owner: z9.literal("session"), sessionId: z9.string().regex(/^[a-f0-9]{64}$/) }),
|
|
1296
|
+
z9.object({ owner: z9.literal("release"), sessionId: z9.null() })
|
|
1297
|
+
]);
|
|
1298
|
+
|
|
1299
|
+
// src/schema/postPurchasePolicy.ts
|
|
1300
|
+
import { z as z10 } from "zod";
|
|
1301
|
+
var HoldSettingSchema = z10.discriminatedUnion("enabled", [
|
|
1302
|
+
z10.object({ durationMinutes: z10.number().int().min(1).max(60), enabled: z10.literal(true) }),
|
|
1303
|
+
z10.object({ durationMinutes: z10.null(), enabled: z10.literal(false) })
|
|
1304
|
+
]);
|
|
1305
|
+
var TimingSettingsSchema = z10.object({ flowHold: HoldSettingSchema, shopHold: HoldSettingSchema });
|
|
1306
|
+
var SessionPolicySchema = TimingSettingsSchema.extend({
|
|
1307
|
+
durationMinutes: z10.number().int().min(1).max(60).nullable(),
|
|
1308
|
+
source: z10.enum(["shop", "flow", "native"])
|
|
1309
|
+
}).refine(
|
|
1310
|
+
(policy) => {
|
|
1311
|
+
const expectedSource = policy.shopHold.enabled ? "shop" : policy.flowHold.enabled ? "flow" : "native";
|
|
1312
|
+
const expectedDuration = expectedSource === "shop" ? policy.shopHold.durationMinutes : expectedSource === "flow" ? policy.flowHold.durationMinutes : null;
|
|
1313
|
+
return policy.source === expectedSource && policy.durationMinutes === expectedDuration;
|
|
1314
|
+
},
|
|
1315
|
+
{
|
|
1316
|
+
message: "source and durationMinutes must reflect the shop-over-flow-over-native precedence",
|
|
1317
|
+
path: ["source"]
|
|
1318
|
+
}
|
|
1319
|
+
);
|
|
1320
|
+
|
|
1321
|
+
// src/schema/postPurchaseSelection.ts
|
|
1322
|
+
import { z as z11 } from "zod";
|
|
1323
|
+
var SelectionClaimsSchema = DecideRequestSchema.extend({
|
|
1324
|
+
appId: PostPurchaseAppIdSchema,
|
|
1325
|
+
entry: DecisionEntrySchema,
|
|
1326
|
+
iss: z11.literal("rebuy-api"),
|
|
1327
|
+
purpose: z11.literal("post-purchase-selection")
|
|
1328
|
+
});
|
|
1329
|
+
var SessionStartRequestSchema = DecideRequestSchema.extend({
|
|
1330
|
+
selectionToken: z11.string().min(1).max(8192).optional()
|
|
1331
|
+
}).strict();
|
|
1332
|
+
|
|
1333
|
+
// src/schema/postPurchaseSession.ts
|
|
1334
|
+
import { z as z12 } from "zod";
|
|
1335
|
+
var SessionIdentitySchema = DecideRequestSchema.extend({ appId: PostPurchaseAppIdSchema });
|
|
1336
|
+
var SessionOrderTimingSchema = z12.object({
|
|
1337
|
+
nativeDeadline: PostPurchaseTimestampSchema,
|
|
1338
|
+
orderCreatedAt: PostPurchaseTimestampSchema,
|
|
1339
|
+
orderId: PostPurchaseOrderIdSchema,
|
|
1340
|
+
timingSource: z12.literal("shopify-order-created-at")
|
|
1341
|
+
});
|
|
1342
|
+
var ReadySessionTimingSchema = SessionOrderTimingSchema.extend({
|
|
1343
|
+
deadline: PostPurchaseTimestampSchema,
|
|
1344
|
+
entry: DecisionEntrySchema,
|
|
1345
|
+
policySnapshot: SessionPolicySchema,
|
|
1346
|
+
startedAt: PostPurchaseTimestampSchema
|
|
1347
|
+
}).refine((session) => session.orderCreatedAt <= session.startedAt, {
|
|
1348
|
+
message: "startedAt must not precede orderCreatedAt",
|
|
1349
|
+
path: ["startedAt"]
|
|
1350
|
+
}).refine((session) => session.startedAt <= session.deadline, {
|
|
1351
|
+
message: "deadline must not precede startedAt",
|
|
1352
|
+
path: ["deadline"]
|
|
1353
|
+
}).refine((session) => session.deadline <= session.nativeDeadline, {
|
|
1354
|
+
message: "deadline must not exceed nativeDeadline",
|
|
1355
|
+
path: ["deadline"]
|
|
1356
|
+
});
|
|
1357
|
+
var SessionStartResponseSchema = z12.object({
|
|
1358
|
+
data: z12.object({
|
|
1359
|
+
phase: z12.literal("render"),
|
|
1360
|
+
serverNow: PostPurchaseTimestampSchema,
|
|
1361
|
+
session: ReadySessionTimingSchema,
|
|
1362
|
+
workflowPhase: z12.literal("start")
|
|
1363
|
+
}),
|
|
1364
|
+
successful: z12.literal(true)
|
|
1276
1365
|
});
|
|
1277
1366
|
|
|
1367
|
+
// src/schema/postPurchaseSessionClose.ts
|
|
1368
|
+
import { z as z13 } from "zod";
|
|
1369
|
+
var SessionClosureSchema = z13.object({ closedAt: PostPurchaseTimestampSchema, status: z13.literal("closed") });
|
|
1370
|
+
var SessionCloseRequestSchema = DecideRequestSchema.strict();
|
|
1371
|
+
var SessionCloseResponseSchema = z13.object({ data: SessionClosureSchema, successful: z13.literal(true) });
|
|
1372
|
+
|
|
1278
1373
|
// src/schema/postPurchaseShadow.ts
|
|
1279
|
-
import { z as
|
|
1280
|
-
var PostPurchaseShadowSelectionSchema =
|
|
1281
|
-
|
|
1282
|
-
|
|
1374
|
+
import { z as z14 } from "zod";
|
|
1375
|
+
var PostPurchaseShadowSelectionSchema = z14.discriminatedUnion("verdict", [
|
|
1376
|
+
z14.object({ entry: DecisionEntrySchema, verdict: z14.literal("render") }),
|
|
1377
|
+
z14.object({ verdict: z14.literal("skip") })
|
|
1283
1378
|
]);
|
|
1284
|
-
var
|
|
1285
|
-
differences:
|
|
1379
|
+
var PostPurchaseShadowReportFields = z14.object({
|
|
1380
|
+
differences: z14.array(z14.enum(["verdict", "entry", "targeting", "incomplete-capture", "unsupported-configuration"])).refine((differences) => new Set(differences).size === differences.length, {
|
|
1381
|
+
message: "differences must not contain duplicate entries"
|
|
1382
|
+
}),
|
|
1286
1383
|
legacySelection: PostPurchaseShadowSelectionSchema,
|
|
1287
|
-
phase:
|
|
1288
|
-
sampleId:
|
|
1384
|
+
phase: z14.literal("shouldRender"),
|
|
1385
|
+
sampleId: z14.string(),
|
|
1289
1386
|
serverSelection: PostPurchaseShadowSelectionSchema.optional(),
|
|
1290
|
-
status:
|
|
1291
|
-
targetingFlowIds:
|
|
1292
|
-
workflowPhase:
|
|
1387
|
+
status: z14.enum(["match", "diverged", "incomplete"]),
|
|
1388
|
+
targetingFlowIds: z14.array(z14.number().int().positive()),
|
|
1389
|
+
workflowPhase: z14.literal("decide")
|
|
1390
|
+
});
|
|
1391
|
+
var PostPurchaseShadowReportSchema = PostPurchaseShadowReportFields.refine(
|
|
1392
|
+
(report) => report.status !== "match" || report.differences.length === 0,
|
|
1393
|
+
{ message: "status 'match' requires an empty differences array", path: ["status"] }
|
|
1394
|
+
).refine((report) => report.status !== "diverged" || report.differences.length > 0, {
|
|
1395
|
+
message: "status 'diverged' requires a non-empty differences array",
|
|
1396
|
+
path: ["status"]
|
|
1397
|
+
}).refine((report) => report.status !== "diverged" || report.serverSelection !== void 0, {
|
|
1398
|
+
message: "status 'diverged' requires a serverSelection to diverge from",
|
|
1399
|
+
path: ["status"]
|
|
1293
1400
|
});
|
|
1294
1401
|
|
|
1295
1402
|
// src/schema/postPurchaseSkipTrace.ts
|
|
1296
|
-
import { z as
|
|
1403
|
+
import { z as z15 } from "zod";
|
|
1297
1404
|
var POST_PURCHASE_SKIP_LIMIT = 32;
|
|
1298
|
-
var
|
|
1299
|
-
|
|
1405
|
+
var PostPurchaseSkipTraceSchema = z15.array(
|
|
1406
|
+
z15.object({
|
|
1300
1407
|
entry: DecisionEntrySchema,
|
|
1301
|
-
reason:
|
|
1408
|
+
reason: PostPurchaseSkipReasonSchema
|
|
1302
1409
|
})
|
|
1303
1410
|
).max(POST_PURCHASE_SKIP_LIMIT);
|
|
1304
1411
|
|
|
1305
1412
|
// src/schema/shopConfig.ts
|
|
1306
|
-
import { z as
|
|
1307
|
-
var ShopConfig =
|
|
1308
|
-
activeExperiments:
|
|
1309
|
-
|
|
1310
|
-
data:
|
|
1311
|
-
|
|
1312
|
-
aliasName:
|
|
1313
|
-
cssInput:
|
|
1314
|
-
elementId:
|
|
1315
|
-
id:
|
|
1316
|
-
javascriptInput:
|
|
1317
|
-
traffic:
|
|
1413
|
+
import { z as z16 } from "zod";
|
|
1414
|
+
var ShopConfig = z16.object({
|
|
1415
|
+
activeExperiments: z16.array(
|
|
1416
|
+
z16.object({
|
|
1417
|
+
data: z16.array(
|
|
1418
|
+
z16.object({
|
|
1419
|
+
aliasName: z16.string(),
|
|
1420
|
+
cssInput: z16.string().nullish(),
|
|
1421
|
+
elementId: z16.coerce.number(),
|
|
1422
|
+
id: z16.coerce.number(),
|
|
1423
|
+
javascriptInput: z16.string().nullish(),
|
|
1424
|
+
traffic: z16.coerce.number()
|
|
1318
1425
|
})
|
|
1319
1426
|
),
|
|
1320
|
-
id:
|
|
1321
|
-
name:
|
|
1322
|
-
pageTarget:
|
|
1323
|
-
pageTargetUrl:
|
|
1324
|
-
placeholderId:
|
|
1325
|
-
type:
|
|
1427
|
+
id: z16.coerce.number(),
|
|
1428
|
+
name: z16.string(),
|
|
1429
|
+
pageTarget: z16.string().nullable(),
|
|
1430
|
+
pageTargetUrl: z16.string().nullable(),
|
|
1431
|
+
placeholderId: z16.coerce.number().nullable(),
|
|
1432
|
+
type: z16.string()
|
|
1326
1433
|
})
|
|
1327
1434
|
),
|
|
1328
|
-
activePackages:
|
|
1329
|
-
|
|
1330
|
-
cancelledAt:
|
|
1331
|
-
id:
|
|
1332
|
-
installedAt:
|
|
1333
|
-
isActive:
|
|
1334
|
-
isBillable:
|
|
1335
|
-
packageId:
|
|
1336
|
-
packageName:
|
|
1337
|
-
shortName:
|
|
1338
|
-
trialDays:
|
|
1339
|
-
uninstalledAt:
|
|
1435
|
+
activePackages: z16.array(
|
|
1436
|
+
z16.object({
|
|
1437
|
+
cancelledAt: z16.string().nullable(),
|
|
1438
|
+
id: z16.number(),
|
|
1439
|
+
installedAt: z16.string().nullable(),
|
|
1440
|
+
isActive: z16.boolean(),
|
|
1441
|
+
isBillable: z16.boolean(),
|
|
1442
|
+
packageId: z16.number(),
|
|
1443
|
+
packageName: z16.string(),
|
|
1444
|
+
shortName: z16.string(),
|
|
1445
|
+
trialDays: z16.number(),
|
|
1446
|
+
uninstalledAt: z16.string().nullable()
|
|
1340
1447
|
})
|
|
1341
1448
|
),
|
|
1342
|
-
apiKey:
|
|
1343
|
-
billingVersion:
|
|
1344
|
-
cacheKey:
|
|
1345
|
-
carousel:
|
|
1346
|
-
currency:
|
|
1347
|
-
currencySymbol:
|
|
1348
|
-
domain:
|
|
1349
|
-
enabledJquery:
|
|
1350
|
-
enabledPresentmentCurrencies:
|
|
1351
|
-
hasSmartCollectionsEnabled:
|
|
1352
|
-
hasSmartSearchEnabled:
|
|
1353
|
-
id:
|
|
1354
|
-
integrations:
|
|
1355
|
-
|
|
1449
|
+
apiKey: z16.string(),
|
|
1450
|
+
billingVersion: z16.string().nullable(),
|
|
1451
|
+
cacheKey: z16.coerce.number(),
|
|
1452
|
+
carousel: z16.enum(["flickity", "splide"]),
|
|
1453
|
+
currency: z16.string(),
|
|
1454
|
+
currencySymbol: z16.string(),
|
|
1455
|
+
domain: z16.string(),
|
|
1456
|
+
enabledJquery: z16.boolean(),
|
|
1457
|
+
enabledPresentmentCurrencies: z16.array(z16.string()),
|
|
1458
|
+
hasSmartCollectionsEnabled: z16.boolean(),
|
|
1459
|
+
hasSmartSearchEnabled: z16.boolean(),
|
|
1460
|
+
id: z16.coerce.number(),
|
|
1461
|
+
integrations: z16.record(
|
|
1462
|
+
z16.enum([
|
|
1356
1463
|
"attentive",
|
|
1357
1464
|
"judgeme",
|
|
1358
1465
|
"junip",
|
|
@@ -1365,46 +1472,46 @@ var ShopConfig = z10.object({
|
|
|
1365
1472
|
"stamped",
|
|
1366
1473
|
"yotpo"
|
|
1367
1474
|
]),
|
|
1368
|
-
|
|
1475
|
+
z16.union([z16.boolean(), z16.unknown()])
|
|
1369
1476
|
),
|
|
1370
|
-
markets:
|
|
1371
|
-
enabled:
|
|
1477
|
+
markets: z16.object({
|
|
1478
|
+
enabled: z16.boolean()
|
|
1372
1479
|
}),
|
|
1373
|
-
monetize:
|
|
1374
|
-
publisherKey:
|
|
1480
|
+
monetize: z16.object({
|
|
1481
|
+
publisherKey: z16.string().nullable()
|
|
1375
1482
|
}).nullish(),
|
|
1376
|
-
moneyFormat:
|
|
1377
|
-
myshopifyDomain:
|
|
1378
|
-
primaryLocale:
|
|
1379
|
-
productGroupsEnabled:
|
|
1380
|
-
rechargeCustomDomain:
|
|
1381
|
-
sellingPlansEnabled:
|
|
1382
|
-
shopId:
|
|
1383
|
-
shopifySellingPlansEnabled:
|
|
1384
|
-
shopName:
|
|
1385
|
-
storefrontAccessToken:
|
|
1386
|
-
useRebuyIcons:
|
|
1483
|
+
moneyFormat: z16.string(),
|
|
1484
|
+
myshopifyDomain: z16.string(),
|
|
1485
|
+
primaryLocale: z16.string(),
|
|
1486
|
+
productGroupsEnabled: z16.enum(["no", "yes"]).transform((value) => value === "yes"),
|
|
1487
|
+
rechargeCustomDomain: z16.string().nullable(),
|
|
1488
|
+
sellingPlansEnabled: z16.boolean(),
|
|
1489
|
+
shopId: z16.number(),
|
|
1490
|
+
shopifySellingPlansEnabled: z16.boolean(),
|
|
1491
|
+
shopName: z16.string(),
|
|
1492
|
+
storefrontAccessToken: z16.string().nullable(),
|
|
1493
|
+
useRebuyIcons: z16.boolean()
|
|
1387
1494
|
});
|
|
1388
1495
|
|
|
1389
1496
|
// src/schema/userConfig.ts
|
|
1390
|
-
import { z as
|
|
1391
|
-
var UserConfig =
|
|
1497
|
+
import { z as z17 } from "zod";
|
|
1498
|
+
var UserConfig = z17.object({
|
|
1392
1499
|
shop: ShopConfig,
|
|
1393
1500
|
/**
|
|
1394
1501
|
* `.catch(undefined)` is the safety bar: smart-cart shape drift can NEVER fail `fetchUserConfig`,
|
|
1395
1502
|
* which resolves the apiKey for every offers/monetize/analytics/gift request.
|
|
1396
1503
|
*/
|
|
1397
1504
|
smartCart: SmartCartConfig.nullish().catch(void 0),
|
|
1398
|
-
smartFlows:
|
|
1505
|
+
smartFlows: z17.array(z17.unknown())
|
|
1399
1506
|
});
|
|
1400
1507
|
|
|
1401
1508
|
// src/schema/widgetData.ts
|
|
1402
|
-
import { z as
|
|
1509
|
+
import { z as z48 } from "zod";
|
|
1403
1510
|
|
|
1404
1511
|
// src/schema/widgets/abTestingPlaceholder.ts
|
|
1405
|
-
import { z as
|
|
1406
|
-
var ABTestingPlaceholder =
|
|
1407
|
-
type:
|
|
1512
|
+
import { z as z18 } from "zod";
|
|
1513
|
+
var ABTestingPlaceholder = z18.looseObject({
|
|
1514
|
+
type: z18.literal("placeholder")
|
|
1408
1515
|
});
|
|
1409
1516
|
|
|
1410
1517
|
// src/schema/widgets/checkout-and-beyond/constants.ts
|
|
@@ -1517,6 +1624,8 @@ var languageKeys = [
|
|
|
1517
1624
|
"zh"
|
|
1518
1625
|
];
|
|
1519
1626
|
var LanguageKey = freezeEnum(languageKeys);
|
|
1627
|
+
var layoutFrames = ["callout", "offer-content"];
|
|
1628
|
+
var LayoutFrame = freezeEnum(layoutFrames);
|
|
1520
1629
|
var mutatorEvents = ["item_added", "quantity_changed", "variant_selected"];
|
|
1521
1630
|
var MutatorEvent = freezeEnum(mutatorEvents);
|
|
1522
1631
|
var objectFits = ["cover", "contain"];
|
|
@@ -1561,6 +1670,7 @@ var sectionTypes = [
|
|
|
1561
1670
|
"progressBar",
|
|
1562
1671
|
"quantity",
|
|
1563
1672
|
"reviews",
|
|
1673
|
+
"separator",
|
|
1564
1674
|
"text",
|
|
1565
1675
|
"variants"
|
|
1566
1676
|
];
|
|
@@ -1664,26 +1774,26 @@ var targetAreas = {
|
|
|
1664
1774
|
};
|
|
1665
1775
|
|
|
1666
1776
|
// src/schema/widgets/checkoutExtension.ts
|
|
1667
|
-
import { z as
|
|
1668
|
-
var CheckoutExtension =
|
|
1669
|
-
type:
|
|
1777
|
+
import { z as z19 } from "zod";
|
|
1778
|
+
var CheckoutExtension = z19.looseObject({
|
|
1779
|
+
type: z19.literal(WidgetType.shopify_checkout_extension).default(WidgetType.shopify_checkout_extension)
|
|
1670
1780
|
});
|
|
1671
1781
|
|
|
1672
1782
|
// src/schema/widgets/contentBlock.ts
|
|
1673
|
-
import { z as
|
|
1783
|
+
import { z as z42 } from "zod";
|
|
1674
1784
|
|
|
1675
1785
|
// src/schema/widgets/checkout-and-beyond/root.ts
|
|
1676
|
-
import { z as
|
|
1786
|
+
import { z as z41 } from "zod";
|
|
1677
1787
|
|
|
1678
1788
|
// src/schema/widgets/checkout-and-beyond/layout.ts
|
|
1679
|
-
import { v7 as
|
|
1680
|
-
import { z as
|
|
1789
|
+
import { v7 as uuidv713 } from "uuid";
|
|
1790
|
+
import { z as z40 } from "zod";
|
|
1681
1791
|
|
|
1682
1792
|
// src/schema/widgets/checkout-and-beyond/shared.ts
|
|
1683
|
-
import { z as
|
|
1793
|
+
import { z as z39 } from "zod";
|
|
1684
1794
|
|
|
1685
1795
|
// src/schema/widgets/checkout-and-beyond/banner.ts
|
|
1686
|
-
import { z as
|
|
1796
|
+
import { z as z20 } from "zod";
|
|
1687
1797
|
|
|
1688
1798
|
// src/schema/widgets/checkout-and-beyond/utils.ts
|
|
1689
1799
|
import { isPlainObject as isPlainObject2 } from "es-toolkit";
|
|
@@ -1761,11 +1871,11 @@ var isTextType = isSectionType(SectionType.text);
|
|
|
1761
1871
|
var isVariantsType = isSectionType(SectionType.variants);
|
|
1762
1872
|
|
|
1763
1873
|
// src/schema/widgets/checkout-and-beyond/banner.ts
|
|
1764
|
-
var CABBannerSection =
|
|
1874
|
+
var CABBannerSection = z20.lazy(
|
|
1765
1875
|
() => CABLayoutSection.omit({ sectionType: true }).extend({
|
|
1766
|
-
buttonField:
|
|
1767
|
-
color:
|
|
1768
|
-
dismissible:
|
|
1876
|
+
buttonField: z20.enum(buttonFields).optional(),
|
|
1877
|
+
color: z20.enum(bannerColors).default("info"),
|
|
1878
|
+
dismissible: z20.boolean().default(true),
|
|
1769
1879
|
/**
|
|
1770
1880
|
* The `s-banner` heading — localized content (a buyer can see a merchant-composed banner). Absent OR
|
|
1771
1881
|
* blank ⇒ no heading; the renderer emits no heading slot for `''` rather than an empty one.
|
|
@@ -1781,18 +1891,18 @@ var CABBannerSection = z14.lazy(
|
|
|
1781
1891
|
* not a 500. Nothing emits `heading` yet; the first converter that maps merchant banner copy into it
|
|
1782
1892
|
* either strips first or teaches `normalizeTextContent` to strip this field.
|
|
1783
1893
|
*/
|
|
1784
|
-
heading:
|
|
1785
|
-
sectionType:
|
|
1894
|
+
heading: z20.record(z20.string(), z20.string().refine(checkForHTML, NO_HTML)).optional(),
|
|
1895
|
+
sectionType: z20.literal(SectionType.banner).default(SectionType.banner)
|
|
1786
1896
|
})
|
|
1787
1897
|
);
|
|
1788
1898
|
|
|
1789
1899
|
// src/schema/widgets/checkout-and-beyond/button.ts
|
|
1790
1900
|
import { v7 as uuidv73 } from "uuid";
|
|
1791
|
-
import { z as
|
|
1901
|
+
import { z as z25 } from "zod";
|
|
1792
1902
|
|
|
1793
1903
|
// src/schema/widgets/checkout-and-beyond/image.ts
|
|
1794
1904
|
import { v7 as uuidv7 } from "uuid";
|
|
1795
|
-
import { z as
|
|
1905
|
+
import { z as z23 } from "zod";
|
|
1796
1906
|
|
|
1797
1907
|
// src/schema/widgets/checkout-and-beyond/icons.ts
|
|
1798
1908
|
var iconNames = [
|
|
@@ -1879,10 +1989,10 @@ var iconTones = ["auto", "critical", "custom", "info", "neutral", "success", "wa
|
|
|
1879
1989
|
var IconTone = freezeEnum(iconTones);
|
|
1880
1990
|
|
|
1881
1991
|
// src/schema/widgets/checkout-and-beyond/variables.ts
|
|
1882
|
-
import { z as
|
|
1992
|
+
import { z as z22 } from "zod";
|
|
1883
1993
|
|
|
1884
1994
|
// src/schema/widgets/checkout-and-beyond/rule.ts
|
|
1885
|
-
import { z as
|
|
1995
|
+
import { z as z21 } from "zod";
|
|
1886
1996
|
var ruleTypes = [
|
|
1887
1997
|
"cart",
|
|
1888
1998
|
"cart_count",
|
|
@@ -1901,7 +2011,7 @@ var ruleTypes = [
|
|
|
1901
2011
|
"product_type",
|
|
1902
2012
|
"product_vendor"
|
|
1903
2013
|
];
|
|
1904
|
-
var ruleType =
|
|
2014
|
+
var ruleType = z21.enum(ruleTypes);
|
|
1905
2015
|
var RuleType = ruleType.enum;
|
|
1906
2016
|
var ruleOperators = [
|
|
1907
2017
|
"after",
|
|
@@ -1916,124 +2026,124 @@ var ruleOperators = [
|
|
|
1916
2026
|
"greater_than",
|
|
1917
2027
|
"less_than"
|
|
1918
2028
|
];
|
|
1919
|
-
var ruleOperator =
|
|
2029
|
+
var ruleOperator = z21.enum(ruleOperators);
|
|
1920
2030
|
var RuleOperator = ruleOperator.enum;
|
|
1921
|
-
var RuleCondition =
|
|
1922
|
-
operator:
|
|
1923
|
-
products:
|
|
1924
|
-
type:
|
|
1925
|
-
value:
|
|
2031
|
+
var RuleCondition = z21.object({
|
|
2032
|
+
operator: z21.enum(ruleOperators).default(RuleOperator.anything),
|
|
2033
|
+
products: z21.union([z21.array(z21.unknown()), z21.strictObject({}).transform(() => [])]).default(() => []),
|
|
2034
|
+
type: z21.enum(ruleTypes).default(RuleType.cart_subtotal),
|
|
2035
|
+
value: z21.coerce.string().default("")
|
|
1926
2036
|
});
|
|
1927
|
-
var RuleLogicBlock =
|
|
1928
|
-
rules:
|
|
2037
|
+
var RuleLogicBlock = z21.object({
|
|
2038
|
+
rules: z21.array(RuleCondition).default(() => [])
|
|
1929
2039
|
});
|
|
1930
|
-
var CABRulesetEntry =
|
|
1931
|
-
exitIfMatched:
|
|
1932
|
-
logic:
|
|
1933
|
-
output:
|
|
1934
|
-
|
|
1935
|
-
key:
|
|
1936
|
-
type:
|
|
1937
|
-
value:
|
|
2040
|
+
var CABRulesetEntry = z21.object({
|
|
2041
|
+
exitIfMatched: z21.boolean().default(true),
|
|
2042
|
+
logic: z21.array(RuleLogicBlock).default(() => []),
|
|
2043
|
+
output: z21.array(
|
|
2044
|
+
z21.object({
|
|
2045
|
+
key: z21.string().default("should_show"),
|
|
2046
|
+
type: z21.literal("data_json").default("data_json"),
|
|
2047
|
+
value: z21.string().default("true")
|
|
1938
2048
|
})
|
|
1939
2049
|
).default(() => [{ key: "should_show", type: "data_json", value: "true" }])
|
|
1940
2050
|
});
|
|
1941
|
-
var CABRuleset =
|
|
2051
|
+
var CABRuleset = z21.union([z21.array(CABRulesetEntry), z21.strictObject({}).transform(() => [])]).default(() => []);
|
|
1942
2052
|
|
|
1943
2053
|
// src/schema/widgets/checkout-and-beyond/variables.ts
|
|
1944
|
-
var variableEffect =
|
|
1945
|
-
var CABVariableSeed =
|
|
1946
|
-
dataSourceId:
|
|
2054
|
+
var variableEffect = z22.enum(variableEffects);
|
|
2055
|
+
var CABVariableSeed = z22.object({
|
|
2056
|
+
dataSourceId: z22.number().nullable().default(null),
|
|
1947
2057
|
ruleset: CABRuleset
|
|
1948
2058
|
});
|
|
1949
|
-
var CABBooleanVariable =
|
|
2059
|
+
var CABBooleanVariable = z22.object({
|
|
1950
2060
|
/**
|
|
1951
2061
|
* Holds until the first seed verdict lands (and forever, for unseeded variables). Omitted, it derives
|
|
1952
2062
|
* from seededness — `false` with a `seed` (visibility is EARNED), `true` without — via the transform
|
|
1953
2063
|
* below; a cross-field default has no `.default()` spelling. An explicit value always wins.
|
|
1954
2064
|
*/
|
|
1955
|
-
defaultValue:
|
|
1956
|
-
name:
|
|
2065
|
+
defaultValue: z22.boolean().optional(),
|
|
2066
|
+
name: z22.string().min(1),
|
|
1957
2067
|
seed: CABVariableSeed.optional(),
|
|
1958
2068
|
/** Defaulted so every stored declaration (all boolean before `text` existed) parses unchanged. */
|
|
1959
|
-
type:
|
|
2069
|
+
type: z22.literal(VariableType.boolean).default(VariableType.boolean)
|
|
1960
2070
|
});
|
|
1961
|
-
var CABTextVariable =
|
|
1962
|
-
defaultValue:
|
|
1963
|
-
name:
|
|
1964
|
-
seed:
|
|
1965
|
-
type:
|
|
2071
|
+
var CABTextVariable = z22.object({
|
|
2072
|
+
defaultValue: z22.string(),
|
|
2073
|
+
name: z22.string().min(1),
|
|
2074
|
+
seed: z22.never().optional(),
|
|
2075
|
+
type: z22.literal(VariableType.text)
|
|
1966
2076
|
});
|
|
1967
|
-
var CABNumberVariable =
|
|
1968
|
-
defaultValue:
|
|
1969
|
-
name:
|
|
1970
|
-
seed:
|
|
1971
|
-
type:
|
|
2077
|
+
var CABNumberVariable = z22.object({
|
|
2078
|
+
defaultValue: z22.number(),
|
|
2079
|
+
name: z22.string().min(1),
|
|
2080
|
+
seed: z22.never().optional(),
|
|
2081
|
+
type: z22.literal(VariableType.number)
|
|
1972
2082
|
});
|
|
1973
|
-
var CABVariable =
|
|
2083
|
+
var CABVariable = z22.union([CABTextVariable, CABNumberVariable, CABBooleanVariable]).transform(
|
|
1974
2084
|
(variable) => variable.type === VariableType.boolean ? { ...variable, defaultValue: variable.defaultValue ?? variable.seed === void 0 } : variable
|
|
1975
2085
|
);
|
|
1976
|
-
var CABVariableEffect =
|
|
2086
|
+
var CABVariableEffect = z22.object({
|
|
1977
2087
|
effect: variableEffect.default(VariableEffect.toggle),
|
|
1978
|
-
variable:
|
|
2088
|
+
variable: z22.string().min(1)
|
|
1979
2089
|
});
|
|
1980
|
-
var CABVisibility =
|
|
1981
|
-
variable:
|
|
1982
|
-
visibleWhen:
|
|
2090
|
+
var CABVisibility = z22.object({
|
|
2091
|
+
variable: z22.string().min(1),
|
|
2092
|
+
visibleWhen: z22.boolean().default(true)
|
|
1983
2093
|
});
|
|
1984
|
-
var contentOperator =
|
|
1985
|
-
var resultCountOperator =
|
|
1986
|
-
var resultTagOperator =
|
|
1987
|
-
var mutatorEvent =
|
|
1988
|
-
var CABContentTrigger =
|
|
2094
|
+
var contentOperator = z22.enum(contentOperators);
|
|
2095
|
+
var resultCountOperator = z22.enum(resultCountOperators);
|
|
2096
|
+
var resultTagOperator = z22.enum(resultTagOperators);
|
|
2097
|
+
var mutatorEvent = z22.enum(mutatorEvents);
|
|
2098
|
+
var CABContentTrigger = z22.object({
|
|
1989
2099
|
operator: contentOperator.default(ContentOperator.is_empty),
|
|
1990
|
-
type:
|
|
2100
|
+
type: z22.literal("content")
|
|
1991
2101
|
});
|
|
1992
|
-
var CABResultCountTrigger =
|
|
2102
|
+
var CABResultCountTrigger = z22.object({
|
|
1993
2103
|
operator: resultCountOperator.default(ResultCountOperator.equals),
|
|
1994
|
-
type:
|
|
1995
|
-
value:
|
|
2104
|
+
type: z22.literal("result_count"),
|
|
2105
|
+
value: z22.number().default(0)
|
|
1996
2106
|
});
|
|
1997
|
-
var CABResultTagTrigger =
|
|
2107
|
+
var CABResultTagTrigger = z22.object({
|
|
1998
2108
|
operator: resultTagOperator.default(ResultTagOperator.contains),
|
|
1999
|
-
type:
|
|
2000
|
-
value:
|
|
2109
|
+
type: z22.literal("result_tag"),
|
|
2110
|
+
value: z22.string().min(1)
|
|
2001
2111
|
});
|
|
2002
|
-
var CABEventTrigger =
|
|
2112
|
+
var CABEventTrigger = z22.object({
|
|
2003
2113
|
event: mutatorEvent,
|
|
2004
|
-
type:
|
|
2114
|
+
type: z22.literal("event")
|
|
2005
2115
|
});
|
|
2006
|
-
var CABVariableTrigger =
|
|
2116
|
+
var CABVariableTrigger = z22.discriminatedUnion("type", [
|
|
2007
2117
|
CABContentTrigger,
|
|
2008
2118
|
CABEventTrigger,
|
|
2009
2119
|
CABResultCountTrigger,
|
|
2010
2120
|
CABResultTagTrigger
|
|
2011
2121
|
]);
|
|
2012
|
-
var CABVariableMutator =
|
|
2122
|
+
var CABVariableMutator = z22.object({
|
|
2013
2123
|
effect: variableEffect.default(VariableEffect.set_false),
|
|
2014
|
-
variable:
|
|
2124
|
+
variable: z22.string().min(1),
|
|
2015
2125
|
when: CABVariableTrigger
|
|
2016
2126
|
});
|
|
2017
2127
|
var CABVariableFields = {
|
|
2018
|
-
mutators:
|
|
2019
|
-
variables:
|
|
2128
|
+
mutators: z22.array(CABVariableMutator).optional(),
|
|
2129
|
+
variables: z22.array(CABVariable).refine((variables) => new Set(variables.map(({ name }) => name)).size === variables.length, {
|
|
2020
2130
|
message: "variable names must be unique within a section"
|
|
2021
2131
|
}).optional(),
|
|
2022
2132
|
visibility: CABVisibility.optional()
|
|
2023
2133
|
};
|
|
2024
2134
|
|
|
2025
2135
|
// src/schema/widgets/checkout-and-beyond/image.ts
|
|
2026
|
-
var CABImageSectionFields =
|
|
2136
|
+
var CABImageSectionFields = z23.object({
|
|
2027
2137
|
...CABVariableFields,
|
|
2028
|
-
altText:
|
|
2138
|
+
altText: z23.string().refine(checkForHTML, NO_HTML).default(""),
|
|
2029
2139
|
/**
|
|
2030
2140
|
* Image width÷height (e.g. `46` for the progress-bar fill); `null` renders at natural size. Any POSITIVE
|
|
2031
2141
|
* ratio — never limited to 1, but never `0`/negative either: a renderer dividing by it would get `Infinity`,
|
|
2032
2142
|
* and CSS `aspect-ratio` drops a negative value and silently reverts to natural size.
|
|
2033
2143
|
*/
|
|
2034
|
-
aspectRatio:
|
|
2035
|
-
border:
|
|
2036
|
-
buttonField:
|
|
2144
|
+
aspectRatio: z23.number().positive().nullable().default(null),
|
|
2145
|
+
border: z23.lazy(() => CABBorder),
|
|
2146
|
+
buttonField: z23.enum(buttonFields).optional(),
|
|
2037
2147
|
/**
|
|
2038
2148
|
* `icon` renders `source` as a single `s-icon` by name (the uber-image path covers icons too), reading
|
|
2039
2149
|
* `iconSize`/`iconTone`. The other values are a harmless informational holdover from the previous
|
|
@@ -2052,29 +2162,29 @@ var CABImageSectionFields = z17.object({
|
|
|
2052
2162
|
* behavior degraded gracefully and told us about it. The client-assembled half of the invariant was never
|
|
2053
2163
|
* the risky half.
|
|
2054
2164
|
*/
|
|
2055
|
-
category:
|
|
2165
|
+
category: z23.enum(["gallery", "icon", "icons", "payment-methods", "secure-checkout"]).nullable().default(null),
|
|
2056
2166
|
/** `icon`-mode only: the `s-icon` `size`; `null` ⇒ the component default (`base`). Ignored by image treatments. */
|
|
2057
|
-
iconSize:
|
|
2167
|
+
iconSize: z23.enum(iconSizes).nullable().default(null),
|
|
2058
2168
|
/** `icon`-mode only: the `s-icon` `tone`; `null` ⇒ the component default (`auto`). Ignored by image treatments. */
|
|
2059
|
-
iconTone:
|
|
2060
|
-
name:
|
|
2061
|
-
naturalHeight:
|
|
2062
|
-
naturalWidth:
|
|
2169
|
+
iconTone: z23.enum(iconTones).nullable().default(null),
|
|
2170
|
+
name: z23.string().optional(),
|
|
2171
|
+
naturalHeight: z23.number().default(0),
|
|
2172
|
+
naturalWidth: z23.number().default(0),
|
|
2063
2173
|
/**
|
|
2064
2174
|
* `contain` (the component default): dimensionless images render in s-image's 1/1 default frame, and
|
|
2065
2175
|
* `cover` would crop non-square art (payment badges lost their edges — 15993); `contain` letterboxes.
|
|
2066
2176
|
*/
|
|
2067
|
-
objectFit:
|
|
2068
|
-
sectionId:
|
|
2069
|
-
sectionType:
|
|
2177
|
+
objectFit: z23.enum(objectFits).default(ObjectFit.contain),
|
|
2178
|
+
sectionId: z23.uuid().default(() => uuidv7()),
|
|
2179
|
+
sectionType: z23.literal(SectionType.image).default(SectionType.image),
|
|
2070
2180
|
/**
|
|
2071
2181
|
* An image URL or dynamic token, an empty default, or — when `category: 'icon'` — an icon NAME. Icon mode
|
|
2072
2182
|
* takes a name or `''` only, NOT a token: no renderer resolves a token to an icon today, so accepting one
|
|
2073
2183
|
* would promise a capability that doesn't exist. Widen the refine's carve-out to `DYNAMIC_TOKEN_REGEX` when a
|
|
2074
2184
|
* server-chosen tier icon actually needs it.
|
|
2075
2185
|
*/
|
|
2076
|
-
source:
|
|
2077
|
-
width:
|
|
2186
|
+
source: z23.union([z23.url(), z23.literal(""), z23.string().regex(DYNAMIC_TOKEN_REGEX), z23.enum(iconNames)]).default(""),
|
|
2187
|
+
width: z23.number().default(100)
|
|
2078
2188
|
});
|
|
2079
2189
|
var iconNameSet = new Set(iconNames);
|
|
2080
2190
|
var isIconName = (source) => iconNameSet.has(source);
|
|
@@ -2096,71 +2206,71 @@ var CABImageSection = CABImageSectionFields.superRefine(({ category, source }, c
|
|
|
2096
2206
|
// src/schema/widgets/checkout-and-beyond/text.ts
|
|
2097
2207
|
import { forEach, isString as isString2 } from "es-toolkit/compat";
|
|
2098
2208
|
import { v7 as uuidv72 } from "uuid";
|
|
2099
|
-
import { z as
|
|
2100
|
-
var enumOrOmit = (...vals) =>
|
|
2101
|
-
var TiptapText =
|
|
2102
|
-
marks:
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
attrs:
|
|
2109
|
-
class:
|
|
2110
|
-
href:
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2209
|
+
import { z as z24 } from "zod";
|
|
2210
|
+
var enumOrOmit = (...vals) => z24.string().transform((val) => vals.includes(val) ? val : void 0).optional();
|
|
2211
|
+
var TiptapText = z24.object({
|
|
2212
|
+
marks: z24.union([
|
|
2213
|
+
z24.array(
|
|
2214
|
+
z24.discriminatedUnion("type", [
|
|
2215
|
+
z24.object({ type: z24.literal("bold") }),
|
|
2216
|
+
z24.object({ type: z24.literal("italic") }),
|
|
2217
|
+
z24.object({
|
|
2218
|
+
attrs: z24.object({
|
|
2219
|
+
class: z24.string().nullable(),
|
|
2220
|
+
href: z24.union([
|
|
2221
|
+
z24.url(),
|
|
2222
|
+
z24.literal("#"),
|
|
2223
|
+
z24.string().regex(DYNAMIC_TOKEN_REGEX),
|
|
2224
|
+
z24.string().regex(ROOT_RELATIVE_PATH_REGEX)
|
|
2115
2225
|
]),
|
|
2116
|
-
rel:
|
|
2117
|
-
target:
|
|
2226
|
+
rel: z24.string().default("noopener noreferrer nofollow"),
|
|
2227
|
+
target: z24.string().default("_blank")
|
|
2118
2228
|
}),
|
|
2119
|
-
type:
|
|
2229
|
+
type: z24.literal("link")
|
|
2120
2230
|
}),
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
attrs:
|
|
2231
|
+
z24.object({ type: z24.literal("strike") }),
|
|
2232
|
+
z24.object({
|
|
2233
|
+
attrs: z24.object({
|
|
2124
2234
|
color: enumOrOmit(...textColorNames).default(TextColorName.base),
|
|
2125
2235
|
fontSize: enumOrOmit(...textSizeNames).default(TextSizeName.base)
|
|
2126
2236
|
}),
|
|
2127
|
-
type:
|
|
2237
|
+
type: z24.literal("textStyle")
|
|
2128
2238
|
})
|
|
2129
2239
|
])
|
|
2130
2240
|
),
|
|
2131
|
-
|
|
2241
|
+
z24.strictObject({}).transform(() => [])
|
|
2132
2242
|
]).optional(),
|
|
2133
|
-
text:
|
|
2134
|
-
type:
|
|
2243
|
+
text: z24.string().default(""),
|
|
2244
|
+
type: z24.literal("text").default("text")
|
|
2135
2245
|
});
|
|
2136
|
-
var TiptapParagraph =
|
|
2137
|
-
attrs:
|
|
2246
|
+
var TiptapParagraph = z24.object({
|
|
2247
|
+
attrs: z24.object({
|
|
2138
2248
|
textAlign: enumOrOmit(...textAlignments)
|
|
2139
2249
|
}).default({ textAlign: TextAlignment.start }),
|
|
2140
|
-
content:
|
|
2141
|
-
type:
|
|
2250
|
+
content: z24.union([z24.array(TiptapText), z24.strictObject({}).transform(() => [])]).default(() => []),
|
|
2251
|
+
type: z24.literal("paragraph").default("paragraph")
|
|
2142
2252
|
});
|
|
2143
|
-
var TiptapDocument =
|
|
2144
|
-
attrs:
|
|
2253
|
+
var TiptapDocument = z24.object({
|
|
2254
|
+
attrs: z24.object({
|
|
2145
2255
|
blockSpacing: enumOrOmit(...spacings)
|
|
2146
2256
|
}).default({ blockSpacing: Spacing.base }),
|
|
2147
|
-
content:
|
|
2148
|
-
type:
|
|
2257
|
+
content: z24.union([z24.array(TiptapParagraph), z24.strictObject({}).transform(() => [])]).default(() => [TiptapParagraph.parse({})]),
|
|
2258
|
+
type: z24.literal("doc").default("doc")
|
|
2149
2259
|
});
|
|
2150
|
-
var CABTextTier =
|
|
2151
|
-
threshold:
|
|
2152
|
-
thresholds:
|
|
2153
|
-
tierId:
|
|
2154
|
-
tierType:
|
|
2260
|
+
var CABTextTier = z24.object({
|
|
2261
|
+
threshold: z24.number().int().nonnegative(),
|
|
2262
|
+
thresholds: z24.record(z24.string(), z24.number().int().nonnegative()).default(() => ({})),
|
|
2263
|
+
tierId: z24.string().optional(),
|
|
2264
|
+
tierType: z24.enum(progressTierTypes).default(ProgressTierType.shipping)
|
|
2155
2265
|
});
|
|
2156
|
-
var CABTextSection =
|
|
2266
|
+
var CABTextSection = z24.object({
|
|
2157
2267
|
...CABVariableFields,
|
|
2158
|
-
buttonField:
|
|
2159
|
-
content:
|
|
2160
|
-
name:
|
|
2161
|
-
optionId:
|
|
2162
|
-
sectionId:
|
|
2163
|
-
sectionType:
|
|
2268
|
+
buttonField: z24.enum(buttonFields).optional(),
|
|
2269
|
+
content: z24.record(z24.string(), z24.union([z24.string(), TiptapDocument]).refine(checkForHTML, NO_HTML).optional()).default({ en: TiptapDocument.parse({}) }).optional(),
|
|
2270
|
+
name: z24.string().optional(),
|
|
2271
|
+
optionId: z24.number().optional(),
|
|
2272
|
+
sectionId: z24.uuid().default(() => uuidv72()),
|
|
2273
|
+
sectionType: z24.literal(SectionType.text).default(SectionType.text),
|
|
2164
2274
|
tier: CABTextTier.optional()
|
|
2165
2275
|
}).superRefine(({ buttonField, content }, ctx) => {
|
|
2166
2276
|
if (buttonField === ButtonField.destinationUrl && content) {
|
|
@@ -2182,35 +2292,35 @@ var CABTextSection = z18.object({
|
|
|
2182
2292
|
});
|
|
2183
2293
|
|
|
2184
2294
|
// src/schema/widgets/checkout-and-beyond/button.ts
|
|
2185
|
-
var CABButtonContent =
|
|
2186
|
-
() =>
|
|
2295
|
+
var CABButtonContent = z25.lazy(
|
|
2296
|
+
() => z25.discriminatedUnion("sectionType", [CABImageSection, CABLayoutSection, CABTextSection])
|
|
2187
2297
|
);
|
|
2188
|
-
var CABButtonSection =
|
|
2298
|
+
var CABButtonSection = z25.object({
|
|
2189
2299
|
...CABVariableFields,
|
|
2190
|
-
action:
|
|
2191
|
-
buttonStyle:
|
|
2192
|
-
custom:
|
|
2193
|
-
color:
|
|
2194
|
-
height:
|
|
2195
|
-
width:
|
|
2300
|
+
action: z25.union([z25.literal(""), z25.enum(buttonActions)]).default(""),
|
|
2301
|
+
buttonStyle: z25.enum(buttonStyles).default(ButtonStyle.primary),
|
|
2302
|
+
custom: z25.object({
|
|
2303
|
+
color: z25.string().regex(HEX_COLOR_REGEX).default("#005bd3"),
|
|
2304
|
+
height: z25.number().default(52),
|
|
2305
|
+
width: z25.number().default(300)
|
|
2196
2306
|
}).default({
|
|
2197
2307
|
color: "#005bd3",
|
|
2198
2308
|
height: 52,
|
|
2199
2309
|
width: 300
|
|
2200
2310
|
}),
|
|
2201
|
-
disableDowngrade:
|
|
2202
|
-
name:
|
|
2203
|
-
optionId:
|
|
2204
|
-
popover:
|
|
2205
|
-
alignment:
|
|
2206
|
-
position:
|
|
2311
|
+
disableDowngrade: z25.boolean().default(false),
|
|
2312
|
+
name: z25.string().optional(),
|
|
2313
|
+
optionId: z25.number().optional(),
|
|
2314
|
+
popover: z25.object({
|
|
2315
|
+
alignment: z25.enum(textAlignments).default(TextAlignment.center),
|
|
2316
|
+
position: z25.enum(popoverPositions).default(PopoverPosition.blockStart)
|
|
2207
2317
|
}).optional().default(() => ({
|
|
2208
2318
|
alignment: TextAlignment.center,
|
|
2209
2319
|
position: PopoverPosition.blockStart
|
|
2210
2320
|
})),
|
|
2211
|
-
sectionId:
|
|
2212
|
-
sections:
|
|
2213
|
-
sectionType:
|
|
2321
|
+
sectionId: z25.uuid().default(() => uuidv73()),
|
|
2322
|
+
sections: z25.union([z25.array(CABButtonContent), z25.strictObject({}).transform(() => [])]).default(() => []),
|
|
2323
|
+
sectionType: z25.literal(SectionType.button).default(SectionType.button),
|
|
2214
2324
|
/**
|
|
2215
2325
|
* The smart-cart tier this button acts on (`addGift`/`removeGift`): scopes the click to one tier's gift. The
|
|
2216
2326
|
* client resolves the tier's gift (productId) from the progress-bar context by this `tierId` — the button node
|
|
@@ -2225,91 +2335,91 @@ var CABButtonSection = z19.object({
|
|
|
2225
2335
|
* lookup finds no tier and the click resolves to nothing. Safe to bound — the field is new, so there are no
|
|
2226
2336
|
* stored payloads to grandfather, and the producer is client code, not a merchant form.
|
|
2227
2337
|
*/
|
|
2228
|
-
tier:
|
|
2338
|
+
tier: z25.object({ tierId: z25.string().min(1) }).optional(),
|
|
2229
2339
|
/** Fire-and-forget pixel POSTed when the button is clicked (e.g. a Monetize decline). */
|
|
2230
|
-
trackingUrl:
|
|
2340
|
+
trackingUrl: z25.string().optional(),
|
|
2231
2341
|
/**
|
|
2232
2342
|
* Secondary effects applied to in-scope variables on click, alongside (never instead of) the primary
|
|
2233
2343
|
* `action` — an `addToOrder` button can also flip a variable. Applied in array order.
|
|
2234
2344
|
*/
|
|
2235
|
-
variableEffects:
|
|
2345
|
+
variableEffects: z25.array(CABVariableEffect).optional()
|
|
2236
2346
|
});
|
|
2237
2347
|
|
|
2238
2348
|
// src/schema/widgets/checkout-and-beyond/carousel.ts
|
|
2239
|
-
import { z as
|
|
2349
|
+
import { z as z30 } from "zod";
|
|
2240
2350
|
|
|
2241
2351
|
// src/schema/widgets/checkout-and-beyond/offers.ts
|
|
2242
|
-
import { z as
|
|
2352
|
+
import { z as z29 } from "zod";
|
|
2243
2353
|
|
|
2244
2354
|
// src/schema/widgets/checkout-and-beyond/dataSource.ts
|
|
2245
2355
|
import { v7 as uuidv74 } from "uuid";
|
|
2246
|
-
import { z as
|
|
2247
|
-
var CABDiscount =
|
|
2248
|
-
amount:
|
|
2249
|
-
discountedBy:
|
|
2250
|
-
discountedFrom:
|
|
2251
|
-
type:
|
|
2356
|
+
import { z as z26 } from "zod";
|
|
2357
|
+
var CABDiscount = z26.object({
|
|
2358
|
+
amount: z26.union([z26.number(), z26.string()]).catch(0),
|
|
2359
|
+
discountedBy: z26.string().optional(),
|
|
2360
|
+
discountedFrom: z26.enum(discountSources).optional().catch(void 0),
|
|
2361
|
+
type: z26.enum(discountTypes).catch("none")
|
|
2252
2362
|
});
|
|
2253
|
-
var CABIntegrations =
|
|
2254
|
-
judgeme:
|
|
2255
|
-
junip:
|
|
2256
|
-
klaviyo:
|
|
2257
|
-
loox:
|
|
2258
|
-
okendo:
|
|
2259
|
-
opinew:
|
|
2260
|
-
reviewsio:
|
|
2261
|
-
stamped:
|
|
2262
|
-
yotpo:
|
|
2363
|
+
var CABIntegrations = z26.object({
|
|
2364
|
+
judgeme: z26.boolean().default(false),
|
|
2365
|
+
junip: z26.boolean().default(false),
|
|
2366
|
+
klaviyo: z26.boolean().default(false),
|
|
2367
|
+
loox: z26.boolean().default(false),
|
|
2368
|
+
okendo: z26.boolean().default(false),
|
|
2369
|
+
opinew: z26.boolean().default(false),
|
|
2370
|
+
reviewsio: z26.boolean().default(false),
|
|
2371
|
+
stamped: z26.boolean().default(false),
|
|
2372
|
+
yotpo: z26.boolean().default(false)
|
|
2263
2373
|
});
|
|
2264
|
-
var CABDataSourceSection =
|
|
2265
|
-
dataSourceId:
|
|
2266
|
-
dataSourcePath:
|
|
2374
|
+
var CABDataSourceSection = z26.object({
|
|
2375
|
+
dataSourceId: z26.number().nullable().default(null),
|
|
2376
|
+
dataSourcePath: z26.string().default(DEFAULT_ENDPOINTS[0].value),
|
|
2267
2377
|
discount: CABDiscount.optional(),
|
|
2268
2378
|
integrations: CABIntegrations.optional(),
|
|
2269
|
-
limit:
|
|
2270
|
-
matchVariant:
|
|
2271
|
-
matchVariantOutOfStock:
|
|
2272
|
-
name:
|
|
2273
|
-
productType:
|
|
2274
|
-
sectionId:
|
|
2275
|
-
sectionType:
|
|
2379
|
+
limit: z26.number().default(1),
|
|
2380
|
+
matchVariant: z26.boolean().default(false),
|
|
2381
|
+
matchVariantOutOfStock: z26.boolean().default(false),
|
|
2382
|
+
name: z26.string().default(DEFAULT_ENDPOINTS[0].label),
|
|
2383
|
+
productType: z26.enum(productTypes).optional(),
|
|
2384
|
+
sectionId: z26.uuid().default(() => uuidv74()),
|
|
2385
|
+
sectionType: z26.literal(SectionType.dataSource).default(SectionType.dataSource),
|
|
2276
2386
|
/** Default subscribe-vs-one-time for `productType: both` (legacy `subscription_is_default`). */
|
|
2277
|
-
subscriptionIsDefault:
|
|
2278
|
-
treatAsGwp:
|
|
2387
|
+
subscriptionIsDefault: z26.boolean().default(false),
|
|
2388
|
+
treatAsGwp: z26.boolean().default(false)
|
|
2279
2389
|
});
|
|
2280
2390
|
|
|
2281
2391
|
// src/schema/widgets/checkout-and-beyond/products.ts
|
|
2282
2392
|
import { v7 as uuidv76 } from "uuid";
|
|
2283
|
-
import { z as
|
|
2393
|
+
import { z as z28 } from "zod";
|
|
2284
2394
|
|
|
2285
2395
|
// src/schema/widgets/checkout-and-beyond/product.ts
|
|
2286
2396
|
import { v7 as uuidv75 } from "uuid";
|
|
2287
|
-
import { z as
|
|
2288
|
-
var CABVariantContent =
|
|
2289
|
-
() =>
|
|
2397
|
+
import { z as z27 } from "zod";
|
|
2398
|
+
var CABVariantContent = z27.lazy(
|
|
2399
|
+
() => z27.discriminatedUnion("sectionType", [CABButtonSection, CABTextSection])
|
|
2290
2400
|
);
|
|
2291
|
-
var CABProductSection =
|
|
2401
|
+
var CABProductSection = z27.object({
|
|
2292
2402
|
...CABVariableFields,
|
|
2293
|
-
name:
|
|
2294
|
-
productId:
|
|
2295
|
-
sectionId:
|
|
2296
|
-
sections:
|
|
2297
|
-
sectionType:
|
|
2298
|
-
selectors:
|
|
2299
|
-
variantMode:
|
|
2403
|
+
name: z27.string().optional(),
|
|
2404
|
+
productId: z27.number().nullable().default(null),
|
|
2405
|
+
sectionId: z27.uuid().default(() => uuidv75()),
|
|
2406
|
+
sections: z27.union([z27.array(CABVariantContent), z27.strictObject({}).transform(() => [])]).default(() => []),
|
|
2407
|
+
sectionType: z27.literal(SectionType.product).default(SectionType.product),
|
|
2408
|
+
selectors: z27.record(z27.string(), z27.enum(variantSelectors).default(VariantSelector.menu)).default(() => ({})),
|
|
2409
|
+
variantMode: z27.enum(variantModes).default(VariantMode.multiple)
|
|
2300
2410
|
});
|
|
2301
2411
|
|
|
2302
2412
|
// src/schema/widgets/checkout-and-beyond/products.ts
|
|
2303
|
-
var CABProductsSection =
|
|
2413
|
+
var CABProductsSection = z28.object({
|
|
2304
2414
|
...CABVariableFields,
|
|
2305
|
-
name:
|
|
2306
|
-
sectionId:
|
|
2307
|
-
sections:
|
|
2308
|
-
sectionType:
|
|
2415
|
+
name: z28.string().optional(),
|
|
2416
|
+
sectionId: z28.uuid().default(() => uuidv76()),
|
|
2417
|
+
sections: z28.union([z28.array(z28.lazy(() => CABProductSection)), z28.strictObject({}).transform(() => [])]).default(() => []),
|
|
2418
|
+
sectionType: z28.literal(SectionType.products).default(SectionType.products)
|
|
2309
2419
|
});
|
|
2310
2420
|
|
|
2311
2421
|
// src/schema/widgets/checkout-and-beyond/offers.ts
|
|
2312
|
-
var CABOffersSection =
|
|
2422
|
+
var CABOffersSection = z29.lazy(
|
|
2313
2423
|
() => CABLayoutSection.omit({ sections: true, sectionType: true }).extend({
|
|
2314
2424
|
/**
|
|
2315
2425
|
* A rule between consecutive cards in the vertical list — legacy checkout-offers' `<Divider />`,
|
|
@@ -2317,8 +2427,8 @@ var CABOffersSection = z23.lazy(
|
|
|
2317
2427
|
* run of products). Optional, not defaulted: only the v1 converter sets it (REB-24265); a
|
|
2318
2428
|
* hand-built tree keeps React CAB's dividerless rendering.
|
|
2319
2429
|
*/
|
|
2320
|
-
divider:
|
|
2321
|
-
sections:
|
|
2430
|
+
divider: z29.boolean().optional(),
|
|
2431
|
+
sections: z29.union([z29.array(z29.lazy(() => CABSection)), z29.strictObject({}).transform(() => [])]).default(() => [
|
|
2322
2432
|
CABBannerSection.parse({
|
|
2323
2433
|
buttonField: "undoAddToOrder",
|
|
2324
2434
|
color: "success",
|
|
@@ -2332,77 +2442,77 @@ var CABOffersSection = z23.lazy(
|
|
|
2332
2442
|
CABDataSourceSection.parse({}),
|
|
2333
2443
|
CABProductsSection.parse({})
|
|
2334
2444
|
]),
|
|
2335
|
-
sectionType:
|
|
2445
|
+
sectionType: z29.literal(SectionType.offers).default(SectionType.offers)
|
|
2336
2446
|
})
|
|
2337
2447
|
);
|
|
2338
2448
|
|
|
2339
2449
|
// src/schema/widgets/checkout-and-beyond/carousel.ts
|
|
2340
|
-
var CABCarouselSection =
|
|
2450
|
+
var CABCarouselSection = z30.lazy(
|
|
2341
2451
|
() => CABLayoutSection.omit({ sections: true, sectionType: true }).extend({
|
|
2342
|
-
autoAdvanceInterval:
|
|
2343
|
-
itemsAtOnce:
|
|
2452
|
+
autoAdvanceInterval: z30.number().default(0),
|
|
2453
|
+
itemsAtOnce: z30.number().min(1).default(1),
|
|
2344
2454
|
/** Card arrangement for the offers child (`horizontal` = side-by-side) — NOT the carousel's own `direction`. */
|
|
2345
|
-
offersDirection:
|
|
2346
|
-
sections:
|
|
2347
|
-
sectionType:
|
|
2455
|
+
offersDirection: z30.enum(offersDirections).default("vertical"),
|
|
2456
|
+
sections: z30.union([z30.array(z30.lazy(() => CABSection)), z30.strictObject({}).transform(() => [])]).default(() => [CABOffersSection.parse({})]),
|
|
2457
|
+
sectionType: z30.literal(SectionType.carousel).default(SectionType.carousel)
|
|
2348
2458
|
})
|
|
2349
2459
|
);
|
|
2350
2460
|
|
|
2351
2461
|
// src/schema/widgets/checkout-and-beyond/cartLine.ts
|
|
2352
|
-
import { z as
|
|
2353
|
-
var CABCartLineSection =
|
|
2462
|
+
import { z as z31 } from "zod";
|
|
2463
|
+
var CABCartLineSection = z31.lazy(
|
|
2354
2464
|
() => CABLayoutSection.omit({ sections: true, sectionType: true }).extend({
|
|
2355
|
-
sections:
|
|
2356
|
-
sectionType:
|
|
2465
|
+
sections: z31.union([z31.array(z31.lazy(() => CABSection)), z31.strictObject({}).transform(() => [])]).default(() => [CABButtonSection.parse({ action: ButtonAction.switchToSubscription })]),
|
|
2466
|
+
sectionType: z31.literal(SectionType.cartLine).default(SectionType.cartLine)
|
|
2357
2467
|
})
|
|
2358
2468
|
);
|
|
2359
2469
|
|
|
2360
2470
|
// src/schema/widgets/checkout-and-beyond/discount.ts
|
|
2361
2471
|
import { v7 as uuidv77 } from "uuid";
|
|
2362
|
-
import { z as
|
|
2363
|
-
var CABDiscountSection =
|
|
2472
|
+
import { z as z32 } from "zod";
|
|
2473
|
+
var CABDiscountSection = z32.object({
|
|
2364
2474
|
...CABVariableFields,
|
|
2365
|
-
amount:
|
|
2366
|
-
discountedBy:
|
|
2367
|
-
discountedFrom:
|
|
2368
|
-
message:
|
|
2369
|
-
name:
|
|
2370
|
-
quantity:
|
|
2371
|
-
sectionId:
|
|
2372
|
-
sectionType:
|
|
2373
|
-
type:
|
|
2475
|
+
amount: z32.union([z32.number(), z32.string()]).catch(0),
|
|
2476
|
+
discountedBy: z32.string().optional(),
|
|
2477
|
+
discountedFrom: z32.enum(discountSources).optional().catch(void 0),
|
|
2478
|
+
message: z32.string().optional(),
|
|
2479
|
+
name: z32.string().optional(),
|
|
2480
|
+
quantity: z32.number().default(1),
|
|
2481
|
+
sectionId: z32.uuid().default(() => uuidv77()),
|
|
2482
|
+
sectionType: z32.literal(SectionType.discount).default(SectionType.discount),
|
|
2483
|
+
type: z32.enum(discountTypes).catch("none")
|
|
2374
2484
|
});
|
|
2375
2485
|
|
|
2376
2486
|
// src/schema/widgets/checkout-and-beyond/monetize.ts
|
|
2377
2487
|
import { v7 as uuidv78 } from "uuid";
|
|
2378
|
-
import { z as
|
|
2379
|
-
var CABMonetizeAds =
|
|
2380
|
-
requestId:
|
|
2488
|
+
import { z as z33 } from "zod";
|
|
2489
|
+
var CABMonetizeAds = z33.object({
|
|
2490
|
+
requestId: z33.string().optional(),
|
|
2381
2491
|
/** Defaulted here, never in the beacon: absence of information is `ads` itself being absent. */
|
|
2382
|
-
testing:
|
|
2492
|
+
testing: z33.boolean().default(false)
|
|
2383
2493
|
});
|
|
2384
|
-
var CABMonetizeSection =
|
|
2494
|
+
var CABMonetizeSection = z33.object({
|
|
2385
2495
|
...CABVariableFields,
|
|
2386
2496
|
ads: CABMonetizeAds.optional(),
|
|
2387
|
-
name:
|
|
2497
|
+
name: z33.string().optional(),
|
|
2388
2498
|
/**
|
|
2389
2499
|
* Server-hydrated offer cards (inline hydration): when `/cab/sections` was asked with a `monetize`
|
|
2390
2500
|
* context block, the composed cards ride the marker itself — `[]` means "hydrated, no fill" (render
|
|
2391
2501
|
* nothing, skip the fetch); ABSENT means "not hydrated" (the client fetches via `/cab/monetize`).
|
|
2392
2502
|
*/
|
|
2393
|
-
offers:
|
|
2503
|
+
offers: z33.array(z33.lazy(() => CABSection)).optional(),
|
|
2394
2504
|
/** 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. */
|
|
2395
|
-
privacyPolicyUrl:
|
|
2396
|
-
sectionId:
|
|
2397
|
-
sectionType:
|
|
2505
|
+
privacyPolicyUrl: z33.string().optional(),
|
|
2506
|
+
sectionId: z33.uuid().default(() => uuidv78()),
|
|
2507
|
+
sectionType: z33.literal(SectionType.monetize).default(SectionType.monetize),
|
|
2398
2508
|
/** Ads-taxonomy sub-vertical id (the widget's `sub_vertical` setting); paired with `vertical`. */
|
|
2399
|
-
subVertical:
|
|
2509
|
+
subVertical: z33.string().optional(),
|
|
2400
2510
|
/** Ads-taxonomy vertical id (the widget's `vertical` setting) — with `subVertical`, the admin Monetize editor's two configurables. */
|
|
2401
|
-
vertical:
|
|
2511
|
+
vertical: z33.string().optional()
|
|
2402
2512
|
});
|
|
2403
2513
|
|
|
2404
2514
|
// src/schema/widgets/checkout-and-beyond/progressBar.ts
|
|
2405
|
-
import { z as
|
|
2515
|
+
import { z as z34 } from "zod";
|
|
2406
2516
|
|
|
2407
2517
|
// src/schema/widgets/checkout-and-beyond/giftLabels.ts
|
|
2408
2518
|
var GIFT_LABELS = {
|
|
@@ -2521,34 +2631,34 @@ var GIFT_LABELS = {
|
|
|
2521
2631
|
};
|
|
2522
2632
|
|
|
2523
2633
|
// src/schema/widgets/checkout-and-beyond/progressBar.ts
|
|
2524
|
-
var CABProgressTierExclusion =
|
|
2525
|
-
collectionIds:
|
|
2526
|
-
productIds:
|
|
2527
|
-
tags:
|
|
2528
|
-
type:
|
|
2634
|
+
var CABProgressTierExclusion = z34.object({
|
|
2635
|
+
collectionIds: z34.array(z34.number().int().positive()).default(() => []),
|
|
2636
|
+
productIds: z34.array(z34.number().int().positive()).default(() => []),
|
|
2637
|
+
tags: z34.array(z34.string().min(1)).default(() => []),
|
|
2638
|
+
type: z34.enum(progressTierExclusionTypes)
|
|
2529
2639
|
});
|
|
2530
|
-
var CABProgressTier =
|
|
2640
|
+
var CABProgressTier = z34.object({
|
|
2531
2641
|
/**
|
|
2532
2642
|
* Order-discount tiers only (onsite `discount`): the reward the order-discount Function applies at
|
|
2533
2643
|
* cart time, carried so the client can resolve the `{{discountAmount}}` token in this tier's copy.
|
|
2534
2644
|
* `fixedAmount`: shop-currency CENTS (FX-scaled by the client, like {@link CABProgressTier.threshold});
|
|
2535
2645
|
* `percentage`: the whole-percent number rendered raw (`{n}%`). Absent on non-discount tiers.
|
|
2536
2646
|
*/
|
|
2537
|
-
discount:
|
|
2647
|
+
discount: z34.object({ amount: z34.number().nonnegative(), type: z34.enum(["fixedAmount", "percentage"]) }).optional(),
|
|
2538
2648
|
/**
|
|
2539
2649
|
* Per-tier exclusion rules (onsite `exclusions` when `exclusions_enabled`): lines they match don't count
|
|
2540
2650
|
* toward this tier. Empty (the default, and the converter's output for a disabled or ruleless tier) means
|
|
2541
2651
|
* the tier measures the plain bar-level adjusted progress. Consumers read ONLY the list named by the rule's
|
|
2542
2652
|
* `type` — the converter leaves the other two at `[]`, so a populated off-type list never reaches the tree.
|
|
2543
2653
|
*/
|
|
2544
|
-
exclusions:
|
|
2654
|
+
exclusions: z34.array(CABProgressTierExclusion).default(() => []),
|
|
2545
2655
|
/**
|
|
2546
2656
|
* Smart-cart product (gift) tiers only (onsite `filter_oos_variants`): when set, the client drops this
|
|
2547
2657
|
* tier entirely once its gift has NO in-stock eligible variant — the milestone, fill slot and gift
|
|
2548
2658
|
* controls all disappear, mirroring onsite removing the tier from `bar.tiers` before it renders. Absent
|
|
2549
2659
|
* on shipping/discount/decorative tiers and left off by default (the tier renders regardless of stock).
|
|
2550
2660
|
*/
|
|
2551
|
-
filterOosVariants:
|
|
2661
|
+
filterOosVariants: z34.boolean().default(false),
|
|
2552
2662
|
/**
|
|
2553
2663
|
* Smart-cart product (gift) tiers only: the reward unlocked at this tier. The client enriches
|
|
2554
2664
|
* `productId`/`variantIds` to live variants (availability, price) and adds the chosen one to the cart
|
|
@@ -2556,10 +2666,10 @@ var CABProgressTier = z28.object({
|
|
|
2556
2666
|
* tiers and on tiers with no configured product. Cart add/remove is a later stage; carried here so the
|
|
2557
2667
|
* tree is complete.
|
|
2558
2668
|
*/
|
|
2559
|
-
gift:
|
|
2560
|
-
productId:
|
|
2561
|
-
title:
|
|
2562
|
-
variantIds:
|
|
2669
|
+
gift: z34.object({
|
|
2670
|
+
productId: z34.number().int().positive(),
|
|
2671
|
+
title: z34.string().optional(),
|
|
2672
|
+
variantIds: z34.array(z34.number().int().positive()).default(() => [])
|
|
2563
2673
|
}).optional(),
|
|
2564
2674
|
/**
|
|
2565
2675
|
* The step-row icon's square size in PIXELS (onsite `product_tier_element_size`, an admin px string the
|
|
@@ -2579,7 +2689,7 @@ var CABProgressTier = z28.object({
|
|
|
2579
2689
|
* renderer never spells a fallback), which also makes a tree authored before this field render at
|
|
2580
2690
|
* React's size rather than the old hardcoded 20.
|
|
2581
2691
|
*/
|
|
2582
|
-
iconSizePx:
|
|
2692
|
+
iconSizePx: z34.number().int().min(1).max(64).default(18),
|
|
2583
2693
|
/**
|
|
2584
2694
|
* The step-row label at this tier's slot (onsite `getTierLabel`): the merchant custom label, else the
|
|
2585
2695
|
* type default — 'Free Shipping' or '{n}% Discount'. A PRODUCT tier gets NO converter label: its name is
|
|
@@ -2589,35 +2699,35 @@ var CABProgressTier = z28.object({
|
|
|
2589
2699
|
* turns a blank label into an absent key, and a client-authored blank means the same thing — the renderer
|
|
2590
2700
|
* emits no caption slot rather than an empty one). Plain text — a compact icon+label.
|
|
2591
2701
|
*/
|
|
2592
|
-
label:
|
|
2702
|
+
label: z34.record(z34.string(), z34.string()).optional(),
|
|
2593
2703
|
/**
|
|
2594
2704
|
* Smart-cart product (gift) tiers only (onsite `product_tier_image`): show the gift's product image in
|
|
2595
2705
|
* the step-row slot instead of the generic bag icon. The converter can't supply the image URL (config
|
|
2596
2706
|
* carries only product IDs), so the client resolves it (authoritative Shopify featured image, React
|
|
2597
2707
|
* parity) and falls back to the bag icon when the flag is off or no image resolves. Default false.
|
|
2598
2708
|
*/
|
|
2599
|
-
productTierImage:
|
|
2709
|
+
productTierImage: z34.boolean().default(false),
|
|
2600
2710
|
/**
|
|
2601
2711
|
* The tier's goal, measured per `unit`. `currency` (default): SHOP-currency cents — the canonical
|
|
2602
2712
|
* fallback: when the buyer's presentment currency has no entry in `thresholds`, the client
|
|
2603
2713
|
* multiplies this by the live FX rate (converter maps the v1 `unlock_price`, e.g. `75` → `7500`).
|
|
2604
2714
|
* `item`: a raw item count — no cents, no FX, no `thresholds` overrides.
|
|
2605
2715
|
*/
|
|
2606
|
-
threshold:
|
|
2716
|
+
threshold: z34.number().int().nonnegative(),
|
|
2607
2717
|
/**
|
|
2608
2718
|
* Per-presentment-currency goal overrides — lowercased ISO currency code → cents (e.g. `{ cad: 9900 }`).
|
|
2609
2719
|
* When the buyer's currency has an entry, the client uses it verbatim INSTEAD of FX-converting
|
|
2610
2720
|
* `threshold`, so merchants show intentional, clean per-market amounts (Shopify Markets) rather than a
|
|
2611
2721
|
* converted base. Defaults to `{}` — no overrides means always fall back to `threshold`.
|
|
2612
2722
|
*/
|
|
2613
|
-
thresholds:
|
|
2723
|
+
thresholds: z34.record(z34.string(), z34.number().int().nonnegative()).default(() => ({})),
|
|
2614
2724
|
/**
|
|
2615
2725
|
* Smart-cart tier identifier, mirrored onto the gift cart line's `_tier` attribute so the client can
|
|
2616
2726
|
* match an in-cart gift back to its tier (add on reach, remove on downgrade/decline). Absent on the
|
|
2617
2727
|
* shipping bar (single unlabeled tier, no gift).
|
|
2618
2728
|
*/
|
|
2619
|
-
tierId:
|
|
2620
|
-
tierType:
|
|
2729
|
+
tierId: z34.string().optional(),
|
|
2730
|
+
tierType: z34.enum(progressTierTypes).default(ProgressTierType.shipping),
|
|
2621
2731
|
/**
|
|
2622
2732
|
* What this tier's progress is measured in — PER TIER (onsite's `unlock_condition_type` model, NOT
|
|
2623
2733
|
* the React port's bar-level `tiers[0]` shortcut). `currency` compares money cents against the
|
|
@@ -2628,9 +2738,9 @@ var CABProgressTier = z28.object({
|
|
|
2628
2738
|
* count carries no injected noun (no English `item`/`items` inflection on localized copy); merchant
|
|
2629
2739
|
* template text supplies grammatically-neutral wording around the token.
|
|
2630
2740
|
*/
|
|
2631
|
-
unit:
|
|
2741
|
+
unit: z34.enum(progressTierUnits).default(ProgressTierUnit.currency)
|
|
2632
2742
|
});
|
|
2633
|
-
var CABProgressBarSection =
|
|
2743
|
+
var CABProgressBarSection = z34.lazy(
|
|
2634
2744
|
() => CABLayoutSection.omit({ sectionType: true }).extend({
|
|
2635
2745
|
/**
|
|
2636
2746
|
* The onsite bar id (smart-cart TPB bars only). The client mirrors it to the cart's `_barId` attribute
|
|
@@ -2639,35 +2749,35 @@ var CABProgressBarSection = z28.lazy(
|
|
|
2639
2749
|
* checkout reaches the extension without it, so the client writes it or the tier gift's 100% discount
|
|
2640
2750
|
* (and any tier order discount) never applies. Absent on the v1 shipping bar (no gift tiers, no id).
|
|
2641
2751
|
*/
|
|
2642
|
-
barId:
|
|
2752
|
+
barId: z34.string().optional(),
|
|
2643
2753
|
/** Empty = shown everywhere; otherwise uppercase ISO country codes. */
|
|
2644
|
-
countryCodes:
|
|
2754
|
+
countryCodes: z34.array(z34.string().transform((code) => code.trim().toUpperCase())).default(() => []),
|
|
2645
2755
|
/**
|
|
2646
2756
|
* Uppercase ISO codes where a higher-precedence geo bar applies, so this (default, non-geo) bar is
|
|
2647
2757
|
* hidden there — replicates React `getbar`'s geo-match-over-default precedence. Empty = never excluded.
|
|
2648
2758
|
*/
|
|
2649
|
-
excludeCountryCodes:
|
|
2759
|
+
excludeCountryCodes: z34.array(z34.string().transform((code) => code.trim().toUpperCase())).default(() => []),
|
|
2650
2760
|
/**
|
|
2651
2761
|
* Measure progress against the PRE-discount subtotal (onsite `exclude_discount_in_subtotal`, and
|
|
2652
2762
|
* forced on for bars with a discount tier so its own reward can't un-reach the tier). The client
|
|
2653
2763
|
* adds the cart's discount allocations back to the live subtotal.
|
|
2654
2764
|
*/
|
|
2655
|
-
excludeDiscountInSubtotal:
|
|
2765
|
+
excludeDiscountInSubtotal: z34.boolean().default(false),
|
|
2656
2766
|
/** Variant ids the client subtracts from the adjusted subtotal (React `bar.excluded_products`). */
|
|
2657
|
-
excludedVariantIds:
|
|
2767
|
+
excludedVariantIds: z34.array(z34.number().int().positive()).default(() => []),
|
|
2658
2768
|
/**
|
|
2659
2769
|
* When the cart holds a subscription item, treat the bar as reached regardless of subtotal (React
|
|
2660
2770
|
* `free_shipping_on_subscription(s)`). `freeShippingOnAll` is already a zero-threshold tier instead.
|
|
2661
2771
|
*/
|
|
2662
|
-
freeShippingOnSubscription:
|
|
2772
|
+
freeShippingOnSubscription: z34.boolean().default(false),
|
|
2663
2773
|
/** Localized heading over the gift controls (onsite `gift_area_title`, default 'FREE GIFTS'). */
|
|
2664
|
-
giftAreaTitle:
|
|
2774
|
+
giftAreaTitle: z34.record(z34.string(), z34.string()).default(() => ({ en: "FREE GIFTS" })),
|
|
2665
2775
|
/** Localized gift-control labels (add/remove/heading); a tier's gift `title` beats `yourGift`. */
|
|
2666
|
-
giftLabels:
|
|
2667
|
-
addGift:
|
|
2668
|
-
remove:
|
|
2669
|
-
selectOptions:
|
|
2670
|
-
yourGift:
|
|
2776
|
+
giftLabels: z34.object({
|
|
2777
|
+
addGift: z34.record(z34.string(), z34.string()).default(() => ({ ...GIFT_LABELS.addGift })),
|
|
2778
|
+
remove: z34.record(z34.string(), z34.string()).default(() => ({ ...GIFT_LABELS.remove })),
|
|
2779
|
+
selectOptions: z34.record(z34.string(), z34.string()).default(() => ({ ...GIFT_LABELS.selectOptions })),
|
|
2780
|
+
yourGift: z34.record(z34.string(), z34.string()).default(() => ({ ...GIFT_LABELS.yourGift }))
|
|
2671
2781
|
}).default(() => ({
|
|
2672
2782
|
addGift: { ...GIFT_LABELS.addGift },
|
|
2673
2783
|
remove: { ...GIFT_LABELS.remove },
|
|
@@ -2675,38 +2785,38 @@ var CABProgressBarSection = z28.lazy(
|
|
|
2675
2785
|
yourGift: { ...GIFT_LABELS.yourGift }
|
|
2676
2786
|
})),
|
|
2677
2787
|
/** The bar's a11y label; the merchant names it in the editor, else this default (React parity). */
|
|
2678
|
-
name:
|
|
2788
|
+
name: z34.string().default("Order progress"),
|
|
2679
2789
|
/**
|
|
2680
2790
|
* Bar fill color. An explicit (widget-authored) value is used verbatim; when absent the server
|
|
2681
2791
|
* fills it with the live shop theme's `buttonBackground` (React `useRebuyTheme` parity). Still
|
|
2682
2792
|
* absent after that ⇒ the theme fetch failed and the client renders its platform-default bar —
|
|
2683
2793
|
* optional, not defaulted, so "merchant chose no color" stays distinguishable from any real value.
|
|
2684
2794
|
*/
|
|
2685
|
-
progressColor:
|
|
2686
|
-
sectionType:
|
|
2795
|
+
progressColor: z34.string().optional(),
|
|
2796
|
+
sectionType: z34.literal(SectionType.progressBar).default(SectionType.progressBar),
|
|
2687
2797
|
/**
|
|
2688
2798
|
* The bar's milestones in the merchant's CONFIGURED order — the renderer does NOT sort them (022
|
|
2689
2799
|
* O-B2: sorting by resolved threshold reversed configured milestones on out-of-order or mixed-unit
|
|
2690
2800
|
* count-vs-cents bars). Drives the fill (even slot per tier) and, for smart-cart product tiers, the
|
|
2691
2801
|
* gift add/remove. The visual tier display lives in `sections` (composable), NOT here.
|
|
2692
2802
|
*/
|
|
2693
|
-
tiers:
|
|
2803
|
+
tiers: z34.union([z34.array(CABProgressTier), z34.strictObject({}).transform(() => [])]).default(() => [])
|
|
2694
2804
|
})
|
|
2695
2805
|
);
|
|
2696
2806
|
|
|
2697
2807
|
// src/schema/widgets/checkout-and-beyond/quantity.ts
|
|
2698
2808
|
import { v7 as uuidv79 } from "uuid";
|
|
2699
|
-
import { z as
|
|
2700
|
-
var CABQuantitySection =
|
|
2809
|
+
import { z as z35 } from "zod";
|
|
2810
|
+
var CABQuantitySection = z35.object({
|
|
2701
2811
|
...CABVariableFields,
|
|
2702
|
-
errorMessages:
|
|
2703
|
-
|
|
2704
|
-
|
|
2812
|
+
errorMessages: z35.record(
|
|
2813
|
+
z35.string(),
|
|
2814
|
+
z35.object({
|
|
2705
2815
|
/** `{{step}}` is interpolated at render — the off-increment message React never gave a merchant key. */
|
|
2706
|
-
increment:
|
|
2707
|
-
max:
|
|
2708
|
-
min:
|
|
2709
|
-
neg:
|
|
2816
|
+
increment: z35.string().optional(),
|
|
2817
|
+
max: z35.string().optional(),
|
|
2818
|
+
min: z35.string().optional(),
|
|
2819
|
+
neg: z35.string().optional()
|
|
2710
2820
|
})
|
|
2711
2821
|
).default({
|
|
2712
2822
|
en: {
|
|
@@ -2716,18 +2826,18 @@ var CABQuantitySection = z29.object({
|
|
|
2716
2826
|
neg: "Quantity cannot be negative"
|
|
2717
2827
|
}
|
|
2718
2828
|
}),
|
|
2719
|
-
inputType:
|
|
2720
|
-
max:
|
|
2721
|
-
min:
|
|
2829
|
+
inputType: z35.enum(quantityInputs).default(QuantityInput.select),
|
|
2830
|
+
max: z35.number().min(1).max(100).default(10),
|
|
2831
|
+
min: z35.number().min(1).default(1),
|
|
2722
2832
|
/** The a11y label for the quantity control; the merchant names it in the editor, else this default. */
|
|
2723
|
-
name:
|
|
2724
|
-
sectionId:
|
|
2725
|
-
sectionType:
|
|
2833
|
+
name: z35.string().default("Quantity"),
|
|
2834
|
+
sectionId: z35.uuid().default(() => uuidv79()),
|
|
2835
|
+
sectionType: z35.literal(SectionType.quantity).default(SectionType.quantity)
|
|
2726
2836
|
});
|
|
2727
2837
|
|
|
2728
2838
|
// src/schema/widgets/checkout-and-beyond/reviews.ts
|
|
2729
2839
|
import { v7 as uuidv710 } from "uuid";
|
|
2730
|
-
import { z as
|
|
2840
|
+
import { z as z36 } from "zod";
|
|
2731
2841
|
|
|
2732
2842
|
// src/schema/widgets/checkout-and-beyond/reviewLabels.ts
|
|
2733
2843
|
var REVIEW_LABELS = {
|
|
@@ -2790,50 +2900,61 @@ var REVIEW_LABELS = {
|
|
|
2790
2900
|
};
|
|
2791
2901
|
|
|
2792
2902
|
// src/schema/widgets/checkout-and-beyond/reviews.ts
|
|
2793
|
-
var CABReviewsSection =
|
|
2903
|
+
var CABReviewsSection = z36.object({
|
|
2794
2904
|
...CABVariableFields,
|
|
2795
|
-
color:
|
|
2905
|
+
color: z36.string().default("#fadb14"),
|
|
2796
2906
|
/**
|
|
2797
2907
|
* Localized review-count templates (`{{reviewCount}}`), one/other plural forms; the client picks the
|
|
2798
2908
|
* form via `Intl.PluralRules`. Defaults here (schema-first) so every tree localizes without converter
|
|
2799
2909
|
* or merchant work.
|
|
2800
2910
|
*/
|
|
2801
|
-
countLabels:
|
|
2802
|
-
one:
|
|
2803
|
-
other:
|
|
2911
|
+
countLabels: z36.object({
|
|
2912
|
+
one: z36.record(z36.string(), z36.string()).default(() => ({ ...REVIEW_LABELS.one })),
|
|
2913
|
+
other: z36.record(z36.string(), z36.string()).default(() => ({ ...REVIEW_LABELS.other }))
|
|
2804
2914
|
}).default(() => ({ one: { ...REVIEW_LABELS.one }, other: { ...REVIEW_LABELS.other } })),
|
|
2805
|
-
name:
|
|
2806
|
-
sectionId:
|
|
2807
|
-
sectionType:
|
|
2808
|
-
size:
|
|
2915
|
+
name: z36.string().optional(),
|
|
2916
|
+
sectionId: z36.uuid().default(() => uuidv710()),
|
|
2917
|
+
sectionType: z36.literal(SectionType.reviews).default(SectionType.reviews),
|
|
2918
|
+
size: z36.enum(reviewsSizes).default(ReviewsSize.default),
|
|
2919
|
+
strokeColor: z36.string().default("#fadb14"),
|
|
2920
|
+
strokeWidth: z36.number().nonnegative().default(0)
|
|
2921
|
+
});
|
|
2922
|
+
|
|
2923
|
+
// src/schema/widgets/checkout-and-beyond/separator.ts
|
|
2924
|
+
import { v7 as uuidv711 } from "uuid";
|
|
2925
|
+
import { z as z37 } from "zod";
|
|
2926
|
+
var CABSeparatorSection = z37.object({
|
|
2927
|
+
...CABVariableFields,
|
|
2928
|
+
sectionId: z37.uuid().default(() => uuidv711()),
|
|
2929
|
+
sectionType: z37.literal(SectionType.separator).default(SectionType.separator)
|
|
2809
2930
|
});
|
|
2810
2931
|
|
|
2811
2932
|
// src/schema/widgets/checkout-and-beyond/variants.ts
|
|
2812
2933
|
import { slice } from "es-toolkit/compat";
|
|
2813
|
-
import { v7 as
|
|
2814
|
-
import { z as
|
|
2815
|
-
var CABVariantsSection =
|
|
2934
|
+
import { v7 as uuidv712 } from "uuid";
|
|
2935
|
+
import { z as z38 } from "zod";
|
|
2936
|
+
var CABVariantsSection = z38.object({
|
|
2816
2937
|
...CABVariableFields,
|
|
2817
|
-
hideOutOfStockVariants:
|
|
2818
|
-
name:
|
|
2819
|
-
sectionId:
|
|
2820
|
-
sectionType:
|
|
2821
|
-
selector:
|
|
2822
|
-
variantMode:
|
|
2938
|
+
hideOutOfStockVariants: z38.boolean().default(false),
|
|
2939
|
+
name: z38.string().optional(),
|
|
2940
|
+
sectionId: z38.uuid().default(() => uuidv712()),
|
|
2941
|
+
sectionType: z38.literal(SectionType.variants).default(SectionType.variants),
|
|
2942
|
+
selector: z38.enum(slice(variantSelectors, 0, 3)).default(VariantSelector.menu),
|
|
2943
|
+
variantMode: z38.enum(variantModes).default(VariantMode.multiple)
|
|
2823
2944
|
});
|
|
2824
2945
|
|
|
2825
2946
|
// src/schema/widgets/checkout-and-beyond/shared.ts
|
|
2826
|
-
var CABBorder =
|
|
2827
|
-
radius:
|
|
2828
|
-
style:
|
|
2829
|
-
width:
|
|
2947
|
+
var CABBorder = z39.object({
|
|
2948
|
+
radius: z39.enum(borderRadii).default(BorderRadius.base),
|
|
2949
|
+
style: z39.enum(borderStyles).default(BorderStyle.none),
|
|
2950
|
+
width: z39.enum(borderWidths).default(BorderWidth.base)
|
|
2830
2951
|
}).default({
|
|
2831
2952
|
radius: BorderRadius.base,
|
|
2832
2953
|
style: BorderStyle.none,
|
|
2833
2954
|
width: BorderWidth.base
|
|
2834
2955
|
});
|
|
2835
|
-
var CABSection =
|
|
2836
|
-
() =>
|
|
2956
|
+
var CABSection = z39.lazy(
|
|
2957
|
+
() => z39.discriminatedUnion("sectionType", [
|
|
2837
2958
|
CABBannerSection,
|
|
2838
2959
|
CABButtonSection,
|
|
2839
2960
|
CABCarouselSection,
|
|
@@ -2849,38 +2970,49 @@ var CABSection = z32.lazy(
|
|
|
2849
2970
|
CABProgressBarSection,
|
|
2850
2971
|
CABQuantitySection,
|
|
2851
2972
|
CABReviewsSection,
|
|
2973
|
+
CABSeparatorSection,
|
|
2852
2974
|
CABTextSection,
|
|
2853
2975
|
CABVariantsSection
|
|
2854
2976
|
])
|
|
2855
2977
|
);
|
|
2856
2978
|
|
|
2857
2979
|
// src/schema/widgets/checkout-and-beyond/layout.ts
|
|
2858
|
-
var GridItem =
|
|
2859
|
-
var
|
|
2980
|
+
var GridItem = z40.union([z40.literal("auto"), z40.literal("fill"), z40.string().regex(/^\d+%$/), z40.number()]);
|
|
2981
|
+
var CABLayoutWrapping = z40.object({
|
|
2982
|
+
breakAt: z40.number().positive(),
|
|
2983
|
+
maxPerLine: z40.number().int().positive()
|
|
2984
|
+
});
|
|
2985
|
+
var CABLayoutSection = z40.object({
|
|
2860
2986
|
...CABVariableFields,
|
|
2861
|
-
alignment:
|
|
2862
|
-
horizontal:
|
|
2863
|
-
vertical:
|
|
2987
|
+
alignment: z40.object({
|
|
2988
|
+
horizontal: z40.enum(horizontalAlignments).default(HorizontalAlignment.start),
|
|
2989
|
+
vertical: z40.enum(verticalAlignments).default(VerticalAlignment.top)
|
|
2864
2990
|
}).default({
|
|
2865
2991
|
horizontal: HorizontalAlignment.start,
|
|
2866
2992
|
vertical: VerticalAlignment.top
|
|
2867
2993
|
}),
|
|
2868
|
-
border:
|
|
2869
|
-
buttonField:
|
|
2870
|
-
direction:
|
|
2871
|
-
|
|
2872
|
-
|
|
2873
|
-
|
|
2994
|
+
border: z40.lazy(() => CABBorder),
|
|
2995
|
+
buttonField: z40.enum(buttonFields).optional(),
|
|
2996
|
+
direction: z40.enum(directions).default(Direction.rows),
|
|
2997
|
+
/**
|
|
2998
|
+
* Platform chrome around the section, not a layout behavior: `callout` is a subdued box with block borders
|
|
2999
|
+
* (the legacy post-purchase callout banner), `offer-content` the post-purchase offer's own content card.
|
|
3000
|
+
*/
|
|
3001
|
+
frame: z40.enum(layoutFrames).optional(),
|
|
3002
|
+
grid: z40.object({
|
|
3003
|
+
columns: z40.union([z40.array(GridItem), z40.undefined()]).default(() => ["auto"]),
|
|
3004
|
+
rows: z40.union([z40.array(GridItem), z40.undefined()]).default(() => ["auto"])
|
|
2874
3005
|
}).default({ columns: ["auto"], rows: ["auto"] }).optional(),
|
|
2875
|
-
name:
|
|
2876
|
-
padding:
|
|
2877
|
-
sectionId:
|
|
2878
|
-
sections:
|
|
2879
|
-
sectionType:
|
|
2880
|
-
spacing:
|
|
3006
|
+
name: z40.string().optional(),
|
|
3007
|
+
padding: z40.enum(spacings).default(Spacing.none),
|
|
3008
|
+
sectionId: z40.uuid().default(() => uuidv713()),
|
|
3009
|
+
sections: z40.union([z40.array(z40.lazy(() => CABSection)), z40.strictObject({}).transform(() => [])]).default(() => []),
|
|
3010
|
+
sectionType: z40.literal(SectionType.layout).default(SectionType.layout),
|
|
3011
|
+
spacing: z40.enum(spacings).default(Spacing.base),
|
|
2881
3012
|
/** Fire-and-forget impression pixel POSTed once when the section is shown (e.g. a Monetize offer view). */
|
|
2882
|
-
viewUrl:
|
|
2883
|
-
width:
|
|
3013
|
+
viewUrl: z40.string().optional(),
|
|
3014
|
+
width: z40.number().default(100),
|
|
3015
|
+
wrapping: CABLayoutWrapping.optional()
|
|
2884
3016
|
});
|
|
2885
3017
|
|
|
2886
3018
|
// src/schema/widgets/checkout-and-beyond/uiLabels.ts
|
|
@@ -2901,8 +3033,8 @@ var UI_LABELS = {
|
|
|
2901
3033
|
};
|
|
2902
3034
|
|
|
2903
3035
|
// src/schema/widgets/checkout-and-beyond/root.ts
|
|
2904
|
-
var localized = (fallback) =>
|
|
2905
|
-
var CABUILabels =
|
|
3036
|
+
var localized = (fallback) => z41.record(z41.string(), z41.string()).default(() => ({ ...fallback })).transform((labels) => Object.keys(labels).length > 0 ? labels : { ...fallback });
|
|
3037
|
+
var CABUILabels = z41.object({
|
|
2906
3038
|
currentPage: localized(UI_LABELS.currentPage),
|
|
2907
3039
|
guest: localized(UI_LABELS.guest),
|
|
2908
3040
|
loadingOptions: localized(UI_LABELS.loadingOptions),
|
|
@@ -2927,154 +3059,154 @@ var CABUILabels = z34.object({
|
|
|
2927
3059
|
subscriptionOptions: { ...UI_LABELS.subscriptionOptions },
|
|
2928
3060
|
updating: { ...UI_LABELS.updating }
|
|
2929
3061
|
}));
|
|
2930
|
-
var TargetArea =
|
|
2931
|
-
fill:
|
|
2932
|
-
flip:
|
|
2933
|
-
icon:
|
|
2934
|
-
label:
|
|
2935
|
-
width:
|
|
3062
|
+
var TargetArea = z41.object({
|
|
3063
|
+
fill: z41.boolean().optional(),
|
|
3064
|
+
flip: z41.enum(["both", "horizontal", "vertical"]).optional(),
|
|
3065
|
+
icon: z41.string(),
|
|
3066
|
+
label: z41.string(),
|
|
3067
|
+
width: z41.string()
|
|
2936
3068
|
}).default(targetAreas[EditorMode.checkoutExtension][1]);
|
|
2937
|
-
var CABTracking =
|
|
2938
|
-
enableAttribution:
|
|
2939
|
-
enableSource:
|
|
2940
|
-
enableWidget:
|
|
3069
|
+
var CABTracking = z41.object({
|
|
3070
|
+
enableAttribution: z41.boolean().nullish().transform((value) => value ?? true),
|
|
3071
|
+
enableSource: z41.boolean().nullish().transform((value) => value ?? true),
|
|
3072
|
+
enableWidget: z41.boolean().nullish().transform((value) => value ?? true)
|
|
2941
3073
|
}).nullish().transform((value) => value ?? { enableAttribution: true, enableSource: true, enableWidget: true });
|
|
2942
|
-
var CABExperiment =
|
|
2943
|
-
elementId:
|
|
2944
|
-
experimentId:
|
|
2945
|
-
experimentType:
|
|
2946
|
-
selectedId:
|
|
3074
|
+
var CABExperiment = z41.object({
|
|
3075
|
+
elementId: z41.number(),
|
|
3076
|
+
experimentId: z41.number(),
|
|
3077
|
+
experimentType: z41.string(),
|
|
3078
|
+
selectedId: z41.number()
|
|
2947
3079
|
});
|
|
2948
3080
|
var CABRootSection = CABLayoutSection.extend({
|
|
2949
|
-
editorMode:
|
|
3081
|
+
editorMode: z41.enum(editorModes).default(EditorMode.checkoutExtension),
|
|
2950
3082
|
experiment: CABExperiment.optional(),
|
|
2951
3083
|
// Same rule as CABTracking above: the v1 converters pass raw legacy `previewMode` through, so a
|
|
2952
3084
|
// `null` must fall back rather than throw the widget; malformed values still throw.
|
|
2953
|
-
previewMode:
|
|
2954
|
-
storeId:
|
|
3085
|
+
previewMode: z41.boolean().nullish().transform((value) => value ?? false),
|
|
3086
|
+
storeId: z41.number().nullable().default(null),
|
|
2955
3087
|
targetArea: TargetArea.nullable(),
|
|
2956
3088
|
tracking: CABTracking,
|
|
2957
|
-
type:
|
|
3089
|
+
type: z41.enum(widgetTypes).default(WidgetType.ui_extension_content_block),
|
|
2958
3090
|
uiLabels: CABUILabels,
|
|
2959
|
-
version:
|
|
2960
|
-
widgetId:
|
|
3091
|
+
version: z41.literal(2).default(2),
|
|
3092
|
+
widgetId: z41.number().nullable().default(null)
|
|
2961
3093
|
});
|
|
2962
3094
|
|
|
2963
3095
|
// src/schema/widgets/contentBlock.ts
|
|
2964
|
-
var ContentBlockV1 =
|
|
2965
|
-
blockSpacing:
|
|
2966
|
-
imageBlocks:
|
|
2967
|
-
|
|
2968
|
-
|
|
2969
|
-
altText:
|
|
2970
|
-
description:
|
|
2971
|
-
id:
|
|
2972
|
-
imagePlacement:
|
|
2973
|
-
imageSize:
|
|
2974
|
-
imageUrl:
|
|
2975
|
-
textAlignment:
|
|
3096
|
+
var ContentBlockV1 = z42.object({
|
|
3097
|
+
blockSpacing: z42.enum(spacings).optional(),
|
|
3098
|
+
imageBlocks: z42.union([
|
|
3099
|
+
z42.array(
|
|
3100
|
+
z42.object({
|
|
3101
|
+
altText: z42.string().nullable(),
|
|
3102
|
+
description: z42.string().nullable(),
|
|
3103
|
+
id: z42.uuid(),
|
|
3104
|
+
imagePlacement: z42.enum(["top", "right", "bottom", "left"]),
|
|
3105
|
+
imageSize: z42.number(),
|
|
3106
|
+
imageUrl: z42.url(),
|
|
3107
|
+
textAlignment: z42.enum(["left", "center", "right"]),
|
|
2976
3108
|
/** Inline scale only: an image caption can never be a block-level heading. */
|
|
2977
|
-
textSize:
|
|
3109
|
+
textSize: z42.enum(inlineTextSizeNames)
|
|
2978
3110
|
})
|
|
2979
3111
|
),
|
|
2980
|
-
|
|
3112
|
+
z42.strictObject({}).transform(() => [])
|
|
2981
3113
|
]).optional(),
|
|
2982
|
-
imageLayout:
|
|
2983
|
-
language:
|
|
2984
|
-
description:
|
|
2985
|
-
superTitle:
|
|
2986
|
-
title:
|
|
3114
|
+
imageLayout: z42.enum(["row", "column"]).optional(),
|
|
3115
|
+
language: z42.object({
|
|
3116
|
+
description: z42.string(),
|
|
3117
|
+
superTitle: z42.string(),
|
|
3118
|
+
title: z42.string()
|
|
2987
3119
|
}),
|
|
2988
|
-
previewMode:
|
|
2989
|
-
type:
|
|
2990
|
-
version:
|
|
3120
|
+
previewMode: z42.boolean(),
|
|
3121
|
+
type: z42.literal(WidgetType.ui_extension_content_block).default(WidgetType.ui_extension_content_block),
|
|
3122
|
+
version: z42.literal(1)
|
|
2991
3123
|
});
|
|
2992
|
-
var ContentBlock =
|
|
3124
|
+
var ContentBlock = z42.discriminatedUnion("version", [
|
|
2993
3125
|
ContentBlockV1,
|
|
2994
3126
|
CABRootSection.extend({
|
|
2995
|
-
type:
|
|
3127
|
+
type: z42.literal(WidgetType.ui_extension_content_block).default(WidgetType.ui_extension_content_block)
|
|
2996
3128
|
})
|
|
2997
3129
|
]);
|
|
2998
3130
|
|
|
2999
3131
|
// src/schema/widgets/giftWithPurchase.ts
|
|
3000
|
-
import { z as
|
|
3001
|
-
var GiftWithPurchase =
|
|
3002
|
-
type:
|
|
3132
|
+
import { z as z43 } from "zod";
|
|
3133
|
+
var GiftWithPurchase = z43.looseObject({
|
|
3134
|
+
type: z43.literal(WidgetType.gift_with_purchase).default(WidgetType.gift_with_purchase)
|
|
3003
3135
|
});
|
|
3004
3136
|
|
|
3005
3137
|
// src/schema/widgets/lineItemEditor.ts
|
|
3006
|
-
import { z as
|
|
3007
|
-
var LineItemEditorSwitchLanguageV1 =
|
|
3008
|
-
downgradeToOneTimeLabel:
|
|
3138
|
+
import { z as z44 } from "zod";
|
|
3139
|
+
var LineItemEditorSwitchLanguageV1 = z44.object({
|
|
3140
|
+
downgradeToOneTimeLabel: z44.string().optional(),
|
|
3009
3141
|
/** Frequency-option template (`{{frequency}}`/`{{interval}}`) for the plan select. */
|
|
3010
|
-
subscriptionOptionLabel:
|
|
3011
|
-
upgradeToSubscriptionLabel:
|
|
3012
|
-
upgradeToSubscriptionWithoutDiscountLabel:
|
|
3142
|
+
subscriptionOptionLabel: z44.string().optional(),
|
|
3143
|
+
upgradeToSubscriptionLabel: z44.string().optional(),
|
|
3144
|
+
upgradeToSubscriptionWithoutDiscountLabel: z44.string().optional()
|
|
3013
3145
|
});
|
|
3014
|
-
var LineItemEditorV1 =
|
|
3146
|
+
var LineItemEditorV1 = z44.object({
|
|
3015
3147
|
/** Legacy `getStyles` button style; the converter carries a valid kind, defaulting to `plain`. */
|
|
3016
|
-
button:
|
|
3017
|
-
previewMode:
|
|
3018
|
-
switchToSubscription:
|
|
3019
|
-
disableDowngrade:
|
|
3148
|
+
button: z44.object({ kind: z44.enum(["plain", "primary", "secondary"]).optional() }).optional(),
|
|
3149
|
+
previewMode: z44.boolean().optional(),
|
|
3150
|
+
switchToSubscription: z44.object({
|
|
3151
|
+
disableDowngrade: z44.boolean().optional(),
|
|
3020
3152
|
language: LineItemEditorSwitchLanguageV1.optional()
|
|
3021
3153
|
}).optional(),
|
|
3022
|
-
switchToSubscriptionEnabled:
|
|
3023
|
-
tracking:
|
|
3024
|
-
enableAttribution:
|
|
3025
|
-
enableSource:
|
|
3026
|
-
enableWidget:
|
|
3154
|
+
switchToSubscriptionEnabled: z44.boolean().optional(),
|
|
3155
|
+
tracking: z44.object({
|
|
3156
|
+
enableAttribution: z44.boolean().optional(),
|
|
3157
|
+
enableSource: z44.boolean().optional(),
|
|
3158
|
+
enableWidget: z44.boolean().optional()
|
|
3027
3159
|
}).optional(),
|
|
3028
|
-
type:
|
|
3029
|
-
version:
|
|
3160
|
+
type: z44.literal(WidgetType.ui_extension_line_item_editor).default(WidgetType.ui_extension_line_item_editor),
|
|
3161
|
+
version: z44.literal(1)
|
|
3030
3162
|
});
|
|
3031
|
-
var LineItemEditor =
|
|
3163
|
+
var LineItemEditor = z44.discriminatedUnion("version", [
|
|
3032
3164
|
LineItemEditorV1,
|
|
3033
3165
|
CABRootSection.extend({
|
|
3034
|
-
type:
|
|
3166
|
+
type: z44.literal(WidgetType.ui_extension_line_item_editor).default(WidgetType.ui_extension_line_item_editor)
|
|
3035
3167
|
})
|
|
3036
3168
|
]);
|
|
3037
3169
|
|
|
3038
3170
|
// src/schema/widgets/progressBar.ts
|
|
3039
|
-
import { z as
|
|
3040
|
-
var ProgressBar =
|
|
3041
|
-
type:
|
|
3171
|
+
import { z as z45 } from "zod";
|
|
3172
|
+
var ProgressBar = z45.looseObject({
|
|
3173
|
+
type: z45.literal(WidgetType.ui_extension_progress_bar).default(WidgetType.ui_extension_progress_bar)
|
|
3042
3174
|
});
|
|
3043
3175
|
|
|
3044
3176
|
// src/schema/widgets/rebuyButton.ts
|
|
3045
|
-
import { z as
|
|
3046
|
-
var RebuyButtonV1 =
|
|
3047
|
-
type:
|
|
3048
|
-
version:
|
|
3177
|
+
import { z as z46 } from "zod";
|
|
3178
|
+
var RebuyButtonV1 = z46.looseObject({
|
|
3179
|
+
type: z46.literal(WidgetType.ui_extension_button).default(WidgetType.ui_extension_button),
|
|
3180
|
+
version: z46.literal(1)
|
|
3049
3181
|
});
|
|
3050
|
-
var RebuyButton =
|
|
3182
|
+
var RebuyButton = z46.discriminatedUnion("version", [
|
|
3051
3183
|
RebuyButtonV1,
|
|
3052
3184
|
CABRootSection.extend({
|
|
3053
|
-
type:
|
|
3185
|
+
type: z46.literal(WidgetType.ui_extension_button).default(WidgetType.ui_extension_button)
|
|
3054
3186
|
})
|
|
3055
3187
|
]);
|
|
3056
3188
|
|
|
3057
3189
|
// src/schema/widgets/rebuyMonetize.ts
|
|
3058
|
-
import { z as
|
|
3059
|
-
var RebuyMonetize =
|
|
3060
|
-
type:
|
|
3190
|
+
import { z as z47 } from "zod";
|
|
3191
|
+
var RebuyMonetize = z47.looseObject({
|
|
3192
|
+
type: z47.literal(WidgetType.ui_extension_ad).default(WidgetType.ui_extension_ad)
|
|
3061
3193
|
});
|
|
3062
|
-
var RebuyMonetizeV1 =
|
|
3063
|
-
name:
|
|
3064
|
-
previewMode:
|
|
3194
|
+
var RebuyMonetizeV1 = z47.object({
|
|
3195
|
+
name: z47.string().nullable().optional(),
|
|
3196
|
+
previewMode: z47.boolean().optional(),
|
|
3065
3197
|
/** Privacy Policy footer href → the marker section's `privacyPolicyUrl`. */
|
|
3066
|
-
privacyPolicyUrl:
|
|
3198
|
+
privacyPolicyUrl: z47.string().nullable().optional(),
|
|
3067
3199
|
/** Ads-taxonomy sub-vertical id — one of the admin Monetize editor's two configurables. */
|
|
3068
|
-
subVertical:
|
|
3069
|
-
tracking:
|
|
3070
|
-
enableAttribution:
|
|
3071
|
-
enableSource:
|
|
3072
|
-
enableWidget:
|
|
3200
|
+
subVertical: z47.string().nullable().optional(),
|
|
3201
|
+
tracking: z47.object({
|
|
3202
|
+
enableAttribution: z47.boolean().optional(),
|
|
3203
|
+
enableSource: z47.boolean().optional(),
|
|
3204
|
+
enableWidget: z47.boolean().optional()
|
|
3073
3205
|
}).optional(),
|
|
3074
|
-
type:
|
|
3075
|
-
version:
|
|
3206
|
+
type: z47.literal(WidgetType.ui_extension_ad).default(WidgetType.ui_extension_ad),
|
|
3207
|
+
version: z47.literal(1),
|
|
3076
3208
|
/** Ads-taxonomy vertical id — one of the admin Monetize editor's two configurables. */
|
|
3077
|
-
vertical:
|
|
3209
|
+
vertical: z47.string().nullable().optional()
|
|
3078
3210
|
});
|
|
3079
3211
|
|
|
3080
3212
|
// src/schema/widgetData.ts
|
|
@@ -3088,7 +3220,7 @@ var extensionWidgetTypes = [
|
|
|
3088
3220
|
WidgetType.ui_extension_line_item_editor,
|
|
3089
3221
|
WidgetType.ui_extension_progress_bar
|
|
3090
3222
|
];
|
|
3091
|
-
var WidgetData =
|
|
3223
|
+
var WidgetData = z48.discriminatedUnion("type", [
|
|
3092
3224
|
ABTestingPlaceholder,
|
|
3093
3225
|
CheckoutExtension,
|
|
3094
3226
|
ContentBlock,
|
|
@@ -3449,15 +3581,15 @@ var SWITCH_LABELS = {
|
|
|
3449
3581
|
|
|
3450
3582
|
// src/schema/widgets/post-purchase-offer/common.ts
|
|
3451
3583
|
import { replace, toNumber, toString } from "es-toolkit/compat";
|
|
3452
|
-
import { z as
|
|
3453
|
-
var strictNumber =
|
|
3454
|
-
|
|
3455
|
-
|
|
3456
|
-
|
|
3584
|
+
import { z as z49 } from "zod";
|
|
3585
|
+
var strictNumber = z49.union([
|
|
3586
|
+
z49.number(),
|
|
3587
|
+
z49.string().transform((value) => toNumber(replace(toString(value), /[^0-9.]/g, "")) || 0),
|
|
3588
|
+
z49.unknown().transform(() => 0)
|
|
3457
3589
|
]);
|
|
3458
3590
|
|
|
3459
3591
|
// src/schema/widgets/post-purchase-offer/constants.ts
|
|
3460
|
-
import { z as
|
|
3592
|
+
import { z as z50 } from "zod";
|
|
3461
3593
|
var blockTypes = [
|
|
3462
3594
|
"callout_banner",
|
|
3463
3595
|
"image",
|
|
@@ -3468,144 +3600,144 @@ var blockTypes = [
|
|
|
3468
3600
|
"text",
|
|
3469
3601
|
"timer"
|
|
3470
3602
|
];
|
|
3471
|
-
var blockType =
|
|
3603
|
+
var blockType = z50.enum(blockTypes);
|
|
3472
3604
|
var BlockType = blockType.enum;
|
|
3473
3605
|
|
|
3474
3606
|
// src/schema/widgets/post-purchase-offer/postPurchaseBlocks.ts
|
|
3475
3607
|
import { get as get3, isEqual } from "es-toolkit/compat";
|
|
3476
3608
|
import { v4 as uuidv42 } from "uuid";
|
|
3477
|
-
import { z as
|
|
3478
|
-
var TextAlignment2 =
|
|
3479
|
-
var TextSize =
|
|
3480
|
-
|
|
3481
|
-
|
|
3609
|
+
import { z as z51 } from "zod";
|
|
3610
|
+
var TextAlignment2 = z51.union([z51.enum(["leading", "center", "trailing"]), z51.unknown().transform(() => "leading")]);
|
|
3611
|
+
var TextSize = z51.union([
|
|
3612
|
+
z51.enum(["xsmall", "small", "base", "default", "medium", "large", "xlarge"]),
|
|
3613
|
+
z51.unknown().transform(() => "medium")
|
|
3482
3614
|
]);
|
|
3483
|
-
var CalloutBannerBlock =
|
|
3484
|
-
id:
|
|
3485
|
-
name:
|
|
3486
|
-
settings:
|
|
3487
|
-
superTitle:
|
|
3488
|
-
title:
|
|
3615
|
+
var CalloutBannerBlock = z51.object({
|
|
3616
|
+
id: z51.string().optional().default(() => uuidv42()),
|
|
3617
|
+
name: z51.string().optional(),
|
|
3618
|
+
settings: z51.object({
|
|
3619
|
+
superTitle: z51.union([z51.string(), TiptapDocument]).default(() => "Limited-time Offer"),
|
|
3620
|
+
title: z51.union([z51.string(), TiptapDocument]).default(() => "Add this customer favorite to your order")
|
|
3489
3621
|
}),
|
|
3490
|
-
styles:
|
|
3491
|
-
superTitleEmphasized:
|
|
3622
|
+
styles: z51.object({
|
|
3623
|
+
superTitleEmphasized: z51.boolean().default(false),
|
|
3492
3624
|
superTitleSize: TextSize.default("large"),
|
|
3493
3625
|
textAlignment: TextAlignment2.default("center"),
|
|
3494
|
-
titleEmphasized:
|
|
3626
|
+
titleEmphasized: z51.boolean().default(true),
|
|
3495
3627
|
titleSize: TextSize.default("large")
|
|
3496
3628
|
}),
|
|
3497
|
-
type:
|
|
3629
|
+
type: z51.literal(BlockType.callout_banner).default(BlockType.callout_banner)
|
|
3498
3630
|
});
|
|
3499
|
-
var ImageBlock =
|
|
3500
|
-
id:
|
|
3501
|
-
name:
|
|
3502
|
-
settings:
|
|
3503
|
-
|
|
3631
|
+
var ImageBlock = z51.object({
|
|
3632
|
+
id: z51.string().optional().default(() => uuidv42()),
|
|
3633
|
+
name: z51.string().optional(),
|
|
3634
|
+
settings: z51.union([
|
|
3635
|
+
z51.object({
|
|
3504
3636
|
/** This isn't used in the post-purchase offer widget */
|
|
3505
|
-
alt:
|
|
3506
|
-
image:
|
|
3507
|
-
imageSize:
|
|
3508
|
-
imageType:
|
|
3637
|
+
alt: z51.string().optional().default(""),
|
|
3638
|
+
image: z51.union([z51.literal(""), z51.url()]).default(""),
|
|
3639
|
+
imageSize: z51.number().default(20),
|
|
3640
|
+
imageType: z51.enum(["URL", "UPLOAD"]).default("URL")
|
|
3509
3641
|
}),
|
|
3510
|
-
|
|
3642
|
+
z51.array(z51.never()).transform(() => ({}))
|
|
3511
3643
|
]),
|
|
3512
|
-
type:
|
|
3644
|
+
type: z51.literal(BlockType.image).default(BlockType.image)
|
|
3513
3645
|
});
|
|
3514
|
-
var ImageContentBlock =
|
|
3515
|
-
id:
|
|
3516
|
-
name:
|
|
3517
|
-
settings:
|
|
3518
|
-
alt:
|
|
3519
|
-
description:
|
|
3646
|
+
var ImageContentBlock = z51.object({
|
|
3647
|
+
id: z51.string().optional().default(() => uuidv42()),
|
|
3648
|
+
name: z51.string().optional(),
|
|
3649
|
+
settings: z51.object({
|
|
3650
|
+
alt: z51.string().optional().default(""),
|
|
3651
|
+
description: z51.union([z51.string(), TiptapDocument, z51.null()]).default(
|
|
3520
3652
|
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."
|
|
3521
3653
|
),
|
|
3522
3654
|
descriptionSize: TextSize.default("medium"),
|
|
3523
3655
|
horizontalAlignment: TextAlignment2.default("leading"),
|
|
3524
|
-
image:
|
|
3525
|
-
imagePlacement:
|
|
3526
|
-
imageSize:
|
|
3527
|
-
superTitle:
|
|
3656
|
+
image: z51.union([z51.literal(""), z51.url()]).default(""),
|
|
3657
|
+
imagePlacement: z51.enum(["bottom", "left", "right", "top"]).optional().default("left"),
|
|
3658
|
+
imageSize: z51.number().default(20),
|
|
3659
|
+
superTitle: z51.union([z51.string(), TiptapDocument]).default("Lorem Ipsum!"),
|
|
3528
3660
|
superTitleSize: TextSize.default("medium"),
|
|
3529
3661
|
/** This isn't configurable in the admin-nextjs editor */
|
|
3530
|
-
swapContent:
|
|
3531
|
-
title:
|
|
3662
|
+
swapContent: z51.boolean().optional().default(false),
|
|
3663
|
+
title: z51.union([z51.string(), TiptapDocument]).nullable().default("Lorem ipsum dolor sit amet"),
|
|
3532
3664
|
titleSize: TextSize.default("medium")
|
|
3533
3665
|
}),
|
|
3534
|
-
type:
|
|
3666
|
+
type: z51.literal(BlockType.image_content).default(BlockType.image_content)
|
|
3535
3667
|
});
|
|
3536
|
-
var PayButtonBlock =
|
|
3537
|
-
id:
|
|
3538
|
-
name:
|
|
3539
|
-
settings:
|
|
3540
|
-
|
|
3541
|
-
label:
|
|
3668
|
+
var PayButtonBlock = z51.object({
|
|
3669
|
+
id: z51.string().optional().default(() => uuidv42()),
|
|
3670
|
+
name: z51.string().optional(),
|
|
3671
|
+
settings: z51.union([
|
|
3672
|
+
z51.object({
|
|
3673
|
+
label: z51.string().default("Pay Now")
|
|
3542
3674
|
}),
|
|
3543
|
-
|
|
3675
|
+
z51.array(z51.never()).transform(() => ({
|
|
3544
3676
|
label: "Pay Now"
|
|
3545
3677
|
}))
|
|
3546
3678
|
]),
|
|
3547
|
-
styles:
|
|
3548
|
-
|
|
3549
|
-
buttonWidth:
|
|
3679
|
+
styles: z51.union([
|
|
3680
|
+
z51.object({
|
|
3681
|
+
buttonWidth: z51.number().min(10).max(100).default(50)
|
|
3550
3682
|
}),
|
|
3551
|
-
|
|
3683
|
+
z51.array(z51.never()).transform(() => ({
|
|
3552
3684
|
buttonWidth: 50
|
|
3553
3685
|
}))
|
|
3554
3686
|
]),
|
|
3555
|
-
type:
|
|
3687
|
+
type: z51.literal(BlockType.pay_button).default(BlockType.pay_button)
|
|
3556
3688
|
});
|
|
3557
|
-
var ProductInformationBlock =
|
|
3689
|
+
var ProductInformationBlock = z51.object({
|
|
3558
3690
|
/** This isn't configurable in the admin-nextjs editor */
|
|
3559
|
-
hideProductImage:
|
|
3560
|
-
id:
|
|
3561
|
-
name:
|
|
3562
|
-
type:
|
|
3691
|
+
hideProductImage: z51.boolean().optional().default(false),
|
|
3692
|
+
id: z51.string().optional().default(() => uuidv42()),
|
|
3693
|
+
name: z51.string().optional(),
|
|
3694
|
+
type: z51.literal(BlockType.product_information).default(BlockType.product_information)
|
|
3563
3695
|
});
|
|
3564
|
-
var SeparatorBlock =
|
|
3565
|
-
id:
|
|
3566
|
-
name:
|
|
3567
|
-
type:
|
|
3696
|
+
var SeparatorBlock = z51.object({
|
|
3697
|
+
id: z51.string().optional().default(() => uuidv42()),
|
|
3698
|
+
name: z51.string().optional(),
|
|
3699
|
+
type: z51.literal(BlockType.separator).default(BlockType.separator)
|
|
3568
3700
|
});
|
|
3569
|
-
var TextBlock =
|
|
3570
|
-
id:
|
|
3571
|
-
name:
|
|
3572
|
-
settings:
|
|
3573
|
-
description:
|
|
3701
|
+
var TextBlock = z51.object({
|
|
3702
|
+
id: z51.string().optional().default(() => uuidv42()),
|
|
3703
|
+
name: z51.string().optional(),
|
|
3704
|
+
settings: z51.object({
|
|
3705
|
+
description: z51.union([z51.string(), TiptapDocument]).optional().default(
|
|
3574
3706
|
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."
|
|
3575
3707
|
),
|
|
3576
3708
|
/** This isn't used in the post-purchase offer widget */
|
|
3577
3709
|
descriptionSize: TextSize.default("medium"),
|
|
3578
3710
|
horizontalAlignment: TextAlignment2.default("leading"),
|
|
3579
|
-
superTitle:
|
|
3711
|
+
superTitle: z51.union([z51.string(), TiptapDocument]).default("Super Title"),
|
|
3580
3712
|
/** This isn't used in the post-purchase offer widget */
|
|
3581
3713
|
superTitleSize: TextSize.default("medium"),
|
|
3582
|
-
title:
|
|
3714
|
+
title: z51.union([z51.string(), TiptapDocument]).nullable().default("Lorem ipsum dolor sit amet."),
|
|
3583
3715
|
/** This isn't used in the post-purchase offer widget */
|
|
3584
3716
|
titleSize: TextSize.default("medium")
|
|
3585
3717
|
}),
|
|
3586
|
-
type:
|
|
3718
|
+
type: z51.literal(BlockType.text).default(BlockType.text)
|
|
3587
3719
|
});
|
|
3588
|
-
var TimerBlock =
|
|
3589
|
-
id:
|
|
3590
|
-
name:
|
|
3591
|
-
settings:
|
|
3592
|
-
durationMinutes:
|
|
3593
|
-
durationSeconds:
|
|
3594
|
-
endOffer:
|
|
3595
|
-
title:
|
|
3720
|
+
var TimerBlock = z51.object({
|
|
3721
|
+
id: z51.string().optional().default(() => uuidv42()),
|
|
3722
|
+
name: z51.string().optional(),
|
|
3723
|
+
settings: z51.object({
|
|
3724
|
+
durationMinutes: z51.number().min(0).default(10),
|
|
3725
|
+
durationSeconds: z51.union([z51.number().min(0), z51.unknown().transform(() => 0)]).default(0),
|
|
3726
|
+
endOffer: z51.boolean().default(true),
|
|
3727
|
+
title: z51.union([z51.string(), TiptapDocument]).default("Hurry \u2014 your special offer ends in:")
|
|
3596
3728
|
}),
|
|
3597
|
-
styles:
|
|
3729
|
+
styles: z51.object({
|
|
3598
3730
|
textAlignment: TextAlignment2.default("center"),
|
|
3599
|
-
timerBackgroundColor:
|
|
3600
|
-
timerEmphasized:
|
|
3731
|
+
timerBackgroundColor: z51.enum(["info", "warning", "success", "critical"]).default("warning"),
|
|
3732
|
+
timerEmphasized: z51.union([z51.boolean(), z51.unknown().transform(() => true)]).default(true),
|
|
3601
3733
|
timerSize: TextSize.default("medium"),
|
|
3602
|
-
timerWidth:
|
|
3603
|
-
titleEmphasized:
|
|
3734
|
+
timerWidth: z51.number().min(10).max(100).optional().default(100),
|
|
3735
|
+
titleEmphasized: z51.union([z51.boolean(), z51.unknown().transform(() => true)]).default(false),
|
|
3604
3736
|
titleSize: TextSize.default("medium")
|
|
3605
3737
|
}),
|
|
3606
|
-
type:
|
|
3738
|
+
type: z51.literal(BlockType.timer).default(BlockType.timer)
|
|
3607
3739
|
});
|
|
3608
|
-
var PostPurchaseBlock =
|
|
3740
|
+
var PostPurchaseBlock = z51.discriminatedUnion("type", [
|
|
3609
3741
|
CalloutBannerBlock,
|
|
3610
3742
|
ImageBlock,
|
|
3611
3743
|
ImageContentBlock,
|
|
@@ -3625,68 +3757,68 @@ var isTextBlock = (block) => isEqual(get3(block, "type"), BlockType.text);
|
|
|
3625
3757
|
var isTimerBlock = (block) => isEqual(get3(block, "type"), BlockType.timer);
|
|
3626
3758
|
|
|
3627
3759
|
// src/schema/widgets/post-purchase-offer/postPurchaseOffer.ts
|
|
3628
|
-
import { z as
|
|
3760
|
+
import { z as z54 } from "zod";
|
|
3629
3761
|
|
|
3630
3762
|
// src/schema/widgets/post-purchase-offer/postPurchaseWidget.ts
|
|
3631
|
-
import { z as
|
|
3763
|
+
import { z as z53 } from "zod";
|
|
3632
3764
|
|
|
3633
3765
|
// src/schema/widgets/post-purchase-offer/postPurchaseSettings.ts
|
|
3634
|
-
import { z as
|
|
3635
|
-
var PostPurchaseSettings =
|
|
3636
|
-
advance:
|
|
3637
|
-
blocks:
|
|
3766
|
+
import { z as z52 } from "zod";
|
|
3767
|
+
var PostPurchaseSettings = z52.object({
|
|
3768
|
+
advance: z52.object({ removePartialOrder: z52.boolean().default(true) }).optional().default(() => ({ removePartialOrder: true })),
|
|
3769
|
+
blocks: z52.union([z52.array(PostPurchaseBlock), z52.unknown().transform(() => [])]).default(() => [
|
|
3638
3770
|
PostPurchaseBlock.parse({ settings: {}, styles: {}, type: BlockType.timer }),
|
|
3639
3771
|
PostPurchaseBlock.parse({ settings: {}, styles: {}, type: BlockType.callout_banner }),
|
|
3640
3772
|
PostPurchaseBlock.parse({ type: BlockType.product_information })
|
|
3641
3773
|
]),
|
|
3642
|
-
columnLayout:
|
|
3643
|
-
discount:
|
|
3774
|
+
columnLayout: z52.boolean().optional(),
|
|
3775
|
+
discount: z52.object({
|
|
3644
3776
|
amount: strictNumber.default(30),
|
|
3645
|
-
shouldShowSavingText:
|
|
3646
|
-
type:
|
|
3777
|
+
shouldShowSavingText: z52.boolean().optional().default(true),
|
|
3778
|
+
type: z52.enum(["none", "fixed_amount", "percentage"]).default("none")
|
|
3647
3779
|
}),
|
|
3648
|
-
discountedFrom:
|
|
3649
|
-
endpoint:
|
|
3650
|
-
integrations:
|
|
3651
|
-
judgeme:
|
|
3652
|
-
junip:
|
|
3653
|
-
klaviyo:
|
|
3654
|
-
loox:
|
|
3655
|
-
okendo:
|
|
3656
|
-
opinew:
|
|
3657
|
-
reviewsio:
|
|
3658
|
-
stamped:
|
|
3659
|
-
yotpo:
|
|
3780
|
+
discountedFrom: z52.enum(["price", "compare_at_price"]).optional().default("price"),
|
|
3781
|
+
endpoint: z52.string().optional(),
|
|
3782
|
+
integrations: z52.object({
|
|
3783
|
+
judgeme: z52.boolean().default(false),
|
|
3784
|
+
junip: z52.boolean().optional().default(false),
|
|
3785
|
+
klaviyo: z52.boolean().default(false),
|
|
3786
|
+
loox: z52.boolean().default(false),
|
|
3787
|
+
okendo: z52.boolean().default(false),
|
|
3788
|
+
opinew: z52.boolean().optional().default(false),
|
|
3789
|
+
reviewsio: z52.boolean().optional().default(false),
|
|
3790
|
+
stamped: z52.boolean().default(false),
|
|
3791
|
+
yotpo: z52.boolean().default(false)
|
|
3660
3792
|
}),
|
|
3661
|
-
key:
|
|
3662
|
-
language:
|
|
3663
|
-
description:
|
|
3664
|
-
descriptionEnabled:
|
|
3665
|
-
descriptionRte:
|
|
3666
|
-
content:
|
|
3667
|
-
type:
|
|
3793
|
+
key: z52.string().optional(),
|
|
3794
|
+
language: z52.object({
|
|
3795
|
+
description: z52.union([z52.string(), z52.unknown().transform(() => "")]).default(""),
|
|
3796
|
+
descriptionEnabled: z52.boolean().optional().default(false),
|
|
3797
|
+
descriptionRte: z52.object({
|
|
3798
|
+
content: z52.array(z52.unknown()),
|
|
3799
|
+
type: z52.string()
|
|
3668
3800
|
}).optional(),
|
|
3669
|
-
descriptionSpacing:
|
|
3670
|
-
displayCtaPrice:
|
|
3671
|
-
global:
|
|
3672
|
-
declineAll:
|
|
3673
|
-
declineThisOffer:
|
|
3674
|
-
free:
|
|
3675
|
-
notAvailable:
|
|
3676
|
-
payNow:
|
|
3677
|
-
payNowUpgradeToSubscription:
|
|
3678
|
-
quantity:
|
|
3801
|
+
descriptionSpacing: z52.enum(["none", "xtight", "tight", "default", "loose", "xloose"]).optional(),
|
|
3802
|
+
displayCtaPrice: z52.boolean().default(true),
|
|
3803
|
+
global: z52.object({
|
|
3804
|
+
declineAll: z52.string().optional().default("Decline All"),
|
|
3805
|
+
declineThisOffer: z52.string().default("Decline this offer"),
|
|
3806
|
+
free: z52.string().optional().default("Free"),
|
|
3807
|
+
notAvailable: z52.string().optional().default("Not available"),
|
|
3808
|
+
payNow: z52.string().default("Pay Now"),
|
|
3809
|
+
payNowUpgradeToSubscription: z52.string().optional().default("Upgrade to Subscription"),
|
|
3810
|
+
quantity: z52.string().default("Quantity"),
|
|
3679
3811
|
/** This isn't configurable in the admin-nextjs editor */
|
|
3680
|
-
recurringShipping:
|
|
3681
|
-
recurringSubtotal:
|
|
3682
|
-
reviewsPlural:
|
|
3683
|
-
reviewsSingular:
|
|
3684
|
-
save:
|
|
3685
|
-
shipping:
|
|
3686
|
-
subscriptionOption:
|
|
3687
|
-
subtotal:
|
|
3688
|
-
taxes:
|
|
3689
|
-
total:
|
|
3812
|
+
recurringShipping: z52.string().optional().default("Recurring shipping"),
|
|
3813
|
+
recurringSubtotal: z52.string().default("Recurring subtotal"),
|
|
3814
|
+
reviewsPlural: z52.string().optional().default("Reviews"),
|
|
3815
|
+
reviewsSingular: z52.string().optional().default("Review"),
|
|
3816
|
+
save: z52.union([z52.string(), z52.unknown().transform(() => "Save")]).optional().default("Save"),
|
|
3817
|
+
shipping: z52.string().default("Shipping"),
|
|
3818
|
+
subscriptionOption: z52.string().optional().default("Subscribe and Save"),
|
|
3819
|
+
subtotal: z52.string().default("Subtotal"),
|
|
3820
|
+
taxes: z52.string().default("Taxes"),
|
|
3821
|
+
total: z52.string().default("Total")
|
|
3690
3822
|
}).optional().default(() => ({
|
|
3691
3823
|
declineAll: "Decline All",
|
|
3692
3824
|
declineThisOffer: "Decline this offer",
|
|
@@ -3707,70 +3839,70 @@ var PostPurchaseSettings = z45.object({
|
|
|
3707
3839
|
taxes: "Taxes",
|
|
3708
3840
|
total: "Total"
|
|
3709
3841
|
})),
|
|
3710
|
-
globalTranslation:
|
|
3842
|
+
globalTranslation: z52.string().optional().default("english")
|
|
3711
3843
|
}),
|
|
3712
|
-
metafields:
|
|
3844
|
+
metafields: z52.boolean().default(false),
|
|
3713
3845
|
/** This isn't configurable in the admin-nextjs editor */
|
|
3714
|
-
offer:
|
|
3715
|
-
count:
|
|
3846
|
+
offer: z52.object({
|
|
3847
|
+
count: z52.number().default(1)
|
|
3716
3848
|
}),
|
|
3717
|
-
offersLayout:
|
|
3718
|
-
itemsPerPage:
|
|
3719
|
-
type:
|
|
3849
|
+
offersLayout: z52.object({
|
|
3850
|
+
itemsPerPage: z52.number().optional(),
|
|
3851
|
+
type: z52.enum(["list", "grid", "carousel"]).default("list")
|
|
3720
3852
|
}).optional().default({
|
|
3721
3853
|
type: "list"
|
|
3722
3854
|
}),
|
|
3723
3855
|
/** This isn't configurable in the admin-nextjs editor */
|
|
3724
|
-
previewMode:
|
|
3725
|
-
productLimit:
|
|
3726
|
-
productOptions:
|
|
3856
|
+
previewMode: z52.boolean().default(false),
|
|
3857
|
+
productLimit: z52.number().optional().default(1),
|
|
3858
|
+
productOptions: z52.object({
|
|
3727
3859
|
/** This isn't configurable in the admin-nextjs editor */
|
|
3728
|
-
hideOutOfStockVariants:
|
|
3729
|
-
matchVariant:
|
|
3730
|
-
showDeclineAll:
|
|
3731
|
-
showShipping:
|
|
3732
|
-
showSubtotal:
|
|
3733
|
-
showTaxes:
|
|
3734
|
-
showTotal:
|
|
3735
|
-
showVariantSelectors:
|
|
3736
|
-
variantSelectorDisplayMode:
|
|
3860
|
+
hideOutOfStockVariants: z52.boolean().optional().default(false),
|
|
3861
|
+
matchVariant: z52.boolean().optional().default(true),
|
|
3862
|
+
showDeclineAll: z52.enum(["above", "below", "both", "none"]).optional(),
|
|
3863
|
+
showShipping: z52.boolean().optional().default(true),
|
|
3864
|
+
showSubtotal: z52.boolean().optional().default(true),
|
|
3865
|
+
showTaxes: z52.boolean().optional().default(true),
|
|
3866
|
+
showTotal: z52.boolean().optional().default(true),
|
|
3867
|
+
showVariantSelectors: z52.boolean().optional().default(true),
|
|
3868
|
+
variantSelectorDisplayMode: z52.enum(["separate", "single"]).optional().default("separate")
|
|
3737
3869
|
}),
|
|
3738
|
-
productType:
|
|
3739
|
-
productTypeSelector:
|
|
3740
|
-
quantityInputs:
|
|
3741
|
-
defaultQuantity:
|
|
3742
|
-
enabled:
|
|
3743
|
-
maxValue:
|
|
3744
|
-
minValue:
|
|
3870
|
+
productType: z52.union([z52.enum(["one-time", "subscription", "both"]), z52.literal("").transform(() => "one-time")]).default("one-time"),
|
|
3871
|
+
productTypeSelector: z52.enum(["dropdown", "radio"]).optional().default("radio"),
|
|
3872
|
+
quantityInputs: z52.object({
|
|
3873
|
+
defaultQuantity: z52.union([z52.number(), z52.null().transform(() => 1)]).default(1),
|
|
3874
|
+
enabled: z52.boolean().default(true),
|
|
3875
|
+
maxValue: z52.union([z52.number(), z52.null().transform(() => 15)]).default(15),
|
|
3876
|
+
minValue: z52.union([z52.number().min(0), z52.unknown().transform(() => 0)]).default(1)
|
|
3745
3877
|
}),
|
|
3746
|
-
shipping:
|
|
3878
|
+
shipping: z52.object({
|
|
3747
3879
|
amount: strictNumber.default(10),
|
|
3748
3880
|
/** This isn't configurable in the admin-nextjs editor */
|
|
3749
|
-
enabled:
|
|
3750
|
-
title:
|
|
3751
|
-
type:
|
|
3881
|
+
enabled: z52.boolean().default(true),
|
|
3882
|
+
title: z52.string().optional().default("Shipping Fees"),
|
|
3883
|
+
type: z52.enum(["free", "fixed_amount"]).default("free")
|
|
3752
3884
|
}),
|
|
3753
|
-
styles:
|
|
3754
|
-
starColor:
|
|
3755
|
-
starSize:
|
|
3756
|
-
starStrokeColor:
|
|
3757
|
-
strokeWidth:
|
|
3885
|
+
styles: z52.object({
|
|
3886
|
+
starColor: z52.string().optional().default("#fadb14"),
|
|
3887
|
+
starSize: z52.union([z52.enum(["small", "medium", "large"]), z52.unknown().transform(() => "large")]).optional().default("large"),
|
|
3888
|
+
starStrokeColor: z52.string().optional().default("#fadb14"),
|
|
3889
|
+
strokeWidth: z52.string().optional().default("1")
|
|
3758
3890
|
}).optional(),
|
|
3759
|
-
subImages:
|
|
3760
|
-
subscription:
|
|
3761
|
-
discount:
|
|
3891
|
+
subImages: z52.number().nullish().default(8),
|
|
3892
|
+
subscription: z52.object({
|
|
3893
|
+
discount: z52.object({
|
|
3762
3894
|
amount: strictNumber.default(30),
|
|
3763
|
-
shouldShowSavingText:
|
|
3764
|
-
type:
|
|
3895
|
+
shouldShowSavingText: z52.boolean().optional().default(true),
|
|
3896
|
+
type: z52.enum(["none", "fixed_amount", "percentage"]).default("none")
|
|
3765
3897
|
}),
|
|
3766
|
-
shipping:
|
|
3898
|
+
shipping: z52.object({
|
|
3767
3899
|
amount: strictNumber.default(1),
|
|
3768
3900
|
/** This isn't configurable in the admin-nextjs editor */
|
|
3769
|
-
enabled:
|
|
3901
|
+
enabled: z52.boolean().default(true),
|
|
3770
3902
|
/** This isn't configurable in the admin-nextjs editor */
|
|
3771
3903
|
recurringAmount: strictNumber.default(2),
|
|
3772
|
-
shippingTitle:
|
|
3773
|
-
type:
|
|
3904
|
+
shippingTitle: z52.string().default("Shipping Fees"),
|
|
3905
|
+
type: z52.enum(["free", "fixed_amount"]).default("free")
|
|
3774
3906
|
})
|
|
3775
3907
|
}).optional().default({
|
|
3776
3908
|
discount: {
|
|
@@ -3788,15 +3920,15 @@ var PostPurchaseSettings = z45.object({
|
|
|
3788
3920
|
type: "free"
|
|
3789
3921
|
}
|
|
3790
3922
|
}),
|
|
3791
|
-
subscriptionIsDefault:
|
|
3923
|
+
subscriptionIsDefault: z52.boolean().optional(),
|
|
3792
3924
|
/** This isn't configurable in the admin-nextjs editor */
|
|
3793
|
-
template:
|
|
3794
|
-
type:
|
|
3795
|
-
upgradeToSubscription:
|
|
3796
|
-
acceptButtonText:
|
|
3797
|
-
allow:
|
|
3798
|
-
emailRefundNotice:
|
|
3799
|
-
errorBannerText:
|
|
3925
|
+
template: z52.string().optional().default(""),
|
|
3926
|
+
type: z52.literal("shopify_post_purchase_extension").default("shopify_post_purchase_extension"),
|
|
3927
|
+
upgradeToSubscription: z52.object({
|
|
3928
|
+
acceptButtonText: z52.string().optional().default("Upgrade"),
|
|
3929
|
+
allow: z52.boolean().optional().default(false),
|
|
3930
|
+
emailRefundNotice: z52.boolean().optional().default(false),
|
|
3931
|
+
errorBannerText: z52.string().optional().default("This subscription cannot be added - limit one per order")
|
|
3800
3932
|
}).optional().default(() => ({
|
|
3801
3933
|
acceptButtonText: "Upgrade",
|
|
3802
3934
|
allow: false,
|
|
@@ -3806,32 +3938,32 @@ var PostPurchaseSettings = z45.object({
|
|
|
3806
3938
|
});
|
|
3807
3939
|
|
|
3808
3940
|
// src/schema/widgets/post-purchase-offer/postPurchaseWidget.ts
|
|
3809
|
-
var PostPurchaseWidgetLinkedFlow =
|
|
3810
|
-
id:
|
|
3811
|
-
name:
|
|
3941
|
+
var PostPurchaseWidgetLinkedFlow = z53.object({
|
|
3942
|
+
id: z53.number(),
|
|
3943
|
+
name: z53.string()
|
|
3812
3944
|
});
|
|
3813
|
-
var PostPurchaseWidget =
|
|
3814
|
-
classification:
|
|
3815
|
-
createdAtTime:
|
|
3816
|
-
customEndpointName:
|
|
3817
|
-
id:
|
|
3818
|
-
lastViewed:
|
|
3819
|
-
linkedCustomEndpointId:
|
|
3820
|
-
linkedFlows:
|
|
3821
|
-
name:
|
|
3822
|
-
owner:
|
|
3945
|
+
var PostPurchaseWidget = z53.object({
|
|
3946
|
+
classification: z53.literal("post_purchase_offer_page").default("post_purchase_offer_page"),
|
|
3947
|
+
createdAtTime: z53.iso.datetime({ offset: true }).optional(),
|
|
3948
|
+
customEndpointName: z53.string().nullish(),
|
|
3949
|
+
id: z53.number().default(0),
|
|
3950
|
+
lastViewed: z53.iso.datetime({ offset: true }).nullish(),
|
|
3951
|
+
linkedCustomEndpointId: z53.number().nullish(),
|
|
3952
|
+
linkedFlows: z53.array(PostPurchaseWidgetLinkedFlow).optional(),
|
|
3953
|
+
name: z53.string().default(""),
|
|
3954
|
+
owner: z53.number().nullish(),
|
|
3823
3955
|
settings: PostPurchaseSettings
|
|
3824
3956
|
});
|
|
3825
3957
|
|
|
3826
3958
|
// src/schema/widgets/post-purchase-offer/postPurchaseOffer.ts
|
|
3827
|
-
var PostPurchaseOffer =
|
|
3828
|
-
|
|
3829
|
-
errors:
|
|
3830
|
-
message:
|
|
3831
|
-
successful:
|
|
3959
|
+
var PostPurchaseOffer = z54.discriminatedUnion("successful", [
|
|
3960
|
+
z54.strictObject({
|
|
3961
|
+
errors: z54.array(z54.object({ message: z54.string() })),
|
|
3962
|
+
message: z54.string(),
|
|
3963
|
+
successful: z54.literal(false)
|
|
3832
3964
|
}),
|
|
3833
|
-
|
|
3834
|
-
successful:
|
|
3965
|
+
z54.strictObject({
|
|
3966
|
+
successful: z54.literal(true),
|
|
3835
3967
|
widget: PostPurchaseWidget
|
|
3836
3968
|
})
|
|
3837
3969
|
]);
|
|
@@ -4930,6 +5062,7 @@ export {
|
|
|
4930
5062
|
CABImageSectionFields,
|
|
4931
5063
|
CABIntegrations,
|
|
4932
5064
|
CABLayoutSection,
|
|
5065
|
+
CABLayoutWrapping,
|
|
4933
5066
|
CABMonetizeAds,
|
|
4934
5067
|
CABMonetizeSection,
|
|
4935
5068
|
CABNumberVariable,
|
|
@@ -4947,6 +5080,7 @@ export {
|
|
|
4947
5080
|
CABRuleset,
|
|
4948
5081
|
CABRulesetEntry,
|
|
4949
5082
|
CABSection,
|
|
5083
|
+
CABSeparatorSection,
|
|
4950
5084
|
CABTextSection,
|
|
4951
5085
|
CABTextTier,
|
|
4952
5086
|
CABTextVariable,
|
|
@@ -4981,12 +5115,14 @@ export {
|
|
|
4981
5115
|
DiscountSource,
|
|
4982
5116
|
DiscountType,
|
|
4983
5117
|
EditorMode,
|
|
5118
|
+
ExitPolicySchema,
|
|
4984
5119
|
GIFT_LABELS,
|
|
4985
5120
|
Geolocation,
|
|
4986
5121
|
GiftWithPurchase,
|
|
4987
5122
|
GridItem,
|
|
4988
5123
|
HEX_COLOR_REGEX,
|
|
4989
5124
|
HTML_TAGS_REGEX,
|
|
5125
|
+
HoldSettingSchema,
|
|
4990
5126
|
HorizontalAlignment,
|
|
4991
5127
|
IconName,
|
|
4992
5128
|
IconSize,
|
|
@@ -4996,6 +5132,7 @@ export {
|
|
|
4996
5132
|
ImageContentBlock,
|
|
4997
5133
|
InlineTextSizeName,
|
|
4998
5134
|
LanguageKey,
|
|
5135
|
+
LayoutFrame,
|
|
4999
5136
|
LineItemEditor,
|
|
5000
5137
|
LineItemEditorSwitchLanguageV1,
|
|
5001
5138
|
LineItemEditorV1,
|
|
@@ -5006,17 +5143,20 @@ export {
|
|
|
5006
5143
|
ObjectFit,
|
|
5007
5144
|
OfferProduct,
|
|
5008
5145
|
OffersDirection,
|
|
5146
|
+
OrderDecisionSchema,
|
|
5009
5147
|
POST_PURCHASE_SKIP_LIMIT,
|
|
5010
5148
|
PayButtonBlock,
|
|
5011
5149
|
PopoverPosition,
|
|
5150
|
+
PostPurchaseAppIdSchema,
|
|
5012
5151
|
PostPurchaseBlock,
|
|
5013
5152
|
PostPurchaseOffer,
|
|
5014
5153
|
PostPurchaseOrderIdSchema,
|
|
5015
5154
|
PostPurchaseSettings,
|
|
5155
|
+
PostPurchaseShadowReportFields,
|
|
5016
5156
|
PostPurchaseShadowReportSchema,
|
|
5017
5157
|
PostPurchaseShadowSelectionSchema,
|
|
5018
|
-
|
|
5019
|
-
|
|
5158
|
+
PostPurchaseSkipReasonSchema,
|
|
5159
|
+
PostPurchaseSkipTraceSchema,
|
|
5020
5160
|
PostPurchaseTimestampSchema,
|
|
5021
5161
|
PostPurchaseWidget,
|
|
5022
5162
|
PostPurchaseWidgetLinkedFlow,
|
|
@@ -5030,6 +5170,7 @@ export {
|
|
|
5030
5170
|
QuantityInput,
|
|
5031
5171
|
REVIEW_LABELS,
|
|
5032
5172
|
ROOT_RELATIVE_PATH_REGEX,
|
|
5173
|
+
ReadySessionTimingSchema,
|
|
5033
5174
|
RebuyButton,
|
|
5034
5175
|
RebuyButtonV1,
|
|
5035
5176
|
RebuyClient,
|
|
@@ -5046,9 +5187,18 @@ export {
|
|
|
5046
5187
|
STATIC_ENDPOINTS,
|
|
5047
5188
|
SWITCH_LABELS,
|
|
5048
5189
|
SectionType,
|
|
5190
|
+
SelectionClaimsSchema,
|
|
5049
5191
|
SellingPlanGroup,
|
|
5050
5192
|
SeparatorBlock,
|
|
5051
5193
|
Session,
|
|
5194
|
+
SessionCloseRequestSchema,
|
|
5195
|
+
SessionCloseResponseSchema,
|
|
5196
|
+
SessionClosureSchema,
|
|
5197
|
+
SessionIdentitySchema,
|
|
5198
|
+
SessionOrderTimingSchema,
|
|
5199
|
+
SessionPolicySchema,
|
|
5200
|
+
SessionStartRequestSchema,
|
|
5201
|
+
SessionStartResponseSchema,
|
|
5052
5202
|
ShopConfig,
|
|
5053
5203
|
ShopifyDomainSchema,
|
|
5054
5204
|
SmartCartBar,
|
|
@@ -5063,6 +5213,7 @@ export {
|
|
|
5063
5213
|
TextColorName,
|
|
5064
5214
|
TextSizeName,
|
|
5065
5215
|
TimerBlock,
|
|
5216
|
+
TimingSettingsSchema,
|
|
5066
5217
|
TiptapDocument,
|
|
5067
5218
|
TiptapParagraph,
|
|
5068
5219
|
TiptapText,
|
|
@@ -5142,6 +5293,7 @@ export {
|
|
|
5142
5293
|
isTimerBlock,
|
|
5143
5294
|
isVariantsType,
|
|
5144
5295
|
languageKeys,
|
|
5296
|
+
layoutFrames,
|
|
5145
5297
|
mutatorEvents,
|
|
5146
5298
|
objectFits,
|
|
5147
5299
|
offersDirections,
|