@rebuy/rebuy 2.5.0-rc.4 → 2.5.1
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.js +367 -305
- package/dist/index.js.map +4 -4
- package/dist/index.mjs +367 -305
- package/dist/index.mjs.map +4 -4
- package/dist/schema/index.d.ts +1 -0
- package/dist/schema/index.d.ts.map +1 -1
- package/dist/schema/metadata.d.ts +666 -0
- package/dist/schema/metadata.d.ts.map +1 -0
- package/dist/schema/shopConfig.d.ts +1 -1
- package/dist/schema/userConfig.d.ts +2 -2
- package/dist/schema/userConfig.d.ts.map +1 -1
- package/dist/schema/widgets/checkout-and-beyond/common.d.ts +2 -2
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -734,6 +734,9 @@ var RebuyClient = class {
|
|
|
734
734
|
}
|
|
735
735
|
};
|
|
736
736
|
|
|
737
|
+
// src/schema/metadata.ts
|
|
738
|
+
import { z as z2 } from "zod/v4";
|
|
739
|
+
|
|
737
740
|
// src/schema/product.ts
|
|
738
741
|
import { z } from "zod/v4";
|
|
739
742
|
var zDatetime = z.iso.datetime({ offset: true });
|
|
@@ -907,57 +910,115 @@ var productSchema = z.object({
|
|
|
907
910
|
vendor: z.string()
|
|
908
911
|
});
|
|
909
912
|
|
|
910
|
-
// src/schema/
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
913
|
+
// src/schema/metadata.ts
|
|
914
|
+
var baseRuleSchema = z2.object({
|
|
915
|
+
operator: z2.string(),
|
|
916
|
+
type: z2.string(),
|
|
917
|
+
value: z2.union([z2.string(), z2.number()])
|
|
918
|
+
});
|
|
919
|
+
var ruleSchema = baseRuleSchema.extend({
|
|
920
|
+
conditions: z2.array(z2.object({ type: z2.string(), value: z2.union([z2.string(), z2.number()]) })).optional(),
|
|
921
|
+
products: z2.array(
|
|
914
922
|
z2.object({
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
+
productId: z2.number(),
|
|
924
|
+
subRules: z2.object({ logic: z2.array(z2.object({ rules: z2.array(baseRuleSchema) })) }).optional(),
|
|
925
|
+
variantIds: z2.array(z2.number())
|
|
926
|
+
})
|
|
927
|
+
).optional()
|
|
928
|
+
});
|
|
929
|
+
var outputSchema = z2.object({
|
|
930
|
+
channel: z2.string().optional(),
|
|
931
|
+
collectionId: z2.number().optional(),
|
|
932
|
+
collectionSort: z2.string().optional(),
|
|
933
|
+
collectionSortType: z2.string().nullish(),
|
|
934
|
+
days: z2.string().optional(),
|
|
935
|
+
discount: z2.object({ amount: z2.string(), type: z2.string() }).optional(),
|
|
936
|
+
endpoint: z2.string().optional(),
|
|
937
|
+
key: z2.string().optional(),
|
|
938
|
+
operator: z2.string().optional(),
|
|
939
|
+
productPrice: z2.object({ amount: z2.string(), type: z2.string() }).optional(),
|
|
940
|
+
products: z2.array(z2.object({ productId: z2.number(), variantIds: z2.array(z2.number()) })).optional(),
|
|
941
|
+
productWithTagsSort: z2.string().optional(),
|
|
942
|
+
trendingSort: z2.string().optional(),
|
|
943
|
+
type: z2.string(),
|
|
944
|
+
value: z2.union([z2.string(), z2.number(), z2.boolean()]).optional()
|
|
945
|
+
});
|
|
946
|
+
var matchedRuleSchema = z2.object({
|
|
947
|
+
collapsed: z2.boolean().optional(),
|
|
948
|
+
exitIfMatched: z2.boolean(),
|
|
949
|
+
index: z2.number(),
|
|
950
|
+
logic: z2.array(z2.object({ rules: z2.array(ruleSchema) })),
|
|
951
|
+
output: z2.array(outputSchema)
|
|
952
|
+
});
|
|
953
|
+
var metadataSchema = z2.object({
|
|
954
|
+
cacheInfo: cacheInfoSchema.optional(),
|
|
955
|
+
cartItems: z2.array(z2.never()).optional(),
|
|
956
|
+
errors: z2.array(z2.never()).optional(),
|
|
957
|
+
filteredInputProducts: z2.array(z2.never()).optional(),
|
|
958
|
+
filteredOosProducts: z2.array(productSchema).optional(),
|
|
959
|
+
globalExcludedProducts: z2.array(productSchema).optional(),
|
|
960
|
+
inputProducts: z2.array(z2.never()).optional(),
|
|
961
|
+
matchedRules: z2.array(matchedRuleSchema).optional(),
|
|
962
|
+
topSellersFilled: z2.boolean().optional(),
|
|
963
|
+
unevaluatedRules: z2.array(matchedRuleSchema).optional(),
|
|
964
|
+
unmatchedRules: z2.array(matchedRuleSchema).optional(),
|
|
965
|
+
widget: z2.object({
|
|
966
|
+
discount: z2.object({ amount: z2.string(), type: z2.string() }).optional(),
|
|
967
|
+
language: z2.record(z2.string(), z2.string()).optional()
|
|
968
|
+
}).optional()
|
|
969
|
+
});
|
|
970
|
+
|
|
971
|
+
// src/schema/shopConfig.ts
|
|
972
|
+
import { z as z3 } from "zod/v4";
|
|
973
|
+
var ShopConfig = z3.object({
|
|
974
|
+
activeExperiments: z3.array(
|
|
975
|
+
z3.object({
|
|
976
|
+
data: z3.array(
|
|
977
|
+
z3.object({
|
|
978
|
+
aliasName: z3.string(),
|
|
979
|
+
cssInput: z3.string().nullish(),
|
|
980
|
+
elementId: z3.coerce.number(),
|
|
981
|
+
id: z3.coerce.number(),
|
|
982
|
+
javascriptInput: z3.string().nullish(),
|
|
983
|
+
traffic: z3.coerce.number()
|
|
923
984
|
})
|
|
924
985
|
),
|
|
925
|
-
id:
|
|
926
|
-
name:
|
|
927
|
-
pageTarget:
|
|
928
|
-
pageTargetUrl:
|
|
929
|
-
placeholderId:
|
|
930
|
-
type:
|
|
986
|
+
id: z3.coerce.number(),
|
|
987
|
+
name: z3.string(),
|
|
988
|
+
pageTarget: z3.string().nullable(),
|
|
989
|
+
pageTargetUrl: z3.string().nullable(),
|
|
990
|
+
placeholderId: z3.coerce.number().nullable(),
|
|
991
|
+
type: z3.string()
|
|
931
992
|
})
|
|
932
993
|
),
|
|
933
|
-
activePackages:
|
|
934
|
-
|
|
935
|
-
cancelledAt:
|
|
936
|
-
id:
|
|
937
|
-
installedAt:
|
|
938
|
-
isActive:
|
|
939
|
-
isBillable:
|
|
940
|
-
packageId:
|
|
941
|
-
packageName:
|
|
942
|
-
shortName:
|
|
943
|
-
trialDays:
|
|
944
|
-
uninstalledAt:
|
|
994
|
+
activePackages: z3.array(
|
|
995
|
+
z3.object({
|
|
996
|
+
cancelledAt: z3.string().nullable(),
|
|
997
|
+
id: z3.number(),
|
|
998
|
+
installedAt: z3.string().nullable(),
|
|
999
|
+
isActive: z3.boolean(),
|
|
1000
|
+
isBillable: z3.boolean(),
|
|
1001
|
+
packageId: z3.number(),
|
|
1002
|
+
packageName: z3.string(),
|
|
1003
|
+
shortName: z3.string(),
|
|
1004
|
+
trialDays: z3.number(),
|
|
1005
|
+
uninstalledAt: z3.string().nullable()
|
|
945
1006
|
})
|
|
946
1007
|
),
|
|
947
|
-
apiKey:
|
|
948
|
-
billingVersion:
|
|
949
|
-
cacheKey:
|
|
950
|
-
carousel:
|
|
951
|
-
currency:
|
|
952
|
-
currencySymbol:
|
|
953
|
-
domain:
|
|
954
|
-
enabledJquery:
|
|
955
|
-
enabledPresentmentCurrencies:
|
|
956
|
-
hasSmartCollectionsEnabled:
|
|
957
|
-
hasSmartSearchEnabled:
|
|
958
|
-
id:
|
|
959
|
-
integrations:
|
|
960
|
-
|
|
1008
|
+
apiKey: z3.string(),
|
|
1009
|
+
billingVersion: z3.string(),
|
|
1010
|
+
cacheKey: z3.coerce.number(),
|
|
1011
|
+
carousel: z3.enum(["flickity", "splide"]),
|
|
1012
|
+
currency: z3.string(),
|
|
1013
|
+
currencySymbol: z3.string(),
|
|
1014
|
+
domain: z3.string(),
|
|
1015
|
+
enabledJquery: z3.boolean(),
|
|
1016
|
+
enabledPresentmentCurrencies: z3.array(z3.string()),
|
|
1017
|
+
hasSmartCollectionsEnabled: z3.boolean(),
|
|
1018
|
+
hasSmartSearchEnabled: z3.boolean(),
|
|
1019
|
+
id: z3.coerce.number(),
|
|
1020
|
+
integrations: z3.record(
|
|
1021
|
+
z3.enum([
|
|
961
1022
|
"attentive",
|
|
962
1023
|
"judgeme",
|
|
963
1024
|
"junip",
|
|
@@ -970,55 +1031,55 @@ var ShopConfig = z2.object({
|
|
|
970
1031
|
"stamped",
|
|
971
1032
|
"yotpo"
|
|
972
1033
|
]),
|
|
973
|
-
|
|
1034
|
+
z3.union([z3.boolean(), z3.unknown()])
|
|
974
1035
|
),
|
|
975
|
-
markets:
|
|
976
|
-
enabled:
|
|
1036
|
+
markets: z3.object({
|
|
1037
|
+
enabled: z3.boolean()
|
|
977
1038
|
}),
|
|
978
|
-
moneyFormat:
|
|
979
|
-
myshopifyDomain:
|
|
980
|
-
primaryLocale:
|
|
981
|
-
productGroupsEnabled:
|
|
982
|
-
rechargeCustomDomain:
|
|
983
|
-
sellingPlansEnabled:
|
|
984
|
-
shopId:
|
|
985
|
-
shopifySellingPlansEnabled:
|
|
986
|
-
shopName:
|
|
987
|
-
storefrontAccessToken:
|
|
988
|
-
useRebuyIcons:
|
|
1039
|
+
moneyFormat: z3.string(),
|
|
1040
|
+
myshopifyDomain: z3.string(),
|
|
1041
|
+
primaryLocale: z3.string(),
|
|
1042
|
+
productGroupsEnabled: z3.enum(["no", "yes"]).transform((value) => value === "yes"),
|
|
1043
|
+
rechargeCustomDomain: z3.string().nullable(),
|
|
1044
|
+
sellingPlansEnabled: z3.boolean(),
|
|
1045
|
+
shopId: z3.number(),
|
|
1046
|
+
shopifySellingPlansEnabled: z3.boolean(),
|
|
1047
|
+
shopName: z3.string(),
|
|
1048
|
+
storefrontAccessToken: z3.string().nullable(),
|
|
1049
|
+
useRebuyIcons: z3.boolean()
|
|
989
1050
|
});
|
|
990
1051
|
|
|
991
1052
|
// src/schema/userConfig.ts
|
|
992
|
-
import { z as
|
|
993
|
-
var UserConfig =
|
|
1053
|
+
import { z as z4 } from "zod/v4";
|
|
1054
|
+
var UserConfig = z4.object({
|
|
994
1055
|
shop: ShopConfig,
|
|
995
|
-
smartCart:
|
|
996
|
-
smartFlows:
|
|
1056
|
+
smartCart: z4.unknown(),
|
|
1057
|
+
smartFlows: z4.array(z4.unknown())
|
|
997
1058
|
});
|
|
998
1059
|
|
|
999
1060
|
// src/schema/widgetData.ts
|
|
1000
|
-
import { z as
|
|
1061
|
+
import { z as z30 } from "zod/v4";
|
|
1001
1062
|
|
|
1002
1063
|
// src/schema/widgets/abTestingPlaceholder.ts
|
|
1003
|
-
import { z as
|
|
1004
|
-
var ABTestingPlaceholder =
|
|
1005
|
-
type:
|
|
1064
|
+
import { z as z5 } from "zod/v4";
|
|
1065
|
+
var ABTestingPlaceholder = z5.looseObject({
|
|
1066
|
+
type: z5.literal("placeholder")
|
|
1006
1067
|
});
|
|
1007
1068
|
|
|
1008
1069
|
// src/schema/widgets/checkout-and-beyond/constants.ts
|
|
1009
1070
|
import { uniqBy } from "lodash-es";
|
|
1010
|
-
import { z as
|
|
1071
|
+
import { z as z7 } from "zod/v4";
|
|
1011
1072
|
|
|
1012
1073
|
// src/schema/widgets/checkout-and-beyond/common.ts
|
|
1013
|
-
import { z as
|
|
1074
|
+
import { z as z6 } from "zod/v4";
|
|
1014
1075
|
var borderRadii = ["none", "small", "base", "large", "fullyRounded"];
|
|
1015
|
-
var borderRadius =
|
|
1076
|
+
var borderRadius = z6.enum(borderRadii);
|
|
1016
1077
|
var BorderRadius = borderRadius.enum;
|
|
1017
1078
|
var borderStyles = ["none", "base", "dotted", "dashed"];
|
|
1018
|
-
var borderStyle =
|
|
1079
|
+
var borderStyle = z6.enum(borderStyles);
|
|
1019
1080
|
var BorderStyle = borderStyle.enum;
|
|
1020
1081
|
var borderWidths = ["base", "medium", "thick"];
|
|
1021
|
-
var borderWidth =
|
|
1082
|
+
var borderWidth = z6.enum(borderWidths);
|
|
1022
1083
|
var BorderWidth = borderWidth.enum;
|
|
1023
1084
|
var buttonActions = [
|
|
1024
1085
|
"addToOrder",
|
|
@@ -1031,7 +1092,7 @@ var buttonActions = [
|
|
|
1031
1092
|
"showVariants",
|
|
1032
1093
|
"switchToSubscription"
|
|
1033
1094
|
];
|
|
1034
|
-
var buttonAction =
|
|
1095
|
+
var buttonAction = z6.enum(buttonActions);
|
|
1035
1096
|
var ButtonAction = buttonAction.enum;
|
|
1036
1097
|
var buttonFields = [
|
|
1037
1098
|
"addedToCart",
|
|
@@ -1052,13 +1113,13 @@ var buttonFields = [
|
|
|
1052
1113
|
"switchToSubscriptionNoDiscount",
|
|
1053
1114
|
"switchToSubscriptionWithDiscount"
|
|
1054
1115
|
];
|
|
1055
|
-
var buttonField =
|
|
1116
|
+
var buttonField = z6.enum(buttonFields);
|
|
1056
1117
|
var ButtonField = buttonField.enum;
|
|
1057
1118
|
var buttonStyles = ["primary", "secondary", "plain", "custom"];
|
|
1058
|
-
var buttonStyle =
|
|
1119
|
+
var buttonStyle = z6.enum(buttonStyles);
|
|
1059
1120
|
var ButtonStyle = buttonStyle.enum;
|
|
1060
1121
|
var directions = ["columns", "rows"];
|
|
1061
|
-
var direction =
|
|
1122
|
+
var direction = z6.enum(directions);
|
|
1062
1123
|
var Direction = direction.enum;
|
|
1063
1124
|
var editorModes = [
|
|
1064
1125
|
"checkoutExtension",
|
|
@@ -1068,10 +1129,10 @@ var editorModes = [
|
|
|
1068
1129
|
"ordersIndexPage",
|
|
1069
1130
|
"customerProfilePage"
|
|
1070
1131
|
];
|
|
1071
|
-
var editorMode =
|
|
1132
|
+
var editorMode = z6.enum(editorModes);
|
|
1072
1133
|
var EditorMode = editorMode.enum;
|
|
1073
1134
|
var horizontalAlignments = ["start", "center", "end"];
|
|
1074
|
-
var horizontalAlignment =
|
|
1135
|
+
var horizontalAlignment = z6.enum(horizontalAlignments);
|
|
1075
1136
|
var HorizontalAlignment = horizontalAlignment.enum;
|
|
1076
1137
|
var languageKeys = [
|
|
1077
1138
|
"ar",
|
|
@@ -1101,13 +1162,13 @@ var languageKeys = [
|
|
|
1101
1162
|
"vi",
|
|
1102
1163
|
"zh"
|
|
1103
1164
|
];
|
|
1104
|
-
var languageKey =
|
|
1165
|
+
var languageKey = z6.enum(languageKeys);
|
|
1105
1166
|
var LanguageKey = languageKey.enum;
|
|
1106
1167
|
var objectFits = ["cover", "contain"];
|
|
1107
|
-
var objectFit =
|
|
1168
|
+
var objectFit = z6.enum(objectFits);
|
|
1108
1169
|
var ObjectFit = objectFit.enum;
|
|
1109
1170
|
var quantityInputs = ["select", "number"];
|
|
1110
|
-
var quantityInput =
|
|
1171
|
+
var quantityInput = z6.enum(quantityInputs);
|
|
1111
1172
|
var QuantityInput = quantityInput.enum;
|
|
1112
1173
|
var sectionTypes = [
|
|
1113
1174
|
"button",
|
|
@@ -1124,25 +1185,25 @@ var sectionTypes = [
|
|
|
1124
1185
|
"text",
|
|
1125
1186
|
"variants"
|
|
1126
1187
|
];
|
|
1127
|
-
var sectionType =
|
|
1188
|
+
var sectionType = z6.enum(sectionTypes);
|
|
1128
1189
|
var SectionType = sectionType.enum;
|
|
1129
1190
|
var spacings = ["none", "extraTight", "tight", "base", "loose", "extraLoose"];
|
|
1130
|
-
var spacing =
|
|
1191
|
+
var spacing = z6.enum(spacings);
|
|
1131
1192
|
var Spacing = spacing.enum;
|
|
1132
1193
|
var textAlignments = ["start", "center", "end"];
|
|
1133
|
-
var textAlignment =
|
|
1194
|
+
var textAlignment = z6.enum(textAlignments);
|
|
1134
1195
|
var TextAlignment = textAlignment.enum;
|
|
1135
1196
|
var textColorNames = ["base", "subdued", "accent", "decorative", "success", "warning", "critical"];
|
|
1136
|
-
var textColorName =
|
|
1197
|
+
var textColorName = z6.enum(textColorNames);
|
|
1137
1198
|
var TextColorName = textColorName.enum;
|
|
1138
1199
|
var textSizeNames = ["extraSmall", "small", "base", "medium", "large", "extraLarge"];
|
|
1139
|
-
var textSizeName =
|
|
1200
|
+
var textSizeName = z6.enum(textSizeNames);
|
|
1140
1201
|
var TextSizeName = textSizeName.enum;
|
|
1141
1202
|
var variantSelectors = ["menu", "button", "radio", "color", "image"];
|
|
1142
|
-
var variantSelector =
|
|
1203
|
+
var variantSelector = z6.enum(variantSelectors);
|
|
1143
1204
|
var VariantSelector = variantSelector.enum;
|
|
1144
1205
|
var verticalAlignments = ["top", "middle", "bottom"];
|
|
1145
|
-
var verticalAlignment =
|
|
1206
|
+
var verticalAlignment = z6.enum(verticalAlignments);
|
|
1146
1207
|
var VerticalAlignment = verticalAlignment.enum;
|
|
1147
1208
|
|
|
1148
1209
|
// src/schema/widgets/checkout-and-beyond/constants.ts
|
|
@@ -1218,35 +1279,35 @@ var widgetTypes = [
|
|
|
1218
1279
|
"ui_extension_line_item_editor",
|
|
1219
1280
|
"ui_extension_progress_bar"
|
|
1220
1281
|
];
|
|
1221
|
-
var widgetType =
|
|
1282
|
+
var widgetType = z7.enum(widgetTypes);
|
|
1222
1283
|
var WidgetType = widgetType.enum;
|
|
1223
1284
|
|
|
1224
1285
|
// src/schema/widgets/checkoutExtension.ts
|
|
1225
|
-
import { z as
|
|
1226
|
-
var CheckoutExtension =
|
|
1227
|
-
type:
|
|
1286
|
+
import { z as z8 } from "zod/v4";
|
|
1287
|
+
var CheckoutExtension = z8.looseObject({
|
|
1288
|
+
type: z8.literal(WidgetType.shopify_checkout_extension).default(WidgetType.shopify_checkout_extension)
|
|
1228
1289
|
});
|
|
1229
1290
|
|
|
1230
1291
|
// src/schema/widgets/contentBlock.ts
|
|
1231
|
-
import { z as
|
|
1292
|
+
import { z as z24 } from "zod/v4";
|
|
1232
1293
|
|
|
1233
1294
|
// src/schema/widgets/checkout-and-beyond/root.ts
|
|
1234
|
-
import { z as
|
|
1295
|
+
import { z as z23 } from "zod/v4";
|
|
1235
1296
|
|
|
1236
1297
|
// src/schema/widgets/checkout-and-beyond/layout.ts
|
|
1237
1298
|
import { v7 as uuidv712 } from "uuid";
|
|
1238
|
-
import { z as
|
|
1299
|
+
import { z as z22 } from "zod/v4";
|
|
1239
1300
|
|
|
1240
1301
|
// src/schema/widgets/checkout-and-beyond/shared.ts
|
|
1241
|
-
import { z as
|
|
1302
|
+
import { z as z21 } from "zod/v4";
|
|
1242
1303
|
|
|
1243
1304
|
// src/schema/widgets/checkout-and-beyond/button.ts
|
|
1244
1305
|
import { v7 as uuidv73 } from "uuid";
|
|
1245
|
-
import { z as
|
|
1306
|
+
import { z as z11 } from "zod/v4";
|
|
1246
1307
|
|
|
1247
1308
|
// src/schema/widgets/checkout-and-beyond/image.ts
|
|
1248
1309
|
import { v7 as uuidv7 } from "uuid";
|
|
1249
|
-
import { z as
|
|
1310
|
+
import { z as z9 } from "zod/v4";
|
|
1250
1311
|
|
|
1251
1312
|
// src/schema/widgets/checkout-and-beyond/regex.ts
|
|
1252
1313
|
var ARRAY_INDEX_STRING = /^(0|[1-9]\d*)$/;
|
|
@@ -1293,77 +1354,77 @@ var convertNumericObjects = (input) => {
|
|
|
1293
1354
|
};
|
|
1294
1355
|
|
|
1295
1356
|
// src/schema/widgets/checkout-and-beyond/image.ts
|
|
1296
|
-
var CABImageSection =
|
|
1297
|
-
altText:
|
|
1298
|
-
aspectRatio:
|
|
1299
|
-
border:
|
|
1300
|
-
buttonField:
|
|
1301
|
-
category:
|
|
1302
|
-
name:
|
|
1303
|
-
naturalHeight:
|
|
1304
|
-
naturalWidth:
|
|
1305
|
-
objectFit:
|
|
1306
|
-
sectionId:
|
|
1307
|
-
sectionType:
|
|
1308
|
-
source:
|
|
1309
|
-
width:
|
|
1357
|
+
var CABImageSection = z9.object({
|
|
1358
|
+
altText: z9.string().refine(checkForHTML, NO_HTML).default(""),
|
|
1359
|
+
aspectRatio: z9.literal(1).nullable().default(null),
|
|
1360
|
+
border: z9.lazy(() => CABBorder),
|
|
1361
|
+
buttonField: z9.enum(buttonFields).optional(),
|
|
1362
|
+
category: z9.enum(["gallery", "icons", "payment-methods", "secure-checkout"]).nullable().default(null),
|
|
1363
|
+
name: z9.string().optional(),
|
|
1364
|
+
naturalHeight: z9.number().default(0),
|
|
1365
|
+
naturalWidth: z9.number().default(0),
|
|
1366
|
+
objectFit: z9.enum(objectFits).default(ObjectFit.cover),
|
|
1367
|
+
sectionId: z9.uuid().default(() => uuidv7()),
|
|
1368
|
+
sectionType: z9.literal(SectionType.image).default(SectionType.image),
|
|
1369
|
+
source: z9.union([z9.url(), z9.literal(""), z9.string().regex(DYNAMIC_TOKEN_REGEX)]).default(""),
|
|
1370
|
+
width: z9.number().default(100)
|
|
1310
1371
|
});
|
|
1311
1372
|
|
|
1312
1373
|
// src/schema/widgets/checkout-and-beyond/text.ts
|
|
1313
1374
|
import { forEach, isString as isString2 } from "lodash-es";
|
|
1314
1375
|
import { v7 as uuidv72 } from "uuid";
|
|
1315
|
-
import { z as
|
|
1316
|
-
var enumOrOmit = (...vals) =>
|
|
1317
|
-
var TiptapText =
|
|
1318
|
-
marks:
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
attrs:
|
|
1325
|
-
class:
|
|
1326
|
-
href:
|
|
1327
|
-
rel:
|
|
1328
|
-
target:
|
|
1376
|
+
import { z as z10 } from "zod/v4";
|
|
1377
|
+
var enumOrOmit = (...vals) => z10.string().transform((val) => vals.includes(val) ? val : void 0).optional();
|
|
1378
|
+
var TiptapText = z10.object({
|
|
1379
|
+
marks: z10.union([
|
|
1380
|
+
z10.array(
|
|
1381
|
+
z10.discriminatedUnion("type", [
|
|
1382
|
+
z10.object({ type: z10.literal("bold") }),
|
|
1383
|
+
z10.object({ type: z10.literal("italic") }),
|
|
1384
|
+
z10.object({
|
|
1385
|
+
attrs: z10.object({
|
|
1386
|
+
class: z10.string().nullable(),
|
|
1387
|
+
href: z10.union([z10.url(), z10.string().regex(DYNAMIC_TOKEN_REGEX)]),
|
|
1388
|
+
rel: z10.string().default("noopener noreferrer nofollow"),
|
|
1389
|
+
target: z10.string().default("_blank")
|
|
1329
1390
|
}),
|
|
1330
|
-
type:
|
|
1391
|
+
type: z10.literal("link")
|
|
1331
1392
|
}),
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
attrs:
|
|
1393
|
+
z10.object({ type: z10.literal("strike") }),
|
|
1394
|
+
z10.object({
|
|
1395
|
+
attrs: z10.object({
|
|
1335
1396
|
color: enumOrOmit(...textColorNames).default(TextColorName.base),
|
|
1336
1397
|
fontSize: enumOrOmit(...textSizeNames).default(TextSizeName.base)
|
|
1337
1398
|
}),
|
|
1338
|
-
type:
|
|
1399
|
+
type: z10.literal("textStyle")
|
|
1339
1400
|
})
|
|
1340
1401
|
])
|
|
1341
1402
|
),
|
|
1342
|
-
|
|
1403
|
+
z10.strictObject({}).transform(() => [])
|
|
1343
1404
|
]).optional(),
|
|
1344
|
-
text:
|
|
1345
|
-
type:
|
|
1405
|
+
text: z10.string().default(""),
|
|
1406
|
+
type: z10.literal("text").default("text")
|
|
1346
1407
|
});
|
|
1347
|
-
var TiptapParagraph =
|
|
1348
|
-
attrs:
|
|
1408
|
+
var TiptapParagraph = z10.object({
|
|
1409
|
+
attrs: z10.object({
|
|
1349
1410
|
textAlign: enumOrOmit(...textAlignments)
|
|
1350
1411
|
}).default({ textAlign: TextAlignment.start }),
|
|
1351
|
-
content:
|
|
1352
|
-
type:
|
|
1412
|
+
content: z10.union([z10.array(TiptapText), z10.strictObject({}).transform(() => [])]).default(() => []),
|
|
1413
|
+
type: z10.literal("paragraph").default("paragraph")
|
|
1353
1414
|
});
|
|
1354
|
-
var TiptapDocument =
|
|
1355
|
-
attrs:
|
|
1415
|
+
var TiptapDocument = z10.object({
|
|
1416
|
+
attrs: z10.object({
|
|
1356
1417
|
blockSpacing: enumOrOmit(...spacings)
|
|
1357
1418
|
}).default({ blockSpacing: Spacing.base }),
|
|
1358
|
-
content:
|
|
1359
|
-
type:
|
|
1419
|
+
content: z10.union([z10.array(TiptapParagraph), z10.strictObject({}).transform(() => [])]).default(() => [TiptapParagraph.parse({})]),
|
|
1420
|
+
type: z10.literal("doc").default("doc")
|
|
1360
1421
|
});
|
|
1361
|
-
var CABTextSection =
|
|
1362
|
-
buttonField:
|
|
1363
|
-
content:
|
|
1364
|
-
name:
|
|
1365
|
-
sectionId:
|
|
1366
|
-
sectionType:
|
|
1422
|
+
var CABTextSection = z10.object({
|
|
1423
|
+
buttonField: z10.enum(buttonFields).optional(),
|
|
1424
|
+
content: z10.record(z10.string(), z10.union([z10.string(), TiptapDocument]).refine(checkForHTML, NO_HTML).optional()).default({ en: TiptapDocument.parse({}) }).optional(),
|
|
1425
|
+
name: z10.string().optional(),
|
|
1426
|
+
sectionId: z10.uuid().default(() => uuidv72()),
|
|
1427
|
+
sectionType: z10.literal(SectionType.text).default(SectionType.text)
|
|
1367
1428
|
}).superRefine(({ buttonField: buttonField2, content }, ctx) => {
|
|
1368
1429
|
if (buttonField2 === ButtonField.destinationUrl && content) {
|
|
1369
1430
|
forEach(content, (value, lang) => {
|
|
@@ -1384,99 +1445,99 @@ var CABTextSection = z9.object({
|
|
|
1384
1445
|
});
|
|
1385
1446
|
|
|
1386
1447
|
// src/schema/widgets/checkout-and-beyond/button.ts
|
|
1387
|
-
var CABButtonContent =
|
|
1388
|
-
var CABButtonSection =
|
|
1389
|
-
action:
|
|
1390
|
-
buttonStyle:
|
|
1391
|
-
custom:
|
|
1392
|
-
color:
|
|
1393
|
-
height:
|
|
1394
|
-
width:
|
|
1448
|
+
var CABButtonContent = z11.lazy(() => z11.discriminatedUnion("sectionType", [CABImageSection, CABTextSection]));
|
|
1449
|
+
var CABButtonSection = z11.object({
|
|
1450
|
+
action: z11.union([z11.literal(""), z11.enum(buttonActions)]).default(""),
|
|
1451
|
+
buttonStyle: z11.enum(buttonStyles).default(ButtonStyle.primary),
|
|
1452
|
+
custom: z11.object({
|
|
1453
|
+
color: z11.string().regex(HEX_COLOR_REGEX).default("#005bd3"),
|
|
1454
|
+
height: z11.number().default(52),
|
|
1455
|
+
width: z11.number().default(300)
|
|
1395
1456
|
}).default({
|
|
1396
1457
|
color: "#005bd3",
|
|
1397
1458
|
height: 52,
|
|
1398
1459
|
width: 300
|
|
1399
1460
|
}),
|
|
1400
|
-
name:
|
|
1401
|
-
sectionId:
|
|
1402
|
-
sections:
|
|
1403
|
-
sectionType:
|
|
1461
|
+
name: z11.string().optional(),
|
|
1462
|
+
sectionId: z11.uuid().default(() => uuidv73()),
|
|
1463
|
+
sections: z11.union([z11.array(CABButtonContent), z11.strictObject({}).transform(() => [])]).default(() => []),
|
|
1464
|
+
sectionType: z11.literal(SectionType.button).default(SectionType.button)
|
|
1404
1465
|
});
|
|
1405
1466
|
|
|
1406
1467
|
// src/schema/widgets/checkout-and-beyond/dataSource.ts
|
|
1407
1468
|
import { v7 as uuidv74 } from "uuid";
|
|
1408
|
-
import { z as
|
|
1409
|
-
var CABDataSourceSection =
|
|
1410
|
-
dataSourceId:
|
|
1411
|
-
dataSourcePath:
|
|
1412
|
-
limit:
|
|
1413
|
-
name:
|
|
1414
|
-
sectionId:
|
|
1415
|
-
sectionType:
|
|
1469
|
+
import { z as z12 } from "zod/v4";
|
|
1470
|
+
var CABDataSourceSection = z12.object({
|
|
1471
|
+
dataSourceId: z12.number().nullable().default(null),
|
|
1472
|
+
dataSourcePath: z12.string().default(DEFAULT_ENDPOINTS[0].value),
|
|
1473
|
+
limit: z12.number().default(1),
|
|
1474
|
+
name: z12.string().default(DEFAULT_ENDPOINTS[0].label),
|
|
1475
|
+
sectionId: z12.uuid().default(() => uuidv74()),
|
|
1476
|
+
sectionType: z12.literal(SectionType.dataSource).default(SectionType.dataSource)
|
|
1416
1477
|
});
|
|
1417
1478
|
|
|
1418
1479
|
// src/schema/widgets/checkout-and-beyond/offers.ts
|
|
1419
|
-
import { z as
|
|
1480
|
+
import { z as z15 } from "zod/v4";
|
|
1420
1481
|
|
|
1421
1482
|
// src/schema/widgets/checkout-and-beyond/products.ts
|
|
1422
1483
|
import { v7 as uuidv76 } from "uuid";
|
|
1423
|
-
import { z as
|
|
1484
|
+
import { z as z14 } from "zod/v4";
|
|
1424
1485
|
|
|
1425
1486
|
// src/schema/widgets/checkout-and-beyond/product.ts
|
|
1426
1487
|
import { v7 as uuidv75 } from "uuid";
|
|
1427
|
-
import { z as
|
|
1428
|
-
var CABProductSection =
|
|
1429
|
-
name:
|
|
1430
|
-
options:
|
|
1431
|
-
|
|
1488
|
+
import { z as z13 } from "zod/v4";
|
|
1489
|
+
var CABProductSection = z13.object({
|
|
1490
|
+
name: z13.string().optional(),
|
|
1491
|
+
options: z13.array(
|
|
1492
|
+
z13.object({
|
|
1432
1493
|
/** `name` represents `Color`, `Size`, etc. */
|
|
1433
|
-
name:
|
|
1434
|
-
optionId:
|
|
1435
|
-
selector:
|
|
1436
|
-
values:
|
|
1437
|
-
|
|
1438
|
-
color:
|
|
1439
|
-
image:
|
|
1494
|
+
name: z13.string(),
|
|
1495
|
+
optionId: z13.number(),
|
|
1496
|
+
selector: z13.enum(variantSelectors).default(VariantSelector.menu),
|
|
1497
|
+
values: z13.array(
|
|
1498
|
+
z13.object({
|
|
1499
|
+
color: z13.string().optional(),
|
|
1500
|
+
image: z13.lazy(() => CABImageSection).optional(),
|
|
1440
1501
|
/** `name` represents `Red`, `Blue`, etc. */
|
|
1441
|
-
name:
|
|
1442
|
-
text:
|
|
1502
|
+
name: z13.string(),
|
|
1503
|
+
text: z13.lazy(() => CABTextSection).optional()
|
|
1443
1504
|
})
|
|
1444
1505
|
)
|
|
1445
1506
|
})
|
|
1446
1507
|
).default(() => []),
|
|
1447
|
-
productId:
|
|
1448
|
-
sectionId:
|
|
1449
|
-
sectionType:
|
|
1508
|
+
productId: z13.number().nullable().default(null),
|
|
1509
|
+
sectionId: z13.uuid().default(() => uuidv75()),
|
|
1510
|
+
sectionType: z13.literal(SectionType.product).default(SectionType.product)
|
|
1450
1511
|
});
|
|
1451
1512
|
|
|
1452
1513
|
// src/schema/widgets/checkout-and-beyond/products.ts
|
|
1453
|
-
var CABProductsSection =
|
|
1454
|
-
name:
|
|
1455
|
-
sectionId:
|
|
1456
|
-
sections:
|
|
1457
|
-
sectionType:
|
|
1514
|
+
var CABProductsSection = z14.object({
|
|
1515
|
+
name: z14.string().optional(),
|
|
1516
|
+
sectionId: z14.uuid().default(() => uuidv76()),
|
|
1517
|
+
sections: z14.union([z14.array(z14.lazy(() => CABProductSection)), z14.strictObject({}).transform(() => [])]).default(() => []),
|
|
1518
|
+
sectionType: z14.literal(SectionType.products).default(SectionType.products)
|
|
1458
1519
|
});
|
|
1459
1520
|
|
|
1460
1521
|
// src/schema/widgets/checkout-and-beyond/offers.ts
|
|
1461
|
-
var CABOffersSection =
|
|
1522
|
+
var CABOffersSection = z15.lazy(
|
|
1462
1523
|
() => CABLayoutSection.omit({ sections: true, sectionType: true }).extend(
|
|
1463
|
-
|
|
1464
|
-
sections:
|
|
1465
|
-
sectionType:
|
|
1524
|
+
z15.object({
|
|
1525
|
+
sections: z15.union([z15.array(z15.lazy(() => CABSection)), z15.strictObject({}).transform(() => [])]).default(() => [CABDataSourceSection.parse({}), CABProductsSection.parse({})]),
|
|
1526
|
+
sectionType: z15.literal(SectionType.offers).default(SectionType.offers)
|
|
1466
1527
|
}).shape
|
|
1467
1528
|
)
|
|
1468
1529
|
);
|
|
1469
1530
|
|
|
1470
1531
|
// src/schema/widgets/checkout-and-beyond/quantity.ts
|
|
1471
1532
|
import { v7 as uuidv77 } from "uuid";
|
|
1472
|
-
import { z as
|
|
1473
|
-
var CABQuantitySection =
|
|
1474
|
-
errorMessages:
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
max:
|
|
1478
|
-
min:
|
|
1479
|
-
neg:
|
|
1533
|
+
import { z as z16 } from "zod/v4";
|
|
1534
|
+
var CABQuantitySection = z16.object({
|
|
1535
|
+
errorMessages: z16.record(
|
|
1536
|
+
z16.string(),
|
|
1537
|
+
z16.object({
|
|
1538
|
+
max: z16.string().optional(),
|
|
1539
|
+
min: z16.string().optional(),
|
|
1540
|
+
neg: z16.string().optional()
|
|
1480
1541
|
})
|
|
1481
1542
|
).default({
|
|
1482
1543
|
en: {
|
|
@@ -1485,64 +1546,64 @@ var CABQuantitySection = z15.object({
|
|
|
1485
1546
|
neg: "Quantity cannot be negative"
|
|
1486
1547
|
}
|
|
1487
1548
|
}),
|
|
1488
|
-
inputType:
|
|
1489
|
-
max:
|
|
1490
|
-
min:
|
|
1491
|
-
name:
|
|
1492
|
-
sectionId:
|
|
1493
|
-
sectionType:
|
|
1549
|
+
inputType: z16.enum(quantityInputs).default(QuantityInput.select),
|
|
1550
|
+
max: z16.number().min(1).max(100).default(10),
|
|
1551
|
+
min: z16.number().min(1).default(1),
|
|
1552
|
+
name: z16.string().optional(),
|
|
1553
|
+
sectionId: z16.uuid().default(() => uuidv77()),
|
|
1554
|
+
sectionType: z16.literal(SectionType.quantity).default(SectionType.quantity)
|
|
1494
1555
|
});
|
|
1495
1556
|
|
|
1496
1557
|
// src/schema/widgets/checkout-and-beyond/reviews.ts
|
|
1497
1558
|
import { v7 as uuidv78 } from "uuid";
|
|
1498
|
-
import { z as
|
|
1499
|
-
var CABReviewsSection =
|
|
1500
|
-
name:
|
|
1501
|
-
sectionId:
|
|
1502
|
-
sectionType:
|
|
1559
|
+
import { z as z17 } from "zod/v4";
|
|
1560
|
+
var CABReviewsSection = z17.object({
|
|
1561
|
+
name: z17.string().optional(),
|
|
1562
|
+
sectionId: z17.uuid().default(() => uuidv78()),
|
|
1563
|
+
sectionType: z17.literal(SectionType.reviews).default(SectionType.reviews)
|
|
1503
1564
|
});
|
|
1504
1565
|
|
|
1505
1566
|
// src/schema/widgets/checkout-and-beyond/subscription.ts
|
|
1506
1567
|
import { v7 as uuidv79 } from "uuid";
|
|
1507
|
-
import { z as
|
|
1508
|
-
var CABSubscriptionSection =
|
|
1509
|
-
name:
|
|
1510
|
-
sectionId:
|
|
1511
|
-
sectionType:
|
|
1568
|
+
import { z as z18 } from "zod/v4";
|
|
1569
|
+
var CABSubscriptionSection = z18.object({
|
|
1570
|
+
name: z18.string().optional(),
|
|
1571
|
+
sectionId: z18.uuid().default(() => uuidv79()),
|
|
1572
|
+
sectionType: z18.literal(SectionType.subscription).default(SectionType.subscription)
|
|
1512
1573
|
});
|
|
1513
1574
|
|
|
1514
1575
|
// src/schema/widgets/checkout-and-beyond/table.ts
|
|
1515
1576
|
import { v7 as uuidv710 } from "uuid";
|
|
1516
|
-
import { z as
|
|
1517
|
-
var CABTableSection =
|
|
1518
|
-
name:
|
|
1519
|
-
sectionId:
|
|
1520
|
-
sectionType:
|
|
1577
|
+
import { z as z19 } from "zod/v4";
|
|
1578
|
+
var CABTableSection = z19.object({
|
|
1579
|
+
name: z19.string().optional(),
|
|
1580
|
+
sectionId: z19.uuid().default(() => uuidv710()),
|
|
1581
|
+
sectionType: z19.literal(SectionType.table).default(SectionType.table)
|
|
1521
1582
|
});
|
|
1522
1583
|
|
|
1523
1584
|
// src/schema/widgets/checkout-and-beyond/variants.ts
|
|
1524
1585
|
import { slice } from "lodash-es";
|
|
1525
1586
|
import { v7 as uuidv711 } from "uuid";
|
|
1526
|
-
import { z as
|
|
1527
|
-
var CABVariantsSection =
|
|
1528
|
-
name:
|
|
1529
|
-
sectionId:
|
|
1530
|
-
sectionType:
|
|
1531
|
-
selector:
|
|
1587
|
+
import { z as z20 } from "zod/v4";
|
|
1588
|
+
var CABVariantsSection = z20.object({
|
|
1589
|
+
name: z20.string().optional(),
|
|
1590
|
+
sectionId: z20.uuid().default(() => uuidv711()),
|
|
1591
|
+
sectionType: z20.literal(SectionType.variants).default(SectionType.variants),
|
|
1592
|
+
selector: z20.enum(slice(variantSelectors, 0, 3)).default(VariantSelector.menu)
|
|
1532
1593
|
});
|
|
1533
1594
|
|
|
1534
1595
|
// src/schema/widgets/checkout-and-beyond/shared.ts
|
|
1535
|
-
var CABBorder =
|
|
1536
|
-
radius:
|
|
1537
|
-
style:
|
|
1538
|
-
width:
|
|
1596
|
+
var CABBorder = z21.object({
|
|
1597
|
+
radius: z21.enum(borderRadii).default(BorderRadius.base),
|
|
1598
|
+
style: z21.enum(borderStyles).default(BorderStyle.none),
|
|
1599
|
+
width: z21.enum(borderWidths).default(BorderWidth.base)
|
|
1539
1600
|
}).default({
|
|
1540
1601
|
radius: BorderRadius.base,
|
|
1541
1602
|
style: BorderStyle.none,
|
|
1542
1603
|
width: BorderWidth.base
|
|
1543
1604
|
});
|
|
1544
|
-
var CABSection =
|
|
1545
|
-
() =>
|
|
1605
|
+
var CABSection = z21.lazy(
|
|
1606
|
+
() => z21.discriminatedUnion("sectionType", [
|
|
1546
1607
|
CABButtonSection,
|
|
1547
1608
|
CABDataSourceSection,
|
|
1548
1609
|
CABImageSection,
|
|
@@ -1560,115 +1621,115 @@ var CABSection = z20.lazy(
|
|
|
1560
1621
|
);
|
|
1561
1622
|
|
|
1562
1623
|
// src/schema/widgets/checkout-and-beyond/layout.ts
|
|
1563
|
-
var CABLayoutSection =
|
|
1564
|
-
alignment:
|
|
1565
|
-
horizontal:
|
|
1566
|
-
vertical:
|
|
1624
|
+
var CABLayoutSection = z22.object({
|
|
1625
|
+
alignment: z22.object({
|
|
1626
|
+
horizontal: z22.enum(horizontalAlignments).default(HorizontalAlignment.start),
|
|
1627
|
+
vertical: z22.enum(verticalAlignments).default(VerticalAlignment.top)
|
|
1567
1628
|
}).default({
|
|
1568
1629
|
horizontal: HorizontalAlignment.start,
|
|
1569
1630
|
vertical: VerticalAlignment.top
|
|
1570
1631
|
}),
|
|
1571
|
-
border:
|
|
1572
|
-
direction:
|
|
1573
|
-
name:
|
|
1574
|
-
padding:
|
|
1575
|
-
sectionId:
|
|
1576
|
-
sections:
|
|
1577
|
-
sectionType:
|
|
1578
|
-
spacing:
|
|
1579
|
-
width:
|
|
1632
|
+
border: z22.lazy(() => CABBorder),
|
|
1633
|
+
direction: z22.enum(directions).default(Direction.rows),
|
|
1634
|
+
name: z22.string().optional(),
|
|
1635
|
+
padding: z22.enum(spacings).default(Spacing.none),
|
|
1636
|
+
sectionId: z22.uuid().default(() => uuidv712()),
|
|
1637
|
+
sections: z22.union([z22.array(z22.lazy(() => CABSection)), z22.strictObject({}).transform(() => [])]).default(() => []),
|
|
1638
|
+
sectionType: z22.literal(SectionType.layout).default(SectionType.layout),
|
|
1639
|
+
spacing: z22.enum(spacings).default(Spacing.base),
|
|
1640
|
+
width: z22.number().default(100)
|
|
1580
1641
|
});
|
|
1581
1642
|
|
|
1582
1643
|
// src/schema/widgets/checkout-and-beyond/root.ts
|
|
1583
|
-
var TargetArea =
|
|
1584
|
-
fill:
|
|
1585
|
-
flip:
|
|
1586
|
-
icon:
|
|
1587
|
-
label:
|
|
1588
|
-
width:
|
|
1644
|
+
var TargetArea = z23.object({
|
|
1645
|
+
fill: z23.boolean().optional(),
|
|
1646
|
+
flip: z23.enum(["both", "horizontal", "vertical"]).optional(),
|
|
1647
|
+
icon: z23.string(),
|
|
1648
|
+
label: z23.string(),
|
|
1649
|
+
width: z23.string()
|
|
1589
1650
|
}).default(targetAreas[EditorMode.checkoutExtension][1]);
|
|
1590
1651
|
var CABRootSection = CABLayoutSection.extend(
|
|
1591
|
-
|
|
1592
|
-
editorMode:
|
|
1593
|
-
previewMode:
|
|
1594
|
-
storeId:
|
|
1652
|
+
z23.object({
|
|
1653
|
+
editorMode: z23.enum(editorModes).default(EditorMode.checkoutExtension),
|
|
1654
|
+
previewMode: z23.boolean().default(false),
|
|
1655
|
+
storeId: z23.number().nullable().default(null),
|
|
1595
1656
|
targetArea: TargetArea.nullable(),
|
|
1596
|
-
type:
|
|
1597
|
-
version:
|
|
1598
|
-
widgetId:
|
|
1657
|
+
type: z23.enum(widgetTypes).default(WidgetType.ui_extension_content_block),
|
|
1658
|
+
version: z23.literal(2).default(2),
|
|
1659
|
+
widgetId: z23.number().nullable().default(null)
|
|
1599
1660
|
}).shape
|
|
1600
1661
|
);
|
|
1601
1662
|
|
|
1602
1663
|
// src/schema/widgets/contentBlock.ts
|
|
1603
|
-
var ContentBlockV1 =
|
|
1604
|
-
blockSpacing:
|
|
1605
|
-
imageBlocks:
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
altText:
|
|
1609
|
-
description:
|
|
1610
|
-
id:
|
|
1611
|
-
imagePlacement:
|
|
1612
|
-
imageSize:
|
|
1613
|
-
imageUrl:
|
|
1614
|
-
textAlignment:
|
|
1615
|
-
textSize:
|
|
1664
|
+
var ContentBlockV1 = z24.object({
|
|
1665
|
+
blockSpacing: z24.enum(spacings),
|
|
1666
|
+
imageBlocks: z24.union([
|
|
1667
|
+
z24.array(
|
|
1668
|
+
z24.object({
|
|
1669
|
+
altText: z24.string().nullable(),
|
|
1670
|
+
description: z24.string().nullable(),
|
|
1671
|
+
id: z24.uuid(),
|
|
1672
|
+
imagePlacement: z24.enum(["top", "right", "bottom", "left"]),
|
|
1673
|
+
imageSize: z24.number(),
|
|
1674
|
+
imageUrl: z24.url(),
|
|
1675
|
+
textAlignment: z24.enum(["left", "center", "right"]),
|
|
1676
|
+
textSize: z24.enum(textSizeNames)
|
|
1616
1677
|
})
|
|
1617
1678
|
),
|
|
1618
|
-
|
|
1679
|
+
z24.strictObject({}).transform(() => [])
|
|
1619
1680
|
]),
|
|
1620
|
-
imageLayout:
|
|
1621
|
-
language:
|
|
1622
|
-
description:
|
|
1623
|
-
superTitle:
|
|
1624
|
-
title:
|
|
1681
|
+
imageLayout: z24.enum(["row", "column"]),
|
|
1682
|
+
language: z24.object({
|
|
1683
|
+
description: z24.string(),
|
|
1684
|
+
superTitle: z24.string(),
|
|
1685
|
+
title: z24.string()
|
|
1625
1686
|
}),
|
|
1626
|
-
previewMode:
|
|
1627
|
-
type:
|
|
1628
|
-
version:
|
|
1687
|
+
previewMode: z24.boolean(),
|
|
1688
|
+
type: z24.literal(WidgetType.ui_extension_content_block).default(WidgetType.ui_extension_content_block),
|
|
1689
|
+
version: z24.literal(1)
|
|
1629
1690
|
});
|
|
1630
|
-
var ContentBlock =
|
|
1691
|
+
var ContentBlock = z24.discriminatedUnion("version", [
|
|
1631
1692
|
ContentBlockV1,
|
|
1632
1693
|
CABRootSection.extend({
|
|
1633
|
-
type:
|
|
1694
|
+
type: z24.literal(WidgetType.ui_extension_content_block).default(WidgetType.ui_extension_content_block)
|
|
1634
1695
|
})
|
|
1635
1696
|
]);
|
|
1636
1697
|
|
|
1637
1698
|
// src/schema/widgets/giftWithPurchase.ts
|
|
1638
|
-
import { z as
|
|
1639
|
-
var GiftWithPurchase =
|
|
1640
|
-
type:
|
|
1699
|
+
import { z as z25 } from "zod/v4";
|
|
1700
|
+
var GiftWithPurchase = z25.looseObject({
|
|
1701
|
+
type: z25.literal(WidgetType.gift_with_purchase).default(WidgetType.gift_with_purchase)
|
|
1641
1702
|
});
|
|
1642
1703
|
|
|
1643
1704
|
// src/schema/widgets/lineItemEditor.ts
|
|
1644
|
-
import { z as
|
|
1645
|
-
var LineItemEditor =
|
|
1646
|
-
type:
|
|
1705
|
+
import { z as z26 } from "zod/v4";
|
|
1706
|
+
var LineItemEditor = z26.looseObject({
|
|
1707
|
+
type: z26.literal(WidgetType.ui_extension_line_item_editor).default(WidgetType.ui_extension_line_item_editor)
|
|
1647
1708
|
});
|
|
1648
1709
|
|
|
1649
1710
|
// src/schema/widgets/progressBar.ts
|
|
1650
|
-
import { z as
|
|
1651
|
-
var ProgressBar =
|
|
1652
|
-
type:
|
|
1711
|
+
import { z as z27 } from "zod/v4";
|
|
1712
|
+
var ProgressBar = z27.looseObject({
|
|
1713
|
+
type: z27.literal(WidgetType.ui_extension_progress_bar).default(WidgetType.ui_extension_progress_bar)
|
|
1653
1714
|
});
|
|
1654
1715
|
|
|
1655
1716
|
// src/schema/widgets/rebuyButton.ts
|
|
1656
|
-
import { z as
|
|
1657
|
-
var RebuyButtonV1 =
|
|
1658
|
-
type:
|
|
1659
|
-
version:
|
|
1717
|
+
import { z as z28 } from "zod/v4";
|
|
1718
|
+
var RebuyButtonV1 = z28.looseObject({
|
|
1719
|
+
type: z28.literal(WidgetType.ui_extension_button).default(WidgetType.ui_extension_button),
|
|
1720
|
+
version: z28.literal(1)
|
|
1660
1721
|
});
|
|
1661
|
-
var RebuyButton =
|
|
1722
|
+
var RebuyButton = z28.discriminatedUnion("version", [
|
|
1662
1723
|
RebuyButtonV1,
|
|
1663
1724
|
CABRootSection.extend({
|
|
1664
|
-
type:
|
|
1725
|
+
type: z28.literal(WidgetType.ui_extension_button).default(WidgetType.ui_extension_button)
|
|
1665
1726
|
})
|
|
1666
1727
|
]);
|
|
1667
1728
|
|
|
1668
1729
|
// src/schema/widgets/rebuyMonetize.ts
|
|
1669
|
-
import { z as
|
|
1670
|
-
var RebuyMonetize =
|
|
1671
|
-
type:
|
|
1730
|
+
import { z as z29 } from "zod/v4";
|
|
1731
|
+
var RebuyMonetize = z29.looseObject({
|
|
1732
|
+
type: z29.literal(WidgetType.ui_extension_ad).default(WidgetType.ui_extension_ad)
|
|
1672
1733
|
});
|
|
1673
1734
|
|
|
1674
1735
|
// src/schema/widgetData.ts
|
|
@@ -1682,7 +1743,7 @@ var extensionWidgetTypes = [
|
|
|
1682
1743
|
WidgetType.ui_extension_line_item_editor,
|
|
1683
1744
|
WidgetType.ui_extension_progress_bar
|
|
1684
1745
|
];
|
|
1685
|
-
var WidgetData =
|
|
1746
|
+
var WidgetData = z30.discriminatedUnion("type", [
|
|
1686
1747
|
ABTestingPlaceholder,
|
|
1687
1748
|
CheckoutExtension,
|
|
1688
1749
|
ContentBlock,
|
|
@@ -1801,6 +1862,7 @@ export {
|
|
|
1801
1862
|
isTextType,
|
|
1802
1863
|
isVariantsType,
|
|
1803
1864
|
languageKeys,
|
|
1865
|
+
metadataSchema,
|
|
1804
1866
|
objectFits,
|
|
1805
1867
|
productImageObject,
|
|
1806
1868
|
productSchema,
|