@rebuy/rebuy 2.2.0-rc.6 → 2.2.0-rc.8
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 +39 -39
- package/dist/index.js.map +2 -2
- package/dist/index.mjs +39 -39
- package/dist/index.mjs.map +2 -2
- package/dist/schema/button.d.ts +36 -36
- package/dist/schema/button.d.ts.map +1 -1
- package/dist/schema/constants.d.ts.map +1 -1
- package/dist/schema/data-source.d.ts +1 -1
- package/dist/schema/data-source.d.ts.map +1 -1
- package/dist/schema/image.d.ts +3 -3
- package/dist/schema/image.d.ts.map +1 -1
- package/dist/schema/layout.d.ts +4 -4
- package/dist/schema/layout.d.ts.map +1 -1
- package/dist/schema/offers.d.ts +5 -5
- package/dist/schema/offers.d.ts.map +1 -1
- package/dist/schema/product.d.ts +21 -23
- package/dist/schema/product.d.ts.map +1 -1
- package/dist/schema/products.d.ts +23 -23
- package/dist/schema/products.d.ts.map +1 -1
- package/dist/schema/quantity.d.ts +2 -2
- package/dist/schema/quantity.d.ts.map +1 -1
- package/dist/schema/reviews.d.ts +1 -1
- package/dist/schema/reviews.d.ts.map +1 -1
- package/dist/schema/root.d.ts +5 -5
- package/dist/schema/root.d.ts.map +1 -1
- package/dist/schema/shared.d.ts +1 -1
- package/dist/schema/shared.d.ts.map +1 -1
- package/dist/schema/subscription.d.ts +1 -1
- package/dist/schema/subscription.d.ts.map +1 -1
- package/dist/schema/table.d.ts +1 -1
- package/dist/schema/table.d.ts.map +1 -1
- package/dist/schema/text.d.ts +43 -43
- package/dist/schema/text.d.ts.map +1 -1
- package/dist/schema/utils.d.ts.map +1 -1
- package/dist/schema/variants.d.ts +1 -1
- package/dist/schema/variants.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -968,7 +968,7 @@ var widgetType = z2.enum(widgetTypes);
|
|
|
968
968
|
var WidgetType = widgetType.enum;
|
|
969
969
|
|
|
970
970
|
// src/schema/data-source.ts
|
|
971
|
-
var CABDataSourceSection = z3.
|
|
971
|
+
var CABDataSourceSection = z3.object({
|
|
972
972
|
dataSourceId: z3.number().nullable().default(null),
|
|
973
973
|
dataSourcePath: z3.string().default(DEFAULT_ENDPOINTS[0].value),
|
|
974
974
|
limit: z3.number().default(1),
|
|
@@ -980,15 +980,15 @@ var CABDataSourceSection = z3.strictObject({
|
|
|
980
980
|
// src/schema/layout.ts
|
|
981
981
|
import { v7 as uuidv72 } from "uuid";
|
|
982
982
|
import { z as z4 } from "zod/v4";
|
|
983
|
-
var CABLayoutSection = z4.
|
|
984
|
-
alignment: z4.
|
|
983
|
+
var CABLayoutSection = z4.object({
|
|
984
|
+
alignment: z4.object({
|
|
985
985
|
horizontal: z4.enum(horizontalAlignments).default(HorizontalAlignment.start),
|
|
986
986
|
vertical: z4.enum(verticalAlignments).default(VerticalAlignment.top)
|
|
987
987
|
}).default({
|
|
988
988
|
horizontal: HorizontalAlignment.start,
|
|
989
989
|
vertical: VerticalAlignment.top
|
|
990
990
|
}),
|
|
991
|
-
border: CABBorder,
|
|
991
|
+
border: z4.lazy(() => CABBorder),
|
|
992
992
|
direction: z4.enum(directions).default(Direction.rows),
|
|
993
993
|
name: z4.string().optional(),
|
|
994
994
|
padding: z4.enum(spacings).default(Spacing.none),
|
|
@@ -1045,13 +1045,13 @@ var isVariantsType = (section) => get2(section, "sectionType") === SectionType.v
|
|
|
1045
1045
|
|
|
1046
1046
|
// src/schema/text.ts
|
|
1047
1047
|
var enumOrOmit = (...vals) => z5.string().transform((val) => vals.includes(val) ? val : void 0).optional();
|
|
1048
|
-
var TiptapText = z5.
|
|
1048
|
+
var TiptapText = z5.object({
|
|
1049
1049
|
marks: z5.array(
|
|
1050
1050
|
z5.discriminatedUnion("type", [
|
|
1051
|
-
z5.
|
|
1052
|
-
z5.
|
|
1053
|
-
z5.
|
|
1054
|
-
attrs: z5.
|
|
1051
|
+
z5.object({ type: z5.literal("bold") }),
|
|
1052
|
+
z5.object({ type: z5.literal("italic") }),
|
|
1053
|
+
z5.object({
|
|
1054
|
+
attrs: z5.object({
|
|
1055
1055
|
class: z5.string().nullable(),
|
|
1056
1056
|
href: z5.union([z5.url(), z5.string().regex(DYNAMIC_TOKEN_REGEX)]),
|
|
1057
1057
|
rel: z5.string().default("noopener noreferrer nofollow"),
|
|
@@ -1059,9 +1059,9 @@ var TiptapText = z5.strictObject({
|
|
|
1059
1059
|
}),
|
|
1060
1060
|
type: z5.literal("link")
|
|
1061
1061
|
}),
|
|
1062
|
-
z5.
|
|
1063
|
-
z5.
|
|
1064
|
-
attrs: z5.
|
|
1062
|
+
z5.object({ type: z5.literal("strike") }),
|
|
1063
|
+
z5.object({
|
|
1064
|
+
attrs: z5.object({
|
|
1065
1065
|
color: enumOrOmit(...textColorNames).default(TextColorName.base),
|
|
1066
1066
|
fontSize: enumOrOmit(...textSizeNames).default(TextSizeName.base)
|
|
1067
1067
|
}),
|
|
@@ -1072,21 +1072,21 @@ var TiptapText = z5.strictObject({
|
|
|
1072
1072
|
text: z5.string().default(""),
|
|
1073
1073
|
type: z5.literal("text").default("text")
|
|
1074
1074
|
});
|
|
1075
|
-
var TiptapParagraph = z5.
|
|
1076
|
-
attrs: z5.
|
|
1075
|
+
var TiptapParagraph = z5.object({
|
|
1076
|
+
attrs: z5.object({
|
|
1077
1077
|
textAlign: enumOrOmit(...textAlignments)
|
|
1078
1078
|
}).default({ textAlign: TextAlignment.start }),
|
|
1079
1079
|
content: z5.array(TiptapText).default([]),
|
|
1080
1080
|
type: z5.literal("paragraph").default("paragraph")
|
|
1081
1081
|
});
|
|
1082
|
-
var TiptapDocument = z5.
|
|
1083
|
-
attrs: z5.
|
|
1082
|
+
var TiptapDocument = z5.object({
|
|
1083
|
+
attrs: z5.object({
|
|
1084
1084
|
blockSpacing: enumOrOmit(...spacings)
|
|
1085
1085
|
}).default({ blockSpacing: Spacing.base }),
|
|
1086
1086
|
content: z5.array(TiptapParagraph).default([TiptapParagraph.parse({})]),
|
|
1087
1087
|
type: z5.literal("doc").default("doc")
|
|
1088
1088
|
});
|
|
1089
|
-
var CABTextSection = z5.
|
|
1089
|
+
var CABTextSection = z5.object({
|
|
1090
1090
|
buttonField: z5.enum(buttonFields).optional(),
|
|
1091
1091
|
content: z5.record(z5.string(), z5.union([z5.string(), TiptapDocument]).refine(checkForHTML, NO_HTML).optional()).default({ en: TiptapDocument.parse({}) }).optional(),
|
|
1092
1092
|
name: z5.string().optional(),
|
|
@@ -1112,21 +1112,21 @@ var CABTextSection = z5.strictObject({
|
|
|
1112
1112
|
});
|
|
1113
1113
|
|
|
1114
1114
|
// src/schema/product.ts
|
|
1115
|
-
var CABProductSection = z6.
|
|
1115
|
+
var CABProductSection = z6.object({
|
|
1116
1116
|
name: z6.string().optional(),
|
|
1117
1117
|
options: z6.array(
|
|
1118
|
-
z6.
|
|
1118
|
+
z6.object({
|
|
1119
1119
|
/** `name` represents `Color`, `Size`, etc. */
|
|
1120
1120
|
name: z6.string(),
|
|
1121
1121
|
optionId: z6.number(),
|
|
1122
1122
|
selector: z6.enum(variantSelectors).default(VariantSelector.menu),
|
|
1123
1123
|
values: z6.array(
|
|
1124
|
-
z6.
|
|
1124
|
+
z6.object({
|
|
1125
1125
|
color: z6.string().optional(),
|
|
1126
|
-
image: CABImageSection.optional(),
|
|
1126
|
+
image: z6.lazy(() => CABImageSection).optional(),
|
|
1127
1127
|
/** `name` represents `Red`, `Blue`, etc. */
|
|
1128
1128
|
name: z6.string(),
|
|
1129
|
-
text: CABTextSection.optional()
|
|
1129
|
+
text: z6.lazy(() => CABTextSection).optional()
|
|
1130
1130
|
})
|
|
1131
1131
|
)
|
|
1132
1132
|
})
|
|
@@ -1137,16 +1137,16 @@ var CABProductSection = z6.strictObject({
|
|
|
1137
1137
|
});
|
|
1138
1138
|
|
|
1139
1139
|
// src/schema/products.ts
|
|
1140
|
-
var CABProductsSection = z7.
|
|
1140
|
+
var CABProductsSection = z7.object({
|
|
1141
1141
|
name: z7.string().optional(),
|
|
1142
1142
|
sectionId: z7.uuidv7().default(() => uuidv75()),
|
|
1143
|
-
sections: z7.array(CABProductSection).default(() => []),
|
|
1143
|
+
sections: z7.array(z7.lazy(() => CABProductSection)).default(() => []),
|
|
1144
1144
|
sectionType: z7.literal(SectionType.products).default(SectionType.products)
|
|
1145
1145
|
});
|
|
1146
1146
|
|
|
1147
1147
|
// src/schema/offers.ts
|
|
1148
1148
|
var CABOffersSection = CABLayoutSection.omit({ sections: true, sectionType: true }).extend(
|
|
1149
|
-
z8.
|
|
1149
|
+
z8.object({
|
|
1150
1150
|
sections: z8.array(z8.lazy(() => CABSection)).default(() => [CABDataSourceSection.parse({}), CABProductsSection.parse({})]),
|
|
1151
1151
|
sectionType: z8.literal(SectionType.offers).default(SectionType.offers)
|
|
1152
1152
|
}).shape
|
|
@@ -1155,10 +1155,10 @@ var CABOffersSection = CABLayoutSection.omit({ sections: true, sectionType: true
|
|
|
1155
1155
|
// src/schema/quantity.ts
|
|
1156
1156
|
import { v7 as uuidv76 } from "uuid";
|
|
1157
1157
|
import { z as z9 } from "zod/v4";
|
|
1158
|
-
var CABQuantitySection = z9.
|
|
1158
|
+
var CABQuantitySection = z9.object({
|
|
1159
1159
|
errorMessages: z9.record(
|
|
1160
1160
|
z9.string(),
|
|
1161
|
-
z9.
|
|
1161
|
+
z9.object({
|
|
1162
1162
|
max: z9.string().optional(),
|
|
1163
1163
|
min: z9.string().optional(),
|
|
1164
1164
|
neg: z9.string().optional()
|
|
@@ -1181,7 +1181,7 @@ var CABQuantitySection = z9.strictObject({
|
|
|
1181
1181
|
// src/schema/reviews.ts
|
|
1182
1182
|
import { v7 as uuidv77 } from "uuid";
|
|
1183
1183
|
import { z as z10 } from "zod/v4";
|
|
1184
|
-
var CABReviewsSection = z10.
|
|
1184
|
+
var CABReviewsSection = z10.object({
|
|
1185
1185
|
name: z10.string().optional(),
|
|
1186
1186
|
sectionId: z10.uuidv7().default(() => uuidv77()),
|
|
1187
1187
|
sectionType: z10.literal(SectionType.reviews).default(SectionType.reviews)
|
|
@@ -1190,7 +1190,7 @@ var CABReviewsSection = z10.strictObject({
|
|
|
1190
1190
|
// src/schema/subscription.ts
|
|
1191
1191
|
import { v7 as uuidv78 } from "uuid";
|
|
1192
1192
|
import { z as z11 } from "zod/v4";
|
|
1193
|
-
var CABSubscriptionSection = z11.
|
|
1193
|
+
var CABSubscriptionSection = z11.object({
|
|
1194
1194
|
name: z11.string().optional(),
|
|
1195
1195
|
sectionId: z11.uuidv7().default(() => uuidv78()),
|
|
1196
1196
|
sectionType: z11.literal(SectionType.subscription).default(SectionType.subscription)
|
|
@@ -1199,7 +1199,7 @@ var CABSubscriptionSection = z11.strictObject({
|
|
|
1199
1199
|
// src/schema/table.ts
|
|
1200
1200
|
import { v7 as uuidv79 } from "uuid";
|
|
1201
1201
|
import { z as z12 } from "zod/v4";
|
|
1202
|
-
var CABTableSection = z12.
|
|
1202
|
+
var CABTableSection = z12.object({
|
|
1203
1203
|
name: z12.string().optional(),
|
|
1204
1204
|
sectionId: z12.uuidv7().default(() => uuidv79()),
|
|
1205
1205
|
sectionType: z12.literal(SectionType.table).default(SectionType.table)
|
|
@@ -1209,7 +1209,7 @@ var CABTableSection = z12.strictObject({
|
|
|
1209
1209
|
import { slice } from "lodash-es";
|
|
1210
1210
|
import { v7 as uuidv710 } from "uuid";
|
|
1211
1211
|
import { z as z13 } from "zod/v4";
|
|
1212
|
-
var CABVariantsSection = z13.
|
|
1212
|
+
var CABVariantsSection = z13.object({
|
|
1213
1213
|
name: z13.string().optional(),
|
|
1214
1214
|
sectionId: z13.uuidv7().default(() => uuidv710()),
|
|
1215
1215
|
sectionType: z13.literal(SectionType.variants).default(SectionType.variants),
|
|
@@ -1217,7 +1217,7 @@ var CABVariantsSection = z13.strictObject({
|
|
|
1217
1217
|
});
|
|
1218
1218
|
|
|
1219
1219
|
// src/schema/shared.ts
|
|
1220
|
-
var CABBorder = z14.
|
|
1220
|
+
var CABBorder = z14.object({
|
|
1221
1221
|
radius: z14.enum(borderRadii).default(BorderRadius.base),
|
|
1222
1222
|
style: z14.enum(borderStyles).default(BorderStyle.none),
|
|
1223
1223
|
width: z14.enum(borderWidths).default(BorderWidth.base)
|
|
@@ -1245,10 +1245,10 @@ var CABSection = z14.lazy(
|
|
|
1245
1245
|
);
|
|
1246
1246
|
|
|
1247
1247
|
// src/schema/image.ts
|
|
1248
|
-
var CABImageSection = z15.
|
|
1248
|
+
var CABImageSection = z15.object({
|
|
1249
1249
|
altText: z15.string().refine(checkForHTML, NO_HTML).default(""),
|
|
1250
1250
|
aspectRatio: z15.literal(1).nullable().default(null),
|
|
1251
|
-
border: CABBorder,
|
|
1251
|
+
border: z15.lazy(() => CABBorder),
|
|
1252
1252
|
buttonField: z15.enum(buttonFields).optional(),
|
|
1253
1253
|
category: z15.enum(["gallery", "icons", "payment-methods", "secure-checkout"]).nullable().default(null),
|
|
1254
1254
|
name: z15.string().optional(),
|
|
@@ -1262,11 +1262,11 @@ var CABImageSection = z15.strictObject({
|
|
|
1262
1262
|
});
|
|
1263
1263
|
|
|
1264
1264
|
// src/schema/button.ts
|
|
1265
|
-
var CABButtonContent = z16.discriminatedUnion("sectionType", [CABImageSection, CABTextSection]);
|
|
1266
|
-
var CABButtonSection = z16.
|
|
1265
|
+
var CABButtonContent = z16.lazy(() => z16.discriminatedUnion("sectionType", [CABImageSection, CABTextSection]));
|
|
1266
|
+
var CABButtonSection = z16.object({
|
|
1267
1267
|
action: z16.union([z16.literal(""), z16.enum(buttonActions)]).default(""),
|
|
1268
1268
|
buttonStyle: z16.enum(buttonStyles).default(ButtonStyle.primary),
|
|
1269
|
-
custom: z16.
|
|
1269
|
+
custom: z16.object({
|
|
1270
1270
|
color: z16.string().regex(HEX_COLOR_REGEX).default("#005bd3"),
|
|
1271
1271
|
height: z16.number().default(52),
|
|
1272
1272
|
width: z16.number().default(300)
|
|
@@ -1283,7 +1283,7 @@ var CABButtonSection = z16.strictObject({
|
|
|
1283
1283
|
|
|
1284
1284
|
// src/schema/root.ts
|
|
1285
1285
|
import { z as z17 } from "zod/v4";
|
|
1286
|
-
var TargetArea = z17.
|
|
1286
|
+
var TargetArea = z17.object({
|
|
1287
1287
|
fill: z17.boolean().optional(),
|
|
1288
1288
|
flip: z17.enum(["both", "horizontal", "vertical"]).optional(),
|
|
1289
1289
|
icon: z17.string(),
|
|
@@ -1291,7 +1291,7 @@ var TargetArea = z17.strictObject({
|
|
|
1291
1291
|
width: z17.string()
|
|
1292
1292
|
}).default(targetAreas[EditorMode.checkoutExtension][1]);
|
|
1293
1293
|
var CABRootSection = CABLayoutSection.extend(
|
|
1294
|
-
z17.
|
|
1294
|
+
z17.object({
|
|
1295
1295
|
editorMode: z17.enum(editorModes).default(EditorMode.checkoutExtension),
|
|
1296
1296
|
previewMode: z17.boolean().default(false),
|
|
1297
1297
|
storeId: z17.number().nullable().default(null),
|