@rebuy/rebuy 2.3.0 → 2.4.0-rc.2

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.
Files changed (73) hide show
  1. package/dist/index.d.ts +4 -1
  2. package/dist/index.d.ts.map +1 -1
  3. package/dist/index.js +142 -39
  4. package/dist/index.js.map +4 -4
  5. package/dist/index.mjs +143 -40
  6. package/dist/index.mjs.map +4 -4
  7. package/dist/schema/cab/button.d.ts.map +1 -0
  8. package/dist/schema/cab/common.d.ts.map +1 -0
  9. package/dist/schema/cab/constants.d.ts.map +1 -0
  10. package/dist/schema/cab/data-source.d.ts.map +1 -0
  11. package/dist/schema/cab/image.d.ts.map +1 -0
  12. package/dist/schema/cab/index.d.ts.map +1 -0
  13. package/dist/schema/cab/layout.d.ts.map +1 -0
  14. package/dist/schema/cab/offers.d.ts.map +1 -0
  15. package/dist/schema/cab/product.d.ts.map +1 -0
  16. package/dist/schema/cab/products.d.ts.map +1 -0
  17. package/dist/schema/cab/quantity.d.ts.map +1 -0
  18. package/dist/schema/{regex.d.ts → cab/regex.d.ts} +2 -0
  19. package/dist/schema/cab/regex.d.ts.map +1 -0
  20. package/dist/schema/cab/reviews.d.ts.map +1 -0
  21. package/dist/schema/cab/root.d.ts.map +1 -0
  22. package/dist/schema/cab/shared.d.ts.map +1 -0
  23. package/dist/schema/cab/subscription.d.ts.map +1 -0
  24. package/dist/schema/cab/table.d.ts.map +1 -0
  25. package/dist/schema/cab/text.d.ts.map +1 -0
  26. package/dist/schema/{utils.d.ts → cab/utils.d.ts} +1 -0
  27. package/dist/schema/cab/utils.d.ts.map +1 -0
  28. package/dist/schema/cab/variants.d.ts.map +1 -0
  29. package/dist/schema/shopConfig.d.ts +63 -0
  30. package/dist/schema/shopConfig.d.ts.map +1 -0
  31. package/dist/schema/userConfig.d.ts +66 -0
  32. package/dist/schema/userConfig.d.ts.map +1 -0
  33. package/dist/schema/widgetSettings.d.ts +152 -0
  34. package/dist/schema/widgetSettings.d.ts.map +1 -0
  35. package/package.json +1 -1
  36. package/dist/schema/button.d.ts.map +0 -1
  37. package/dist/schema/common.d.ts.map +0 -1
  38. package/dist/schema/constants.d.ts.map +0 -1
  39. package/dist/schema/data-source.d.ts.map +0 -1
  40. package/dist/schema/image.d.ts.map +0 -1
  41. package/dist/schema/index.d.ts.map +0 -1
  42. package/dist/schema/layout.d.ts.map +0 -1
  43. package/dist/schema/offers.d.ts.map +0 -1
  44. package/dist/schema/product.d.ts.map +0 -1
  45. package/dist/schema/products.d.ts.map +0 -1
  46. package/dist/schema/quantity.d.ts.map +0 -1
  47. package/dist/schema/regex.d.ts.map +0 -1
  48. package/dist/schema/reviews.d.ts.map +0 -1
  49. package/dist/schema/root.d.ts.map +0 -1
  50. package/dist/schema/shared.d.ts.map +0 -1
  51. package/dist/schema/subscription.d.ts.map +0 -1
  52. package/dist/schema/table.d.ts.map +0 -1
  53. package/dist/schema/text.d.ts.map +0 -1
  54. package/dist/schema/utils.d.ts.map +0 -1
  55. package/dist/schema/variants.d.ts.map +0 -1
  56. /package/dist/schema/{button.d.ts → cab/button.d.ts} +0 -0
  57. /package/dist/schema/{common.d.ts → cab/common.d.ts} +0 -0
  58. /package/dist/schema/{constants.d.ts → cab/constants.d.ts} +0 -0
  59. /package/dist/schema/{data-source.d.ts → cab/data-source.d.ts} +0 -0
  60. /package/dist/schema/{image.d.ts → cab/image.d.ts} +0 -0
  61. /package/dist/schema/{index.d.ts → cab/index.d.ts} +0 -0
  62. /package/dist/schema/{layout.d.ts → cab/layout.d.ts} +0 -0
  63. /package/dist/schema/{offers.d.ts → cab/offers.d.ts} +0 -0
  64. /package/dist/schema/{product.d.ts → cab/product.d.ts} +0 -0
  65. /package/dist/schema/{products.d.ts → cab/products.d.ts} +0 -0
  66. /package/dist/schema/{quantity.d.ts → cab/quantity.d.ts} +0 -0
  67. /package/dist/schema/{reviews.d.ts → cab/reviews.d.ts} +0 -0
  68. /package/dist/schema/{root.d.ts → cab/root.d.ts} +0 -0
  69. /package/dist/schema/{shared.d.ts → cab/shared.d.ts} +0 -0
  70. /package/dist/schema/{subscription.d.ts → cab/subscription.d.ts} +0 -0
  71. /package/dist/schema/{table.d.ts → cab/table.d.ts} +0 -0
  72. /package/dist/schema/{text.d.ts → cab/text.d.ts} +0 -0
  73. /package/dist/schema/{variants.d.ts → cab/variants.d.ts} +0 -0
package/dist/index.d.ts CHANGED
@@ -3,7 +3,10 @@ export * from './client';
3
3
  export * from './cookie';
4
4
  export * from './geolocation';
5
5
  export * from './identity';
6
- export * from './schema';
6
+ export * from './schema/cab';
7
+ export * from './schema/shopConfig';
8
+ export * from './schema/userConfig';
9
+ export * from './schema/widgetSettings';
7
10
  export * from './session';
8
11
  export * from './utilities';
9
12
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAC;AACtB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAC;AACtB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,yBAAyB,CAAC;AACxC,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC"}
package/dist/index.js CHANGED
@@ -20,6 +20,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
20
20
  // src/index.ts
21
21
  var index_exports = {};
22
22
  __export(index_exports, {
23
+ ARRAY_INDEX_STRING: () => ARRAY_INDEX_STRING,
23
24
  Api: () => Api,
24
25
  BorderRadius: () => BorderRadius,
25
26
  BorderStyle: () => BorderStyle,
@@ -55,6 +56,7 @@ __export(index_exports, {
55
56
  HorizontalAlignment: () => HorizontalAlignment,
56
57
  Identity: () => Identity,
57
58
  LanguageKey: () => LanguageKey,
59
+ LegacyV1Widget: () => LegacyV1Widget,
58
60
  NO_HTML: () => NO_HTML,
59
61
  ObjectFit: () => ObjectFit,
60
62
  QuantityInput: () => QuantityInput,
@@ -62,6 +64,7 @@ __export(index_exports, {
62
64
  STATIC_ENDPOINTS: () => STATIC_ENDPOINTS,
63
65
  SectionType: () => SectionType,
64
66
  Session: () => Session,
67
+ ShopConfig: () => ShopConfig,
65
68
  Spacing: () => Spacing,
66
69
  TextAlignment: () => TextAlignment,
67
70
  TextColorName: () => TextColorName,
@@ -69,8 +72,10 @@ __export(index_exports, {
69
72
  TiptapDocument: () => TiptapDocument,
70
73
  TiptapParagraph: () => TiptapParagraph,
71
74
  TiptapText: () => TiptapText,
75
+ UserConfig: () => UserConfig,
72
76
  VariantSelector: () => VariantSelector,
73
77
  VerticalAlignment: () => VerticalAlignment,
78
+ WidgetSettings: () => WidgetSettings,
74
79
  WidgetType: () => WidgetType,
75
80
  amountToCents: () => amountToCents,
76
81
  borderRadii: () => borderRadii,
@@ -80,6 +85,7 @@ __export(index_exports, {
80
85
  buttonFields: () => buttonFields,
81
86
  buttonStyles: () => buttonStyles,
82
87
  checkForHTML: () => checkForHTML,
88
+ convertNumericObjects: () => convertNumericObjects,
83
89
  convertProductToStorefrontFormat: () => convertProductToStorefrontFormat,
84
90
  convertToNodes: () => convertToNodes,
85
91
  convertVariantToStorefrontFormat: () => convertVariantToStorefrontFormat,
@@ -874,11 +880,11 @@ var RebuyClient = class {
874
880
  }
875
881
  };
876
882
 
877
- // src/schema/button.ts
883
+ // src/schema/cab/button.ts
878
884
  var import_uuid12 = require("uuid");
879
885
  var import_v416 = require("zod/v4");
880
886
 
881
- // src/schema/common.ts
887
+ // src/schema/cab/common.ts
882
888
  var import_v4 = require("zod/v4");
883
889
  var borderRadii = ["none", "small", "base", "large", "fullyRounded"];
884
890
  var borderRadius = import_v4.z.enum(borderRadii);
@@ -1014,23 +1020,24 @@ var verticalAlignments = ["top", "middle", "bottom"];
1014
1020
  var verticalAlignment = import_v4.z.enum(verticalAlignments);
1015
1021
  var VerticalAlignment = verticalAlignment.enum;
1016
1022
 
1017
- // src/schema/image.ts
1023
+ // src/schema/cab/image.ts
1018
1024
  var import_uuid11 = require("uuid");
1019
1025
  var import_v415 = require("zod/v4");
1020
1026
 
1021
- // src/schema/regex.ts
1027
+ // src/schema/cab/regex.ts
1028
+ var ARRAY_INDEX_STRING = /^(0|[1-9]\d*)$/;
1022
1029
  var DYNAMIC_TOKEN_REGEX = /^\{\{\s*[A-Za-z]+\s*\}\}$/;
1023
1030
  var HEX_COLOR_REGEX = /^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/;
1024
1031
  var HTML_TAGS_REGEX = /<[^>]*>/gi;
1025
1032
 
1026
- // src/schema/shared.ts
1033
+ // src/schema/cab/shared.ts
1027
1034
  var import_v414 = require("zod/v4");
1028
1035
 
1029
- // src/schema/data-source.ts
1036
+ // src/schema/cab/data-source.ts
1030
1037
  var import_uuid = require("uuid");
1031
1038
  var import_v43 = require("zod/v4");
1032
1039
 
1033
- // src/schema/constants.ts
1040
+ // src/schema/cab/constants.ts
1034
1041
  var import_lodash_es = require("lodash-es");
1035
1042
  var import_v42 = require("zod/v4");
1036
1043
  var DEFAULT_ENDPOINTS = [
@@ -1108,17 +1115,17 @@ var widgetTypes = [
1108
1115
  var widgetType = import_v42.z.enum(widgetTypes);
1109
1116
  var WidgetType = widgetType.enum;
1110
1117
 
1111
- // src/schema/data-source.ts
1118
+ // src/schema/cab/data-source.ts
1112
1119
  var CABDataSourceSection = import_v43.z.object({
1113
1120
  dataSourceId: import_v43.z.number().nullable().default(null),
1114
1121
  dataSourcePath: import_v43.z.string().default(DEFAULT_ENDPOINTS[0].value),
1115
1122
  limit: import_v43.z.number().default(1),
1116
1123
  name: import_v43.z.string().default(DEFAULT_ENDPOINTS[0].label),
1117
- sectionId: import_v43.z.uuidv7().default(() => (0, import_uuid.v7)()),
1124
+ sectionId: import_v43.z.uuid().default(() => (0, import_uuid.v7)()),
1118
1125
  sectionType: import_v43.z.literal(SectionType.dataSource).default(SectionType.dataSource)
1119
1126
  });
1120
1127
 
1121
- // src/schema/layout.ts
1128
+ // src/schema/cab/layout.ts
1122
1129
  var import_uuid2 = require("uuid");
1123
1130
  var import_v44 = require("zod/v4");
1124
1131
  var CABLayoutSection = import_v44.z.object({
@@ -1133,30 +1140,30 @@ var CABLayoutSection = import_v44.z.object({
1133
1140
  direction: import_v44.z.enum(directions).default(Direction.rows),
1134
1141
  name: import_v44.z.string().optional(),
1135
1142
  padding: import_v44.z.enum(spacings).default(Spacing.none),
1136
- sectionId: import_v44.z.uuidv7().default(() => (0, import_uuid2.v7)()),
1143
+ sectionId: import_v44.z.uuid().default(() => (0, import_uuid2.v7)()),
1137
1144
  sections: import_v44.z.array(import_v44.z.lazy(() => CABSection)).default(() => []),
1138
1145
  sectionType: import_v44.z.literal(SectionType.layout).default(SectionType.layout),
1139
1146
  spacing: import_v44.z.enum(spacings).default(Spacing.base),
1140
1147
  width: import_v44.z.number().default(100)
1141
1148
  });
1142
1149
 
1143
- // src/schema/offers.ts
1150
+ // src/schema/cab/offers.ts
1144
1151
  var import_v48 = require("zod/v4");
1145
1152
 
1146
- // src/schema/products.ts
1153
+ // src/schema/cab/products.ts
1147
1154
  var import_uuid5 = require("uuid");
1148
1155
  var import_v47 = require("zod/v4");
1149
1156
 
1150
- // src/schema/product.ts
1157
+ // src/schema/cab/product.ts
1151
1158
  var import_uuid4 = require("uuid");
1152
1159
  var import_v46 = require("zod/v4");
1153
1160
 
1154
- // src/schema/text.ts
1161
+ // src/schema/cab/text.ts
1155
1162
  var import_lodash_es3 = require("lodash-es");
1156
1163
  var import_uuid3 = require("uuid");
1157
1164
  var import_v45 = require("zod/v4");
1158
1165
 
1159
- // src/schema/utils.ts
1166
+ // src/schema/cab/utils.ts
1160
1167
  var import_lodash_es2 = require("lodash-es");
1161
1168
  var isHTML = (html = "") => {
1162
1169
  if (typeof window !== "undefined") {
@@ -1183,8 +1190,18 @@ var isSubscriptionType = (section) => (0, import_lodash_es2.get)(section, "secti
1183
1190
  var isTableType = (section) => (0, import_lodash_es2.get)(section, "sectionType") === SectionType.table;
1184
1191
  var isTextType = (section) => (0, import_lodash_es2.get)(section, "sectionType") === SectionType.text;
1185
1192
  var isVariantsType = (section) => (0, import_lodash_es2.get)(section, "sectionType") === SectionType.variants;
1193
+ var hasOnlyNumericKeys = (input) => !!(0, import_lodash_es2.size)(input) && (0, import_lodash_es2.every)(input, (_, key) => ARRAY_INDEX_STRING.test(key) && Number.isSafeInteger(Number(key)));
1194
+ var numericObjectToArray = (input) => (0, import_lodash_es2.entries)(input).sort(([a], [b]) => Number(a) - Number(b)).map(([_, value]) => value);
1195
+ var convertNumericObjects = (input) => {
1196
+ if ((0, import_lodash_es2.isArray)(input)) return (0, import_lodash_es2.map)(input, convertNumericObjects);
1197
+ if ((0, import_lodash_es2.isPlainObject)(input)) {
1198
+ const obj = input;
1199
+ return hasOnlyNumericKeys(obj) ? (0, import_lodash_es2.map)(numericObjectToArray(obj), convertNumericObjects) : (0, import_lodash_es2.mapValues)(obj, convertNumericObjects);
1200
+ }
1201
+ return input;
1202
+ };
1186
1203
 
1187
- // src/schema/text.ts
1204
+ // src/schema/cab/text.ts
1188
1205
  var enumOrOmit = (...vals) => import_v45.z.string().transform((val) => vals.includes(val) ? val : void 0).optional();
1189
1206
  var TiptapText = import_v45.z.object({
1190
1207
  marks: import_v45.z.array(
@@ -1231,7 +1248,7 @@ var CABTextSection = import_v45.z.object({
1231
1248
  buttonField: import_v45.z.enum(buttonFields).optional(),
1232
1249
  content: import_v45.z.record(import_v45.z.string(), import_v45.z.union([import_v45.z.string(), TiptapDocument]).refine(checkForHTML, NO_HTML).optional()).default({ en: TiptapDocument.parse({}) }).optional(),
1233
1250
  name: import_v45.z.string().optional(),
1234
- sectionId: import_v45.z.uuidv7().default(() => (0, import_uuid3.v7)()),
1251
+ sectionId: import_v45.z.uuid().default(() => (0, import_uuid3.v7)()),
1235
1252
  sectionType: import_v45.z.literal(SectionType.text).default(SectionType.text)
1236
1253
  }).superRefine(({ buttonField: buttonField2, content }, ctx) => {
1237
1254
  if (buttonField2 === ButtonField.destinationUrl && content) {
@@ -1252,7 +1269,7 @@ var CABTextSection = import_v45.z.object({
1252
1269
  }
1253
1270
  });
1254
1271
 
1255
- // src/schema/product.ts
1272
+ // src/schema/cab/product.ts
1256
1273
  var CABProductSection = import_v46.z.object({
1257
1274
  name: import_v46.z.string().optional(),
1258
1275
  options: import_v46.z.array(
@@ -1273,19 +1290,19 @@ var CABProductSection = import_v46.z.object({
1273
1290
  })
1274
1291
  ).default(() => []),
1275
1292
  productId: import_v46.z.number().nullable().default(null),
1276
- sectionId: import_v46.z.uuidv7().default(() => (0, import_uuid4.v7)()),
1293
+ sectionId: import_v46.z.uuid().default(() => (0, import_uuid4.v7)()),
1277
1294
  sectionType: import_v46.z.literal(SectionType.product).default(SectionType.product)
1278
1295
  });
1279
1296
 
1280
- // src/schema/products.ts
1297
+ // src/schema/cab/products.ts
1281
1298
  var CABProductsSection = import_v47.z.object({
1282
1299
  name: import_v47.z.string().optional(),
1283
- sectionId: import_v47.z.uuidv7().default(() => (0, import_uuid5.v7)()),
1300
+ sectionId: import_v47.z.uuid().default(() => (0, import_uuid5.v7)()),
1284
1301
  sections: import_v47.z.array(import_v47.z.lazy(() => CABProductSection)).default(() => []),
1285
1302
  sectionType: import_v47.z.literal(SectionType.products).default(SectionType.products)
1286
1303
  });
1287
1304
 
1288
- // src/schema/offers.ts
1305
+ // src/schema/cab/offers.ts
1289
1306
  var CABOffersSection = CABLayoutSection.omit({ sections: true, sectionType: true }).extend(
1290
1307
  import_v48.z.object({
1291
1308
  sections: import_v48.z.array(import_v48.z.lazy(() => CABSection)).default(() => [CABDataSourceSection.parse({}), CABProductsSection.parse({})]),
@@ -1293,7 +1310,7 @@ var CABOffersSection = CABLayoutSection.omit({ sections: true, sectionType: true
1293
1310
  }).shape
1294
1311
  );
1295
1312
 
1296
- // src/schema/quantity.ts
1313
+ // src/schema/cab/quantity.ts
1297
1314
  var import_uuid6 = require("uuid");
1298
1315
  var import_v49 = require("zod/v4");
1299
1316
  var CABQuantitySection = import_v49.z.object({
@@ -1315,49 +1332,49 @@ var CABQuantitySection = import_v49.z.object({
1315
1332
  max: import_v49.z.number().min(1).max(100).default(10),
1316
1333
  min: import_v49.z.number().min(1).default(1),
1317
1334
  name: import_v49.z.string().optional(),
1318
- sectionId: import_v49.z.uuidv7().default(() => (0, import_uuid6.v7)()),
1335
+ sectionId: import_v49.z.uuid().default(() => (0, import_uuid6.v7)()),
1319
1336
  sectionType: import_v49.z.literal(SectionType.quantity).default(SectionType.quantity)
1320
1337
  });
1321
1338
 
1322
- // src/schema/reviews.ts
1339
+ // src/schema/cab/reviews.ts
1323
1340
  var import_uuid7 = require("uuid");
1324
1341
  var import_v410 = require("zod/v4");
1325
1342
  var CABReviewsSection = import_v410.z.object({
1326
1343
  name: import_v410.z.string().optional(),
1327
- sectionId: import_v410.z.uuidv7().default(() => (0, import_uuid7.v7)()),
1344
+ sectionId: import_v410.z.uuid().default(() => (0, import_uuid7.v7)()),
1328
1345
  sectionType: import_v410.z.literal(SectionType.reviews).default(SectionType.reviews)
1329
1346
  });
1330
1347
 
1331
- // src/schema/subscription.ts
1348
+ // src/schema/cab/subscription.ts
1332
1349
  var import_uuid8 = require("uuid");
1333
1350
  var import_v411 = require("zod/v4");
1334
1351
  var CABSubscriptionSection = import_v411.z.object({
1335
1352
  name: import_v411.z.string().optional(),
1336
- sectionId: import_v411.z.uuidv7().default(() => (0, import_uuid8.v7)()),
1353
+ sectionId: import_v411.z.uuid().default(() => (0, import_uuid8.v7)()),
1337
1354
  sectionType: import_v411.z.literal(SectionType.subscription).default(SectionType.subscription)
1338
1355
  });
1339
1356
 
1340
- // src/schema/table.ts
1357
+ // src/schema/cab/table.ts
1341
1358
  var import_uuid9 = require("uuid");
1342
1359
  var import_v412 = require("zod/v4");
1343
1360
  var CABTableSection = import_v412.z.object({
1344
1361
  name: import_v412.z.string().optional(),
1345
- sectionId: import_v412.z.uuidv7().default(() => (0, import_uuid9.v7)()),
1362
+ sectionId: import_v412.z.uuid().default(() => (0, import_uuid9.v7)()),
1346
1363
  sectionType: import_v412.z.literal(SectionType.table).default(SectionType.table)
1347
1364
  });
1348
1365
 
1349
- // src/schema/variants.ts
1366
+ // src/schema/cab/variants.ts
1350
1367
  var import_lodash_es4 = require("lodash-es");
1351
1368
  var import_uuid10 = require("uuid");
1352
1369
  var import_v413 = require("zod/v4");
1353
1370
  var CABVariantsSection = import_v413.z.object({
1354
1371
  name: import_v413.z.string().optional(),
1355
- sectionId: import_v413.z.uuidv7().default(() => (0, import_uuid10.v7)()),
1372
+ sectionId: import_v413.z.uuid().default(() => (0, import_uuid10.v7)()),
1356
1373
  sectionType: import_v413.z.literal(SectionType.variants).default(SectionType.variants),
1357
1374
  selector: import_v413.z.enum((0, import_lodash_es4.slice)(variantSelectors, 0, 3)).default(VariantSelector.menu)
1358
1375
  });
1359
1376
 
1360
- // src/schema/shared.ts
1377
+ // src/schema/cab/shared.ts
1361
1378
  var CABBorder = import_v414.z.object({
1362
1379
  radius: import_v414.z.enum(borderRadii).default(BorderRadius.base),
1363
1380
  style: import_v414.z.enum(borderStyles).default(BorderStyle.none),
@@ -1385,7 +1402,7 @@ var CABSection = import_v414.z.lazy(
1385
1402
  ])
1386
1403
  );
1387
1404
 
1388
- // src/schema/image.ts
1405
+ // src/schema/cab/image.ts
1389
1406
  var CABImageSection = import_v415.z.object({
1390
1407
  altText: import_v415.z.string().refine(checkForHTML, NO_HTML).default(""),
1391
1408
  aspectRatio: import_v415.z.literal(1).nullable().default(null),
@@ -1396,13 +1413,13 @@ var CABImageSection = import_v415.z.object({
1396
1413
  naturalHeight: import_v415.z.number().default(0),
1397
1414
  naturalWidth: import_v415.z.number().default(0),
1398
1415
  objectFit: import_v415.z.enum(objectFits).default(ObjectFit.cover),
1399
- sectionId: import_v415.z.uuidv7().default(() => (0, import_uuid11.v7)()),
1416
+ sectionId: import_v415.z.uuid().default(() => (0, import_uuid11.v7)()),
1400
1417
  sectionType: import_v415.z.literal(SectionType.image).default(SectionType.image),
1401
1418
  source: import_v415.z.union([import_v415.z.url(), import_v415.z.literal(""), import_v415.z.string().regex(DYNAMIC_TOKEN_REGEX)]).default(""),
1402
1419
  width: import_v415.z.number().default(100)
1403
1420
  });
1404
1421
 
1405
- // src/schema/button.ts
1422
+ // src/schema/cab/button.ts
1406
1423
  var CABButtonContent = import_v416.z.lazy(() => import_v416.z.discriminatedUnion("sectionType", [CABImageSection, CABTextSection]));
1407
1424
  var CABButtonSection = import_v416.z.object({
1408
1425
  action: import_v416.z.union([import_v416.z.literal(""), import_v416.z.enum(buttonActions)]).default(""),
@@ -1417,12 +1434,12 @@ var CABButtonSection = import_v416.z.object({
1417
1434
  width: 300
1418
1435
  }),
1419
1436
  name: import_v416.z.string().optional(),
1420
- sectionId: import_v416.z.uuidv7().default(() => (0, import_uuid12.v7)()),
1437
+ sectionId: import_v416.z.uuid().default(() => (0, import_uuid12.v7)()),
1421
1438
  sections: import_v416.z.array(CABButtonContent).default(() => []),
1422
1439
  sectionType: import_v416.z.literal(SectionType.button).default(SectionType.button)
1423
1440
  });
1424
1441
 
1425
- // src/schema/root.ts
1442
+ // src/schema/cab/root.ts
1426
1443
  var import_v417 = require("zod/v4");
1427
1444
  var TargetArea = import_v417.z.object({
1428
1445
  fill: import_v417.z.boolean().optional(),
@@ -1442,4 +1459,90 @@ var CABRootSection = CABLayoutSection.extend(
1442
1459
  widgetId: import_v417.z.number().nullable().default(null)
1443
1460
  }).shape
1444
1461
  );
1462
+
1463
+ // src/schema/shopConfig.ts
1464
+ var import_v418 = require("zod/v4");
1465
+ var ShopConfig = import_v418.z.object({
1466
+ activeExperiments: import_v418.z.array(
1467
+ import_v418.z.object({
1468
+ data: import_v418.z.array(
1469
+ import_v418.z.object({
1470
+ aliasName: import_v418.z.string(),
1471
+ cssInput: import_v418.z.string().nullish(),
1472
+ elementId: import_v418.z.string(),
1473
+ id: import_v418.z.string(),
1474
+ javascriptInput: import_v418.z.string().nullish(),
1475
+ traffic: import_v418.z.string()
1476
+ })
1477
+ ),
1478
+ id: import_v418.z.string(),
1479
+ name: import_v418.z.string(),
1480
+ pageTarget: import_v418.z.string().nullable(),
1481
+ placeholderId: import_v418.z.string().nullable(),
1482
+ type: import_v418.z.string()
1483
+ })
1484
+ ).optional(),
1485
+ activePackages: import_v418.z.array(
1486
+ import_v418.z.object({
1487
+ cancelledAt: import_v418.z.string().nullable(),
1488
+ id: import_v418.z.number(),
1489
+ installedAt: import_v418.z.string().nullable(),
1490
+ isActive: import_v418.z.boolean(),
1491
+ isBillable: import_v418.z.boolean(),
1492
+ packageId: import_v418.z.number(),
1493
+ packageName: import_v418.z.string(),
1494
+ shortName: import_v418.z.string(),
1495
+ trialDays: import_v418.z.number(),
1496
+ uninstalledAt: import_v418.z.string().nullable()
1497
+ })
1498
+ ).optional(),
1499
+ apiKey: import_v418.z.string(),
1500
+ billingVersion: import_v418.z.string().optional(),
1501
+ cacheKey: import_v418.z.string().regex(/^[0-9]+$/),
1502
+ carousel: import_v418.z.string(),
1503
+ currency: import_v418.z.string(),
1504
+ currencySymbol: import_v418.z.string(),
1505
+ domain: import_v418.z.string(),
1506
+ enabledJquery: import_v418.z.boolean(),
1507
+ enabledPresentmentCurrencies: import_v418.z.array(import_v418.z.string()),
1508
+ hasSmartCollectionsEnabled: import_v418.z.boolean().optional(),
1509
+ hasSmartSearchEnabled: import_v418.z.boolean(),
1510
+ id: import_v418.z.string().regex(/^[0-9]+$/),
1511
+ integrations: import_v418.z.record(import_v418.z.string(), import_v418.z.boolean()),
1512
+ markets: import_v418.z.object({
1513
+ enabled: import_v418.z.boolean()
1514
+ }),
1515
+ moneyFormat: import_v418.z.string(),
1516
+ myshopifyDomain: import_v418.z.string(),
1517
+ primaryLocale: import_v418.z.string(),
1518
+ productGroupsEnabled: import_v418.z.enum(["no", "yes"]),
1519
+ rechargeCustomDomain: import_v418.z.string().nullable(),
1520
+ sellingPlansEnabled: import_v418.z.boolean(),
1521
+ shopId: import_v418.z.number(),
1522
+ shopifySellingPlansEnabled: import_v418.z.boolean(),
1523
+ shopName: import_v418.z.string(),
1524
+ storefrontAccessToken: import_v418.z.string().nullable(),
1525
+ useRebuyIcons: import_v418.z.boolean()
1526
+ });
1527
+
1528
+ // src/schema/userConfig.ts
1529
+ var import_v419 = require("zod/v4");
1530
+ var UserConfig = import_v419.z.object({
1531
+ shop: ShopConfig,
1532
+ smartCart: import_v419.z.unknown(),
1533
+ smartFlows: import_v419.z.array(import_v419.z.unknown())
1534
+ });
1535
+
1536
+ // src/schema/widgetSettings.ts
1537
+ var import_v420 = require("zod/v4");
1538
+ var LegacyV1Widget = import_v420.z.discriminatedUnion("type", [
1539
+ import_v420.z.object({ type: import_v420.z.literal(WidgetType.gift_with_purchase), version: import_v420.z.literal(1) }),
1540
+ import_v420.z.object({ type: import_v420.z.literal(WidgetType.shopify_checkout_extension), version: import_v420.z.literal(1) }),
1541
+ import_v420.z.object({ type: import_v420.z.literal(WidgetType.ui_extension_ad), version: import_v420.z.literal(1) }),
1542
+ import_v420.z.object({ type: import_v420.z.literal(WidgetType.ui_extension_button), version: import_v420.z.literal(1) }),
1543
+ import_v420.z.object({ type: import_v420.z.literal(WidgetType.ui_extension_content_block), version: import_v420.z.literal(1) }),
1544
+ import_v420.z.object({ type: import_v420.z.literal(WidgetType.ui_extension_line_item_editor), version: import_v420.z.literal(1) }),
1545
+ import_v420.z.object({ type: import_v420.z.literal(WidgetType.ui_extension_progress_bar), version: import_v420.z.literal(1) })
1546
+ ]);
1547
+ var WidgetSettings = import_v420.z.discriminatedUnion("version", [LegacyV1Widget, CABRootSection]);
1445
1548
  //# sourceMappingURL=index.js.map