@rebuy/rebuy 3.5.0 → 3.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +740 -647
- package/dist/index.mjs +740 -647
- package/dist/schema/checkout-and-beyond/constants.cjs +16 -0
- package/dist/schema/checkout-and-beyond/constants.mjs +16 -0
- package/dist/schema/checkout-and-beyond/index.cjs +454 -362
- package/dist/schema/checkout-and-beyond/index.mjs +454 -362
- package/dist/schema/widget-data.cjs +508 -435
- package/dist/schema/widget-data.mjs +508 -435
- package/dist/schema/widgetData.d.ts +438 -147
- package/dist/schema/widgets/checkout-and-beyond/banner.d.ts +145 -48
- package/dist/schema/widgets/checkout-and-beyond/button.d.ts +154 -49
- package/dist/schema/widgets/checkout-and-beyond/carousel.d.ts +145 -48
- package/dist/schema/widgets/checkout-and-beyond/cartLine.d.ts +145 -48
- package/dist/schema/widgets/checkout-and-beyond/common.d.ts +29 -0
- package/dist/schema/widgets/checkout-and-beyond/discount.d.ts +146 -0
- package/dist/schema/widgets/checkout-and-beyond/icons.d.ts +1 -1
- package/dist/schema/widgets/checkout-and-beyond/image.d.ts +294 -100
- package/dist/schema/widgets/checkout-and-beyond/index.d.ts +1 -0
- package/dist/schema/widgets/checkout-and-beyond/layout.d.ts +148 -52
- package/dist/schema/widgets/checkout-and-beyond/monetize.d.ts +146 -49
- package/dist/schema/widgets/checkout-and-beyond/offers.d.ts +145 -48
- package/dist/schema/widgets/checkout-and-beyond/product.d.ts +146 -0
- package/dist/schema/widgets/checkout-and-beyond/products.d.ts +292 -0
- package/dist/schema/widgets/checkout-and-beyond/progressBar.d.ts +145 -48
- package/dist/schema/widgets/checkout-and-beyond/quantity.d.ts +146 -49
- package/dist/schema/widgets/checkout-and-beyond/reviews.d.ts +146 -49
- package/dist/schema/widgets/checkout-and-beyond/root.d.ts +146 -49
- package/dist/schema/widgets/checkout-and-beyond/rule.d.ts +140 -68
- package/dist/schema/widgets/checkout-and-beyond/text.d.ts +146 -49
- package/dist/schema/widgets/checkout-and-beyond/variables.d.ts +470 -0
- package/dist/schema/widgets/checkout-and-beyond/variants.d.ts +146 -49
- package/dist/schema/widgets/contentBlock.d.ts +146 -49
- package/dist/schema/widgets/lineItemEditor.d.ts +146 -49
- package/dist/schema/widgets/rebuyButton.d.ts +146 -49
- package/dist/server/index.cjs +492 -416
- package/dist/server/index.mjs +492 -416
- package/dist/transforms/index.cjs +393 -317
- package/dist/transforms/index.mjs +393 -317
- package/dist/transforms/monetizeV1/convertMonetizeToV2.d.ts +2 -2
- package/package.json +1 -1
|
@@ -0,0 +1,470 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Binds a variable's value to a hidden rule data source. `ruleset` is the ADMIN-side condition config the
|
|
4
|
+
* editor syncs into that data source on widget save; the runtime only dereferences `dataSourceId` and
|
|
5
|
+
* reads the engine verdict (`metadata.custom.shouldShow` — the output key stays `should_show` because each
|
|
6
|
+
* variable owns its own hidden data source, so the key never collides and the engine contract is untouched).
|
|
7
|
+
* A seed with a `null` dataSourceId is inert (declared but not yet synced): `defaultValue` simply holds.
|
|
8
|
+
*/
|
|
9
|
+
export declare const CABVariableSeed: z.ZodObject<{
|
|
10
|
+
dataSourceId: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
|
|
11
|
+
ruleset: z.ZodDefault<z.ZodUnion<readonly [z.ZodArray<z.ZodObject<{
|
|
12
|
+
exitIfMatched: z.ZodDefault<z.ZodBoolean>;
|
|
13
|
+
logic: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
14
|
+
rules: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
15
|
+
operator: z.ZodDefault<z.ZodEnum<{
|
|
16
|
+
equals: "equals";
|
|
17
|
+
greater_than: "greater_than";
|
|
18
|
+
less_than: "less_than";
|
|
19
|
+
contains: "contains";
|
|
20
|
+
does_not_contain: "does_not_contain";
|
|
21
|
+
after: "after";
|
|
22
|
+
anything: "anything";
|
|
23
|
+
before: "before";
|
|
24
|
+
contains_any: "contains_any";
|
|
25
|
+
does_not_contain_any: "does_not_contain_any";
|
|
26
|
+
does_not_equal: "does_not_equal";
|
|
27
|
+
}>>;
|
|
28
|
+
products: z.ZodDefault<z.ZodUnion<readonly [z.ZodArray<z.ZodUnknown>, z.ZodPipe<z.ZodObject<{}, z.core.$strict>, z.ZodTransform<never[], Record<string, never>>>]>>;
|
|
29
|
+
type: z.ZodDefault<z.ZodEnum<{
|
|
30
|
+
product: "product";
|
|
31
|
+
date: "date";
|
|
32
|
+
cart: "cart";
|
|
33
|
+
cart_count: "cart_count";
|
|
34
|
+
cart_item_count: "cart_item_count";
|
|
35
|
+
cart_line_count: "cart_line_count";
|
|
36
|
+
cart_subtotal: "cart_subtotal";
|
|
37
|
+
collection: "collection";
|
|
38
|
+
customer: "customer";
|
|
39
|
+
customer_order_count: "customer_order_count";
|
|
40
|
+
customer_tag: "customer_tag";
|
|
41
|
+
customer_total_spent: "customer_total_spent";
|
|
42
|
+
product_tag: "product_tag";
|
|
43
|
+
product_title: "product_title";
|
|
44
|
+
product_type: "product_type";
|
|
45
|
+
product_vendor: "product_vendor";
|
|
46
|
+
}>>;
|
|
47
|
+
value: z.ZodDefault<z.ZodCoercedString<unknown>>;
|
|
48
|
+
}, z.core.$strip>>>;
|
|
49
|
+
}, z.core.$strip>>>;
|
|
50
|
+
output: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
51
|
+
key: z.ZodDefault<z.ZodString>;
|
|
52
|
+
type: z.ZodDefault<z.ZodLiteral<"data_json">>;
|
|
53
|
+
value: z.ZodDefault<z.ZodString>;
|
|
54
|
+
}, z.core.$strip>>>;
|
|
55
|
+
}, z.core.$strip>>, z.ZodPipe<z.ZodObject<{}, z.core.$strict>, z.ZodTransform<{
|
|
56
|
+
exitIfMatched: boolean;
|
|
57
|
+
logic: {
|
|
58
|
+
rules: {
|
|
59
|
+
operator: "equals" | "greater_than" | "less_than" | "contains" | "does_not_contain" | "after" | "anything" | "before" | "contains_any" | "does_not_contain_any" | "does_not_equal";
|
|
60
|
+
products: never[] | unknown[];
|
|
61
|
+
type: "product" | "date" | "cart" | "cart_count" | "cart_item_count" | "cart_line_count" | "cart_subtotal" | "collection" | "customer" | "customer_order_count" | "customer_tag" | "customer_total_spent" | "product_tag" | "product_title" | "product_type" | "product_vendor";
|
|
62
|
+
value: string;
|
|
63
|
+
}[];
|
|
64
|
+
}[];
|
|
65
|
+
output: {
|
|
66
|
+
key: string;
|
|
67
|
+
type: "data_json";
|
|
68
|
+
value: string;
|
|
69
|
+
}[];
|
|
70
|
+
}[], Record<string, never>>>]>>;
|
|
71
|
+
}, z.core.$strip>;
|
|
72
|
+
export type CABVariableSeed = z.infer<typeof CABVariableSeed>;
|
|
73
|
+
/**
|
|
74
|
+
* The cross-field default's `.transform()` makes this a ZodPipe, not a ZodObject — it has no
|
|
75
|
+
* `.shape`/`.extend()`/`.omit()` surface and cannot member a discriminated union. A consumer needing
|
|
76
|
+
* the object surface should get the pre-transform object exported as a named base here, not reach
|
|
77
|
+
* through the pipe.
|
|
78
|
+
*/
|
|
79
|
+
export declare const CABVariable: z.ZodPipe<z.ZodObject<{
|
|
80
|
+
defaultValue: z.ZodOptional<z.ZodBoolean>;
|
|
81
|
+
name: z.ZodString;
|
|
82
|
+
seed: z.ZodOptional<z.ZodObject<{
|
|
83
|
+
dataSourceId: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
|
|
84
|
+
ruleset: z.ZodDefault<z.ZodUnion<readonly [z.ZodArray<z.ZodObject<{
|
|
85
|
+
exitIfMatched: z.ZodDefault<z.ZodBoolean>;
|
|
86
|
+
logic: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
87
|
+
rules: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
88
|
+
operator: z.ZodDefault<z.ZodEnum<{
|
|
89
|
+
equals: "equals";
|
|
90
|
+
greater_than: "greater_than";
|
|
91
|
+
less_than: "less_than";
|
|
92
|
+
contains: "contains";
|
|
93
|
+
does_not_contain: "does_not_contain";
|
|
94
|
+
after: "after";
|
|
95
|
+
anything: "anything";
|
|
96
|
+
before: "before";
|
|
97
|
+
contains_any: "contains_any";
|
|
98
|
+
does_not_contain_any: "does_not_contain_any";
|
|
99
|
+
does_not_equal: "does_not_equal";
|
|
100
|
+
}>>;
|
|
101
|
+
products: z.ZodDefault<z.ZodUnion<readonly [z.ZodArray<z.ZodUnknown>, z.ZodPipe<z.ZodObject<{}, z.core.$strict>, z.ZodTransform<never[], Record<string, never>>>]>>;
|
|
102
|
+
type: z.ZodDefault<z.ZodEnum<{
|
|
103
|
+
product: "product";
|
|
104
|
+
date: "date";
|
|
105
|
+
cart: "cart";
|
|
106
|
+
cart_count: "cart_count";
|
|
107
|
+
cart_item_count: "cart_item_count";
|
|
108
|
+
cart_line_count: "cart_line_count";
|
|
109
|
+
cart_subtotal: "cart_subtotal";
|
|
110
|
+
collection: "collection";
|
|
111
|
+
customer: "customer";
|
|
112
|
+
customer_order_count: "customer_order_count";
|
|
113
|
+
customer_tag: "customer_tag";
|
|
114
|
+
customer_total_spent: "customer_total_spent";
|
|
115
|
+
product_tag: "product_tag";
|
|
116
|
+
product_title: "product_title";
|
|
117
|
+
product_type: "product_type";
|
|
118
|
+
product_vendor: "product_vendor";
|
|
119
|
+
}>>;
|
|
120
|
+
value: z.ZodDefault<z.ZodCoercedString<unknown>>;
|
|
121
|
+
}, z.core.$strip>>>;
|
|
122
|
+
}, z.core.$strip>>>;
|
|
123
|
+
output: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
124
|
+
key: z.ZodDefault<z.ZodString>;
|
|
125
|
+
type: z.ZodDefault<z.ZodLiteral<"data_json">>;
|
|
126
|
+
value: z.ZodDefault<z.ZodString>;
|
|
127
|
+
}, z.core.$strip>>>;
|
|
128
|
+
}, z.core.$strip>>, z.ZodPipe<z.ZodObject<{}, z.core.$strict>, z.ZodTransform<{
|
|
129
|
+
exitIfMatched: boolean;
|
|
130
|
+
logic: {
|
|
131
|
+
rules: {
|
|
132
|
+
operator: "equals" | "greater_than" | "less_than" | "contains" | "does_not_contain" | "after" | "anything" | "before" | "contains_any" | "does_not_contain_any" | "does_not_equal";
|
|
133
|
+
products: never[] | unknown[];
|
|
134
|
+
type: "product" | "date" | "cart" | "cart_count" | "cart_item_count" | "cart_line_count" | "cart_subtotal" | "collection" | "customer" | "customer_order_count" | "customer_tag" | "customer_total_spent" | "product_tag" | "product_title" | "product_type" | "product_vendor";
|
|
135
|
+
value: string;
|
|
136
|
+
}[];
|
|
137
|
+
}[];
|
|
138
|
+
output: {
|
|
139
|
+
key: string;
|
|
140
|
+
type: "data_json";
|
|
141
|
+
value: string;
|
|
142
|
+
}[];
|
|
143
|
+
}[], Record<string, never>>>]>>;
|
|
144
|
+
}, z.core.$strip>>;
|
|
145
|
+
}, z.core.$strip>, z.ZodTransform<{
|
|
146
|
+
name: string;
|
|
147
|
+
seed?: {
|
|
148
|
+
dataSourceId: number | null;
|
|
149
|
+
ruleset: {
|
|
150
|
+
exitIfMatched: boolean;
|
|
151
|
+
logic: {
|
|
152
|
+
rules: {
|
|
153
|
+
operator: "equals" | "greater_than" | "less_than" | "contains" | "does_not_contain" | "after" | "anything" | "before" | "contains_any" | "does_not_contain_any" | "does_not_equal";
|
|
154
|
+
products: never[] | unknown[];
|
|
155
|
+
type: "product" | "date" | "cart" | "cart_count" | "cart_item_count" | "cart_line_count" | "cart_subtotal" | "collection" | "customer" | "customer_order_count" | "customer_tag" | "customer_total_spent" | "product_tag" | "product_title" | "product_type" | "product_vendor";
|
|
156
|
+
value: string;
|
|
157
|
+
}[];
|
|
158
|
+
}[];
|
|
159
|
+
output: {
|
|
160
|
+
key: string;
|
|
161
|
+
type: "data_json";
|
|
162
|
+
value: string;
|
|
163
|
+
}[];
|
|
164
|
+
}[];
|
|
165
|
+
} | undefined;
|
|
166
|
+
defaultValue: boolean;
|
|
167
|
+
}, {
|
|
168
|
+
name: string;
|
|
169
|
+
defaultValue?: boolean | undefined;
|
|
170
|
+
seed?: {
|
|
171
|
+
dataSourceId: number | null;
|
|
172
|
+
ruleset: {
|
|
173
|
+
exitIfMatched: boolean;
|
|
174
|
+
logic: {
|
|
175
|
+
rules: {
|
|
176
|
+
operator: "equals" | "greater_than" | "less_than" | "contains" | "does_not_contain" | "after" | "anything" | "before" | "contains_any" | "does_not_contain_any" | "does_not_equal";
|
|
177
|
+
products: never[] | unknown[];
|
|
178
|
+
type: "product" | "date" | "cart" | "cart_count" | "cart_item_count" | "cart_line_count" | "cart_subtotal" | "collection" | "customer" | "customer_order_count" | "customer_tag" | "customer_total_spent" | "product_tag" | "product_title" | "product_type" | "product_vendor";
|
|
179
|
+
value: string;
|
|
180
|
+
}[];
|
|
181
|
+
}[];
|
|
182
|
+
output: {
|
|
183
|
+
key: string;
|
|
184
|
+
type: "data_json";
|
|
185
|
+
value: string;
|
|
186
|
+
}[];
|
|
187
|
+
}[];
|
|
188
|
+
} | undefined;
|
|
189
|
+
}>>;
|
|
190
|
+
export type CABVariable = z.infer<typeof CABVariable>;
|
|
191
|
+
/**
|
|
192
|
+
* A button's SECONDARY effect: any button, whatever its primary `action` (`addToOrder` included), may also
|
|
193
|
+
* write an in-scope variable when clicked.
|
|
194
|
+
*/
|
|
195
|
+
export declare const CABVariableEffect: z.ZodObject<{
|
|
196
|
+
effect: z.ZodDefault<z.ZodEnum<{
|
|
197
|
+
set_false: "set_false";
|
|
198
|
+
set_true: "set_true";
|
|
199
|
+
toggle: "toggle";
|
|
200
|
+
}>>;
|
|
201
|
+
variable: z.ZodString;
|
|
202
|
+
}, z.core.$strip>;
|
|
203
|
+
export type CABVariableEffect = z.infer<typeof CABVariableEffect>;
|
|
204
|
+
/**
|
|
205
|
+
* A section's visibility binding: show when the in-scope variable equals `visibleWhen`. Deliberately a
|
|
206
|
+
* single test — no AND lists or expression language in v1. A binding to an out-of-scope (undeclared)
|
|
207
|
+
* variable resolves to HIDDEN: a binding's presence declares intent to gate, so a broken reference (a
|
|
208
|
+
* typo'd name, a declaration on a non-ancestor) fails the same direction as a pending seed verdict —
|
|
209
|
+
* never show what a fixed binding would then take back. Only an ABSENT binding means unconditionally
|
|
210
|
+
* visible. Runtimes should warn in dev when a binding dereferences an undeclared name.
|
|
211
|
+
*/
|
|
212
|
+
export declare const CABVisibility: z.ZodObject<{
|
|
213
|
+
variable: z.ZodString;
|
|
214
|
+
visibleWhen: z.ZodDefault<z.ZodBoolean>;
|
|
215
|
+
}, z.core.$strip>;
|
|
216
|
+
export type CABVisibility = z.infer<typeof CABVisibility>;
|
|
217
|
+
/** Fires against the hosting section's OWN data-source result count (e.g. `equals 0` → hide the root). */
|
|
218
|
+
export declare const CABResultCountTrigger: z.ZodObject<{
|
|
219
|
+
operator: z.ZodDefault<z.ZodEnum<{
|
|
220
|
+
equals: "equals";
|
|
221
|
+
greater_than: "greater_than";
|
|
222
|
+
less_than: "less_than";
|
|
223
|
+
}>>;
|
|
224
|
+
type: z.ZodLiteral<"result_count">;
|
|
225
|
+
value: z.ZodDefault<z.ZodNumber>;
|
|
226
|
+
}, z.core.$strip>;
|
|
227
|
+
export type CABResultCountTrigger = z.infer<typeof CABResultCountTrigger>;
|
|
228
|
+
/** Fires when any/no returned product carries the tag — content conditions, phase after count conditions. */
|
|
229
|
+
export declare const CABResultTagTrigger: z.ZodObject<{
|
|
230
|
+
operator: z.ZodDefault<z.ZodEnum<{
|
|
231
|
+
contains: "contains";
|
|
232
|
+
does_not_contain: "does_not_contain";
|
|
233
|
+
}>>;
|
|
234
|
+
type: z.ZodLiteral<"result_tag">;
|
|
235
|
+
value: z.ZodString;
|
|
236
|
+
}, z.core.$strip>;
|
|
237
|
+
export type CABResultTagTrigger = z.infer<typeof CABResultTagTrigger>;
|
|
238
|
+
/** Fires on a runtime cart/order event observed by the hosting section — the events phase of mutators. */
|
|
239
|
+
export declare const CABEventTrigger: z.ZodObject<{
|
|
240
|
+
event: z.ZodEnum<{
|
|
241
|
+
item_added: "item_added";
|
|
242
|
+
quantity_changed: "quantity_changed";
|
|
243
|
+
variant_selected: "variant_selected";
|
|
244
|
+
}>;
|
|
245
|
+
type: z.ZodLiteral<"event">;
|
|
246
|
+
}, z.core.$strip>;
|
|
247
|
+
export type CABEventTrigger = z.infer<typeof CABEventTrigger>;
|
|
248
|
+
export declare const CABVariableTrigger: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
249
|
+
event: z.ZodEnum<{
|
|
250
|
+
item_added: "item_added";
|
|
251
|
+
quantity_changed: "quantity_changed";
|
|
252
|
+
variant_selected: "variant_selected";
|
|
253
|
+
}>;
|
|
254
|
+
type: z.ZodLiteral<"event">;
|
|
255
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
256
|
+
operator: z.ZodDefault<z.ZodEnum<{
|
|
257
|
+
equals: "equals";
|
|
258
|
+
greater_than: "greater_than";
|
|
259
|
+
less_than: "less_than";
|
|
260
|
+
}>>;
|
|
261
|
+
type: z.ZodLiteral<"result_count">;
|
|
262
|
+
value: z.ZodDefault<z.ZodNumber>;
|
|
263
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
264
|
+
operator: z.ZodDefault<z.ZodEnum<{
|
|
265
|
+
contains: "contains";
|
|
266
|
+
does_not_contain: "does_not_contain";
|
|
267
|
+
}>>;
|
|
268
|
+
type: z.ZodLiteral<"result_tag">;
|
|
269
|
+
value: z.ZodString;
|
|
270
|
+
}, z.core.$strip>], "type">;
|
|
271
|
+
export type CABVariableTrigger = z.infer<typeof CABVariableTrigger>;
|
|
272
|
+
/**
|
|
273
|
+
* A declarative setter hosted by a section: when `when` fires, apply `effect` to the in-scope `variable`.
|
|
274
|
+
* Result triggers are edge-applied — the effect runs when the condition TRANSITIONS to true on a fresh
|
|
275
|
+
* result set, not continuously — so `toggle` is well-defined for them too.
|
|
276
|
+
*/
|
|
277
|
+
export declare const CABVariableMutator: z.ZodObject<{
|
|
278
|
+
effect: z.ZodDefault<z.ZodEnum<{
|
|
279
|
+
set_false: "set_false";
|
|
280
|
+
set_true: "set_true";
|
|
281
|
+
toggle: "toggle";
|
|
282
|
+
}>>;
|
|
283
|
+
variable: z.ZodString;
|
|
284
|
+
when: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
285
|
+
event: z.ZodEnum<{
|
|
286
|
+
item_added: "item_added";
|
|
287
|
+
quantity_changed: "quantity_changed";
|
|
288
|
+
variant_selected: "variant_selected";
|
|
289
|
+
}>;
|
|
290
|
+
type: z.ZodLiteral<"event">;
|
|
291
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
292
|
+
operator: z.ZodDefault<z.ZodEnum<{
|
|
293
|
+
equals: "equals";
|
|
294
|
+
greater_than: "greater_than";
|
|
295
|
+
less_than: "less_than";
|
|
296
|
+
}>>;
|
|
297
|
+
type: z.ZodLiteral<"result_count">;
|
|
298
|
+
value: z.ZodDefault<z.ZodNumber>;
|
|
299
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
300
|
+
operator: z.ZodDefault<z.ZodEnum<{
|
|
301
|
+
contains: "contains";
|
|
302
|
+
does_not_contain: "does_not_contain";
|
|
303
|
+
}>>;
|
|
304
|
+
type: z.ZodLiteral<"result_tag">;
|
|
305
|
+
value: z.ZodString;
|
|
306
|
+
}, z.core.$strip>], "type">;
|
|
307
|
+
}, z.core.$strip>;
|
|
308
|
+
export type CABVariableMutator = z.infer<typeof CABVariableMutator>;
|
|
309
|
+
/**
|
|
310
|
+
* The per-section attachment, spread into every RENDERED section schema (`CABDataSourceSection` is config,
|
|
311
|
+
* not rendered, so it opts out). All three are optional rather than defaulted-empty on purpose: absent
|
|
312
|
+
* fields keep serialized trees lean, and absent means "no variables behavior" with zero runtime work.
|
|
313
|
+
* Layout-derived sections (banner, carousel, cartLine, offers, progressBar, root) inherit via
|
|
314
|
+
* `CABLayoutSection`. Names must be unique within one section's `variables` (the schema rejects
|
|
315
|
+
* duplicates); collisions ACROSS sections are legal and resolve nearest-ancestor-wins (see module doc).
|
|
316
|
+
*/
|
|
317
|
+
export declare const CABVariableFields: {
|
|
318
|
+
mutators: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
319
|
+
effect: z.ZodDefault<z.ZodEnum<{
|
|
320
|
+
set_false: "set_false";
|
|
321
|
+
set_true: "set_true";
|
|
322
|
+
toggle: "toggle";
|
|
323
|
+
}>>;
|
|
324
|
+
variable: z.ZodString;
|
|
325
|
+
when: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
326
|
+
event: z.ZodEnum<{
|
|
327
|
+
item_added: "item_added";
|
|
328
|
+
quantity_changed: "quantity_changed";
|
|
329
|
+
variant_selected: "variant_selected";
|
|
330
|
+
}>;
|
|
331
|
+
type: z.ZodLiteral<"event">;
|
|
332
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
333
|
+
operator: z.ZodDefault<z.ZodEnum<{
|
|
334
|
+
equals: "equals";
|
|
335
|
+
greater_than: "greater_than";
|
|
336
|
+
less_than: "less_than";
|
|
337
|
+
}>>;
|
|
338
|
+
type: z.ZodLiteral<"result_count">;
|
|
339
|
+
value: z.ZodDefault<z.ZodNumber>;
|
|
340
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
341
|
+
operator: z.ZodDefault<z.ZodEnum<{
|
|
342
|
+
contains: "contains";
|
|
343
|
+
does_not_contain: "does_not_contain";
|
|
344
|
+
}>>;
|
|
345
|
+
type: z.ZodLiteral<"result_tag">;
|
|
346
|
+
value: z.ZodString;
|
|
347
|
+
}, z.core.$strip>], "type">;
|
|
348
|
+
}, z.core.$strip>>>;
|
|
349
|
+
variables: z.ZodOptional<z.ZodArray<z.ZodPipe<z.ZodObject<{
|
|
350
|
+
defaultValue: z.ZodOptional<z.ZodBoolean>;
|
|
351
|
+
name: z.ZodString;
|
|
352
|
+
seed: z.ZodOptional<z.ZodObject<{
|
|
353
|
+
dataSourceId: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
|
|
354
|
+
ruleset: z.ZodDefault<z.ZodUnion<readonly [z.ZodArray<z.ZodObject<{
|
|
355
|
+
exitIfMatched: z.ZodDefault<z.ZodBoolean>;
|
|
356
|
+
logic: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
357
|
+
rules: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
358
|
+
operator: z.ZodDefault<z.ZodEnum<{
|
|
359
|
+
equals: "equals";
|
|
360
|
+
greater_than: "greater_than";
|
|
361
|
+
less_than: "less_than";
|
|
362
|
+
contains: "contains";
|
|
363
|
+
does_not_contain: "does_not_contain";
|
|
364
|
+
after: "after";
|
|
365
|
+
anything: "anything";
|
|
366
|
+
before: "before";
|
|
367
|
+
contains_any: "contains_any";
|
|
368
|
+
does_not_contain_any: "does_not_contain_any";
|
|
369
|
+
does_not_equal: "does_not_equal";
|
|
370
|
+
}>>;
|
|
371
|
+
products: z.ZodDefault<z.ZodUnion<readonly [z.ZodArray<z.ZodUnknown>, z.ZodPipe<z.ZodObject<{}, z.core.$strict>, z.ZodTransform<never[], Record<string, never>>>]>>;
|
|
372
|
+
type: z.ZodDefault<z.ZodEnum<{
|
|
373
|
+
product: "product";
|
|
374
|
+
date: "date";
|
|
375
|
+
cart: "cart";
|
|
376
|
+
cart_count: "cart_count";
|
|
377
|
+
cart_item_count: "cart_item_count";
|
|
378
|
+
cart_line_count: "cart_line_count";
|
|
379
|
+
cart_subtotal: "cart_subtotal";
|
|
380
|
+
collection: "collection";
|
|
381
|
+
customer: "customer";
|
|
382
|
+
customer_order_count: "customer_order_count";
|
|
383
|
+
customer_tag: "customer_tag";
|
|
384
|
+
customer_total_spent: "customer_total_spent";
|
|
385
|
+
product_tag: "product_tag";
|
|
386
|
+
product_title: "product_title";
|
|
387
|
+
product_type: "product_type";
|
|
388
|
+
product_vendor: "product_vendor";
|
|
389
|
+
}>>;
|
|
390
|
+
value: z.ZodDefault<z.ZodCoercedString<unknown>>;
|
|
391
|
+
}, z.core.$strip>>>;
|
|
392
|
+
}, z.core.$strip>>>;
|
|
393
|
+
output: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
394
|
+
key: z.ZodDefault<z.ZodString>;
|
|
395
|
+
type: z.ZodDefault<z.ZodLiteral<"data_json">>;
|
|
396
|
+
value: z.ZodDefault<z.ZodString>;
|
|
397
|
+
}, z.core.$strip>>>;
|
|
398
|
+
}, z.core.$strip>>, z.ZodPipe<z.ZodObject<{}, z.core.$strict>, z.ZodTransform<{
|
|
399
|
+
exitIfMatched: boolean;
|
|
400
|
+
logic: {
|
|
401
|
+
rules: {
|
|
402
|
+
operator: "equals" | "greater_than" | "less_than" | "contains" | "does_not_contain" | "after" | "anything" | "before" | "contains_any" | "does_not_contain_any" | "does_not_equal";
|
|
403
|
+
products: never[] | unknown[];
|
|
404
|
+
type: "product" | "date" | "cart" | "cart_count" | "cart_item_count" | "cart_line_count" | "cart_subtotal" | "collection" | "customer" | "customer_order_count" | "customer_tag" | "customer_total_spent" | "product_tag" | "product_title" | "product_type" | "product_vendor";
|
|
405
|
+
value: string;
|
|
406
|
+
}[];
|
|
407
|
+
}[];
|
|
408
|
+
output: {
|
|
409
|
+
key: string;
|
|
410
|
+
type: "data_json";
|
|
411
|
+
value: string;
|
|
412
|
+
}[];
|
|
413
|
+
}[], Record<string, never>>>]>>;
|
|
414
|
+
}, z.core.$strip>>;
|
|
415
|
+
}, z.core.$strip>, z.ZodTransform<{
|
|
416
|
+
name: string;
|
|
417
|
+
seed?: {
|
|
418
|
+
dataSourceId: number | null;
|
|
419
|
+
ruleset: {
|
|
420
|
+
exitIfMatched: boolean;
|
|
421
|
+
logic: {
|
|
422
|
+
rules: {
|
|
423
|
+
operator: "equals" | "greater_than" | "less_than" | "contains" | "does_not_contain" | "after" | "anything" | "before" | "contains_any" | "does_not_contain_any" | "does_not_equal";
|
|
424
|
+
products: never[] | unknown[];
|
|
425
|
+
type: "product" | "date" | "cart" | "cart_count" | "cart_item_count" | "cart_line_count" | "cart_subtotal" | "collection" | "customer" | "customer_order_count" | "customer_tag" | "customer_total_spent" | "product_tag" | "product_title" | "product_type" | "product_vendor";
|
|
426
|
+
value: string;
|
|
427
|
+
}[];
|
|
428
|
+
}[];
|
|
429
|
+
output: {
|
|
430
|
+
key: string;
|
|
431
|
+
type: "data_json";
|
|
432
|
+
value: string;
|
|
433
|
+
}[];
|
|
434
|
+
}[];
|
|
435
|
+
} | undefined;
|
|
436
|
+
defaultValue: boolean;
|
|
437
|
+
}, {
|
|
438
|
+
name: string;
|
|
439
|
+
defaultValue?: boolean | undefined;
|
|
440
|
+
seed?: {
|
|
441
|
+
dataSourceId: number | null;
|
|
442
|
+
ruleset: {
|
|
443
|
+
exitIfMatched: boolean;
|
|
444
|
+
logic: {
|
|
445
|
+
rules: {
|
|
446
|
+
operator: "equals" | "greater_than" | "less_than" | "contains" | "does_not_contain" | "after" | "anything" | "before" | "contains_any" | "does_not_contain_any" | "does_not_equal";
|
|
447
|
+
products: never[] | unknown[];
|
|
448
|
+
type: "product" | "date" | "cart" | "cart_count" | "cart_item_count" | "cart_line_count" | "cart_subtotal" | "collection" | "customer" | "customer_order_count" | "customer_tag" | "customer_total_spent" | "product_tag" | "product_title" | "product_type" | "product_vendor";
|
|
449
|
+
value: string;
|
|
450
|
+
}[];
|
|
451
|
+
}[];
|
|
452
|
+
output: {
|
|
453
|
+
key: string;
|
|
454
|
+
type: "data_json";
|
|
455
|
+
value: string;
|
|
456
|
+
}[];
|
|
457
|
+
}[];
|
|
458
|
+
} | undefined;
|
|
459
|
+
}>>>>;
|
|
460
|
+
visibility: z.ZodOptional<z.ZodObject<{
|
|
461
|
+
variable: z.ZodString;
|
|
462
|
+
visibleWhen: z.ZodDefault<z.ZodBoolean>;
|
|
463
|
+
}, z.core.$strip>>;
|
|
464
|
+
};
|
|
465
|
+
/** Twin of `CABVariableFields` for the hand-written recursive-node types (see recursiveTwins.test.ts). */
|
|
466
|
+
export type CABVariableFields = {
|
|
467
|
+
mutators?: CABVariableMutator[];
|
|
468
|
+
variables?: CABVariable[];
|
|
469
|
+
visibility?: CABVisibility;
|
|
470
|
+
};
|