@rebuy/rebuy 2.2.0 → 2.4.0-rc.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/api.d.ts.map +1 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +131 -27
- package/dist/index.js.map +4 -4
- package/dist/index.mjs +132 -28
- package/dist/index.mjs.map +4 -4
- package/dist/schema/cab/button.d.ts.map +1 -0
- package/dist/schema/cab/common.d.ts.map +1 -0
- package/dist/schema/cab/constants.d.ts.map +1 -0
- package/dist/schema/cab/data-source.d.ts.map +1 -0
- package/dist/schema/cab/image.d.ts.map +1 -0
- package/dist/schema/cab/index.d.ts.map +1 -0
- package/dist/schema/cab/layout.d.ts.map +1 -0
- package/dist/schema/cab/offers.d.ts.map +1 -0
- package/dist/schema/cab/product.d.ts.map +1 -0
- package/dist/schema/cab/products.d.ts.map +1 -0
- package/dist/schema/cab/quantity.d.ts.map +1 -0
- package/dist/schema/{regex.d.ts → cab/regex.d.ts} +2 -0
- package/dist/schema/cab/regex.d.ts.map +1 -0
- package/dist/schema/cab/reviews.d.ts.map +1 -0
- package/dist/schema/cab/root.d.ts.map +1 -0
- package/dist/schema/cab/shared.d.ts.map +1 -0
- package/dist/schema/cab/subscription.d.ts.map +1 -0
- package/dist/schema/cab/table.d.ts.map +1 -0
- package/dist/schema/cab/text.d.ts.map +1 -0
- package/dist/schema/{utils.d.ts → cab/utils.d.ts} +1 -0
- package/dist/schema/cab/utils.d.ts.map +1 -0
- package/dist/schema/cab/variants.d.ts.map +1 -0
- package/dist/schema/shopConfig.d.ts +63 -0
- package/dist/schema/shopConfig.d.ts.map +1 -0
- package/dist/schema/userConfig.d.ts +66 -0
- package/dist/schema/userConfig.d.ts.map +1 -0
- package/dist/schema/widgetSettings.d.ts +152 -0
- package/dist/schema/widgetSettings.d.ts.map +1 -0
- package/package.json +1 -1
- package/dist/schema/button.d.ts.map +0 -1
- package/dist/schema/common.d.ts.map +0 -1
- package/dist/schema/constants.d.ts.map +0 -1
- package/dist/schema/data-source.d.ts.map +0 -1
- package/dist/schema/image.d.ts.map +0 -1
- package/dist/schema/index.d.ts.map +0 -1
- package/dist/schema/layout.d.ts.map +0 -1
- package/dist/schema/offers.d.ts.map +0 -1
- package/dist/schema/product.d.ts.map +0 -1
- package/dist/schema/products.d.ts.map +0 -1
- package/dist/schema/quantity.d.ts.map +0 -1
- package/dist/schema/regex.d.ts.map +0 -1
- package/dist/schema/reviews.d.ts.map +0 -1
- package/dist/schema/root.d.ts.map +0 -1
- package/dist/schema/shared.d.ts.map +0 -1
- package/dist/schema/subscription.d.ts.map +0 -1
- package/dist/schema/table.d.ts.map +0 -1
- package/dist/schema/text.d.ts.map +0 -1
- package/dist/schema/utils.d.ts.map +0 -1
- package/dist/schema/variants.d.ts.map +0 -1
- /package/dist/schema/{button.d.ts → cab/button.d.ts} +0 -0
- /package/dist/schema/{common.d.ts → cab/common.d.ts} +0 -0
- /package/dist/schema/{constants.d.ts → cab/constants.d.ts} +0 -0
- /package/dist/schema/{data-source.d.ts → cab/data-source.d.ts} +0 -0
- /package/dist/schema/{image.d.ts → cab/image.d.ts} +0 -0
- /package/dist/schema/{index.d.ts → cab/index.d.ts} +0 -0
- /package/dist/schema/{layout.d.ts → cab/layout.d.ts} +0 -0
- /package/dist/schema/{offers.d.ts → cab/offers.d.ts} +0 -0
- /package/dist/schema/{product.d.ts → cab/product.d.ts} +0 -0
- /package/dist/schema/{products.d.ts → cab/products.d.ts} +0 -0
- /package/dist/schema/{quantity.d.ts → cab/quantity.d.ts} +0 -0
- /package/dist/schema/{reviews.d.ts → cab/reviews.d.ts} +0 -0
- /package/dist/schema/{root.d.ts → cab/root.d.ts} +0 -0
- /package/dist/schema/{shared.d.ts → cab/shared.d.ts} +0 -0
- /package/dist/schema/{subscription.d.ts → cab/subscription.d.ts} +0 -0
- /package/dist/schema/{table.d.ts → cab/table.d.ts} +0 -0
- /package/dist/schema/{text.d.ts → cab/text.d.ts} +0 -0
- /package/dist/schema/{variants.d.ts → cab/variants.d.ts} +0 -0
package/dist/api.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"AAMA,KAAK,MAAM,GAAG;IACV;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;CACxB,CAAC;AAIF,KAAK,YAAY,GAAG;IAChB,KAAK,CAAC,EAAE,WAAW,GAAG;QAAE,YAAY,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC;CACpD,CAAC;AAEF,KAAK,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"AAMA,KAAK,MAAM,GAAG;IACV;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;CACxB,CAAC;AAIF,KAAK,YAAY,GAAG;IAChB,KAAK,CAAC,EAAE,WAAW,GAAG;QAAE,YAAY,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC;CACpD,CAAC;AAEF,KAAK,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,CAAC;AA2E9C,qBAAa,GAAG;IACZ,OAAO,CAAC,MAAM,CAAS;gBAEX,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,GAAG,IAAI;IAkC9C,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,OAAO,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,GAAG,CAAC;IAIhG,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,OAAO,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,GAAG,CAAC;IAIjG,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,OAAO,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,GAAG,CAAC;IAIjG,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,OAAO,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,GAAG,CAAC;IAI9F,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,OAAO,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,GAAG,CAAC;IAI9F,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,OAAO,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,GAAG,CAAC;CAGvG;AAGD,eAAe,GAAG,CAAC"}
|
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
|
package/dist/index.d.ts.map
CHANGED
|
@@ -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,
|
|
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,
|
|
@@ -431,6 +437,7 @@ var staging = {
|
|
|
431
437
|
staticDomain: "https://cdn.enigneyuber.com"
|
|
432
438
|
};
|
|
433
439
|
var stagingDomains = [
|
|
440
|
+
"cab-staging.myshopify.com",
|
|
434
441
|
"enigneyuber.com",
|
|
435
442
|
"rebuy-engine-regression.myshopify.com",
|
|
436
443
|
"rebuy-stage-currency-test.myshopify.com",
|
|
@@ -873,11 +880,11 @@ var RebuyClient = class {
|
|
|
873
880
|
}
|
|
874
881
|
};
|
|
875
882
|
|
|
876
|
-
// src/schema/button.ts
|
|
883
|
+
// src/schema/cab/button.ts
|
|
877
884
|
var import_uuid12 = require("uuid");
|
|
878
885
|
var import_v416 = require("zod/v4");
|
|
879
886
|
|
|
880
|
-
// src/schema/common.ts
|
|
887
|
+
// src/schema/cab/common.ts
|
|
881
888
|
var import_v4 = require("zod/v4");
|
|
882
889
|
var borderRadii = ["none", "small", "base", "large", "fullyRounded"];
|
|
883
890
|
var borderRadius = import_v4.z.enum(borderRadii);
|
|
@@ -1013,23 +1020,24 @@ var verticalAlignments = ["top", "middle", "bottom"];
|
|
|
1013
1020
|
var verticalAlignment = import_v4.z.enum(verticalAlignments);
|
|
1014
1021
|
var VerticalAlignment = verticalAlignment.enum;
|
|
1015
1022
|
|
|
1016
|
-
// src/schema/image.ts
|
|
1023
|
+
// src/schema/cab/image.ts
|
|
1017
1024
|
var import_uuid11 = require("uuid");
|
|
1018
1025
|
var import_v415 = require("zod/v4");
|
|
1019
1026
|
|
|
1020
|
-
// src/schema/regex.ts
|
|
1027
|
+
// src/schema/cab/regex.ts
|
|
1028
|
+
var ARRAY_INDEX_STRING = /^(0|[1-9]\d*)$/;
|
|
1021
1029
|
var DYNAMIC_TOKEN_REGEX = /^\{\{\s*[A-Za-z]+\s*\}\}$/;
|
|
1022
1030
|
var HEX_COLOR_REGEX = /^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/;
|
|
1023
1031
|
var HTML_TAGS_REGEX = /<[^>]*>/gi;
|
|
1024
1032
|
|
|
1025
|
-
// src/schema/shared.ts
|
|
1033
|
+
// src/schema/cab/shared.ts
|
|
1026
1034
|
var import_v414 = require("zod/v4");
|
|
1027
1035
|
|
|
1028
|
-
// src/schema/data-source.ts
|
|
1036
|
+
// src/schema/cab/data-source.ts
|
|
1029
1037
|
var import_uuid = require("uuid");
|
|
1030
1038
|
var import_v43 = require("zod/v4");
|
|
1031
1039
|
|
|
1032
|
-
// src/schema/constants.ts
|
|
1040
|
+
// src/schema/cab/constants.ts
|
|
1033
1041
|
var import_lodash_es = require("lodash-es");
|
|
1034
1042
|
var import_v42 = require("zod/v4");
|
|
1035
1043
|
var DEFAULT_ENDPOINTS = [
|
|
@@ -1107,7 +1115,7 @@ var widgetTypes = [
|
|
|
1107
1115
|
var widgetType = import_v42.z.enum(widgetTypes);
|
|
1108
1116
|
var WidgetType = widgetType.enum;
|
|
1109
1117
|
|
|
1110
|
-
// src/schema/data-source.ts
|
|
1118
|
+
// src/schema/cab/data-source.ts
|
|
1111
1119
|
var CABDataSourceSection = import_v43.z.object({
|
|
1112
1120
|
dataSourceId: import_v43.z.number().nullable().default(null),
|
|
1113
1121
|
dataSourcePath: import_v43.z.string().default(DEFAULT_ENDPOINTS[0].value),
|
|
@@ -1117,7 +1125,7 @@ var CABDataSourceSection = import_v43.z.object({
|
|
|
1117
1125
|
sectionType: import_v43.z.literal(SectionType.dataSource).default(SectionType.dataSource)
|
|
1118
1126
|
});
|
|
1119
1127
|
|
|
1120
|
-
// src/schema/layout.ts
|
|
1128
|
+
// src/schema/cab/layout.ts
|
|
1121
1129
|
var import_uuid2 = require("uuid");
|
|
1122
1130
|
var import_v44 = require("zod/v4");
|
|
1123
1131
|
var CABLayoutSection = import_v44.z.object({
|
|
@@ -1139,23 +1147,23 @@ var CABLayoutSection = import_v44.z.object({
|
|
|
1139
1147
|
width: import_v44.z.number().default(100)
|
|
1140
1148
|
});
|
|
1141
1149
|
|
|
1142
|
-
// src/schema/offers.ts
|
|
1150
|
+
// src/schema/cab/offers.ts
|
|
1143
1151
|
var import_v48 = require("zod/v4");
|
|
1144
1152
|
|
|
1145
|
-
// src/schema/products.ts
|
|
1153
|
+
// src/schema/cab/products.ts
|
|
1146
1154
|
var import_uuid5 = require("uuid");
|
|
1147
1155
|
var import_v47 = require("zod/v4");
|
|
1148
1156
|
|
|
1149
|
-
// src/schema/product.ts
|
|
1157
|
+
// src/schema/cab/product.ts
|
|
1150
1158
|
var import_uuid4 = require("uuid");
|
|
1151
1159
|
var import_v46 = require("zod/v4");
|
|
1152
1160
|
|
|
1153
|
-
// src/schema/text.ts
|
|
1161
|
+
// src/schema/cab/text.ts
|
|
1154
1162
|
var import_lodash_es3 = require("lodash-es");
|
|
1155
1163
|
var import_uuid3 = require("uuid");
|
|
1156
1164
|
var import_v45 = require("zod/v4");
|
|
1157
1165
|
|
|
1158
|
-
// src/schema/utils.ts
|
|
1166
|
+
// src/schema/cab/utils.ts
|
|
1159
1167
|
var import_lodash_es2 = require("lodash-es");
|
|
1160
1168
|
var isHTML = (html = "") => {
|
|
1161
1169
|
if (typeof window !== "undefined") {
|
|
@@ -1182,8 +1190,18 @@ var isSubscriptionType = (section) => (0, import_lodash_es2.get)(section, "secti
|
|
|
1182
1190
|
var isTableType = (section) => (0, import_lodash_es2.get)(section, "sectionType") === SectionType.table;
|
|
1183
1191
|
var isTextType = (section) => (0, import_lodash_es2.get)(section, "sectionType") === SectionType.text;
|
|
1184
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
|
+
};
|
|
1185
1203
|
|
|
1186
|
-
// src/schema/text.ts
|
|
1204
|
+
// src/schema/cab/text.ts
|
|
1187
1205
|
var enumOrOmit = (...vals) => import_v45.z.string().transform((val) => vals.includes(val) ? val : void 0).optional();
|
|
1188
1206
|
var TiptapText = import_v45.z.object({
|
|
1189
1207
|
marks: import_v45.z.array(
|
|
@@ -1251,7 +1269,7 @@ var CABTextSection = import_v45.z.object({
|
|
|
1251
1269
|
}
|
|
1252
1270
|
});
|
|
1253
1271
|
|
|
1254
|
-
// src/schema/product.ts
|
|
1272
|
+
// src/schema/cab/product.ts
|
|
1255
1273
|
var CABProductSection = import_v46.z.object({
|
|
1256
1274
|
name: import_v46.z.string().optional(),
|
|
1257
1275
|
options: import_v46.z.array(
|
|
@@ -1276,7 +1294,7 @@ var CABProductSection = import_v46.z.object({
|
|
|
1276
1294
|
sectionType: import_v46.z.literal(SectionType.product).default(SectionType.product)
|
|
1277
1295
|
});
|
|
1278
1296
|
|
|
1279
|
-
// src/schema/products.ts
|
|
1297
|
+
// src/schema/cab/products.ts
|
|
1280
1298
|
var CABProductsSection = import_v47.z.object({
|
|
1281
1299
|
name: import_v47.z.string().optional(),
|
|
1282
1300
|
sectionId: import_v47.z.uuidv7().default(() => (0, import_uuid5.v7)()),
|
|
@@ -1284,7 +1302,7 @@ var CABProductsSection = import_v47.z.object({
|
|
|
1284
1302
|
sectionType: import_v47.z.literal(SectionType.products).default(SectionType.products)
|
|
1285
1303
|
});
|
|
1286
1304
|
|
|
1287
|
-
// src/schema/offers.ts
|
|
1305
|
+
// src/schema/cab/offers.ts
|
|
1288
1306
|
var CABOffersSection = CABLayoutSection.omit({ sections: true, sectionType: true }).extend(
|
|
1289
1307
|
import_v48.z.object({
|
|
1290
1308
|
sections: import_v48.z.array(import_v48.z.lazy(() => CABSection)).default(() => [CABDataSourceSection.parse({}), CABProductsSection.parse({})]),
|
|
@@ -1292,7 +1310,7 @@ var CABOffersSection = CABLayoutSection.omit({ sections: true, sectionType: true
|
|
|
1292
1310
|
}).shape
|
|
1293
1311
|
);
|
|
1294
1312
|
|
|
1295
|
-
// src/schema/quantity.ts
|
|
1313
|
+
// src/schema/cab/quantity.ts
|
|
1296
1314
|
var import_uuid6 = require("uuid");
|
|
1297
1315
|
var import_v49 = require("zod/v4");
|
|
1298
1316
|
var CABQuantitySection = import_v49.z.object({
|
|
@@ -1318,7 +1336,7 @@ var CABQuantitySection = import_v49.z.object({
|
|
|
1318
1336
|
sectionType: import_v49.z.literal(SectionType.quantity).default(SectionType.quantity)
|
|
1319
1337
|
});
|
|
1320
1338
|
|
|
1321
|
-
// src/schema/reviews.ts
|
|
1339
|
+
// src/schema/cab/reviews.ts
|
|
1322
1340
|
var import_uuid7 = require("uuid");
|
|
1323
1341
|
var import_v410 = require("zod/v4");
|
|
1324
1342
|
var CABReviewsSection = import_v410.z.object({
|
|
@@ -1327,7 +1345,7 @@ var CABReviewsSection = import_v410.z.object({
|
|
|
1327
1345
|
sectionType: import_v410.z.literal(SectionType.reviews).default(SectionType.reviews)
|
|
1328
1346
|
});
|
|
1329
1347
|
|
|
1330
|
-
// src/schema/subscription.ts
|
|
1348
|
+
// src/schema/cab/subscription.ts
|
|
1331
1349
|
var import_uuid8 = require("uuid");
|
|
1332
1350
|
var import_v411 = require("zod/v4");
|
|
1333
1351
|
var CABSubscriptionSection = import_v411.z.object({
|
|
@@ -1336,7 +1354,7 @@ var CABSubscriptionSection = import_v411.z.object({
|
|
|
1336
1354
|
sectionType: import_v411.z.literal(SectionType.subscription).default(SectionType.subscription)
|
|
1337
1355
|
});
|
|
1338
1356
|
|
|
1339
|
-
// src/schema/table.ts
|
|
1357
|
+
// src/schema/cab/table.ts
|
|
1340
1358
|
var import_uuid9 = require("uuid");
|
|
1341
1359
|
var import_v412 = require("zod/v4");
|
|
1342
1360
|
var CABTableSection = import_v412.z.object({
|
|
@@ -1345,7 +1363,7 @@ var CABTableSection = import_v412.z.object({
|
|
|
1345
1363
|
sectionType: import_v412.z.literal(SectionType.table).default(SectionType.table)
|
|
1346
1364
|
});
|
|
1347
1365
|
|
|
1348
|
-
// src/schema/variants.ts
|
|
1366
|
+
// src/schema/cab/variants.ts
|
|
1349
1367
|
var import_lodash_es4 = require("lodash-es");
|
|
1350
1368
|
var import_uuid10 = require("uuid");
|
|
1351
1369
|
var import_v413 = require("zod/v4");
|
|
@@ -1356,7 +1374,7 @@ var CABVariantsSection = import_v413.z.object({
|
|
|
1356
1374
|
selector: import_v413.z.enum((0, import_lodash_es4.slice)(variantSelectors, 0, 3)).default(VariantSelector.menu)
|
|
1357
1375
|
});
|
|
1358
1376
|
|
|
1359
|
-
// src/schema/shared.ts
|
|
1377
|
+
// src/schema/cab/shared.ts
|
|
1360
1378
|
var CABBorder = import_v414.z.object({
|
|
1361
1379
|
radius: import_v414.z.enum(borderRadii).default(BorderRadius.base),
|
|
1362
1380
|
style: import_v414.z.enum(borderStyles).default(BorderStyle.none),
|
|
@@ -1384,7 +1402,7 @@ var CABSection = import_v414.z.lazy(
|
|
|
1384
1402
|
])
|
|
1385
1403
|
);
|
|
1386
1404
|
|
|
1387
|
-
// src/schema/image.ts
|
|
1405
|
+
// src/schema/cab/image.ts
|
|
1388
1406
|
var CABImageSection = import_v415.z.object({
|
|
1389
1407
|
altText: import_v415.z.string().refine(checkForHTML, NO_HTML).default(""),
|
|
1390
1408
|
aspectRatio: import_v415.z.literal(1).nullable().default(null),
|
|
@@ -1401,7 +1419,7 @@ var CABImageSection = import_v415.z.object({
|
|
|
1401
1419
|
width: import_v415.z.number().default(100)
|
|
1402
1420
|
});
|
|
1403
1421
|
|
|
1404
|
-
// src/schema/button.ts
|
|
1422
|
+
// src/schema/cab/button.ts
|
|
1405
1423
|
var CABButtonContent = import_v416.z.lazy(() => import_v416.z.discriminatedUnion("sectionType", [CABImageSection, CABTextSection]));
|
|
1406
1424
|
var CABButtonSection = import_v416.z.object({
|
|
1407
1425
|
action: import_v416.z.union([import_v416.z.literal(""), import_v416.z.enum(buttonActions)]).default(""),
|
|
@@ -1421,7 +1439,7 @@ var CABButtonSection = import_v416.z.object({
|
|
|
1421
1439
|
sectionType: import_v416.z.literal(SectionType.button).default(SectionType.button)
|
|
1422
1440
|
});
|
|
1423
1441
|
|
|
1424
|
-
// src/schema/root.ts
|
|
1442
|
+
// src/schema/cab/root.ts
|
|
1425
1443
|
var import_v417 = require("zod/v4");
|
|
1426
1444
|
var TargetArea = import_v417.z.object({
|
|
1427
1445
|
fill: import_v417.z.boolean().optional(),
|
|
@@ -1441,4 +1459,90 @@ var CABRootSection = CABLayoutSection.extend(
|
|
|
1441
1459
|
widgetId: import_v417.z.number().nullable().default(null)
|
|
1442
1460
|
}).shape
|
|
1443
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]);
|
|
1444
1548
|
//# sourceMappingURL=index.js.map
|