@rebuy/rebuy 2.27.0 → 2.28.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.
Files changed (58) hide show
  1. package/dist/index.d.ts +1 -0
  2. package/dist/index.d.ts.map +1 -1
  3. package/dist/index.js +1352 -366
  4. package/dist/index.js.map +4 -4
  5. package/dist/index.mjs +1351 -365
  6. package/dist/index.mjs.map +4 -4
  7. package/dist/schema/checkout-and-beyond/constants.js +1 -0
  8. package/dist/schema/checkout-and-beyond/constants.js.map +2 -2
  9. package/dist/schema/checkout-and-beyond/constants.mjs +1 -0
  10. package/dist/schema/checkout-and-beyond/constants.mjs.map +2 -2
  11. package/dist/schema/checkout-and-beyond/index.js +285 -92
  12. package/dist/schema/checkout-and-beyond/index.js.map +4 -4
  13. package/dist/schema/checkout-and-beyond/index.mjs +285 -92
  14. package/dist/schema/checkout-and-beyond/index.mjs.map +4 -4
  15. package/dist/schema/widget-data.js +165 -148
  16. package/dist/schema/widget-data.js.map +4 -4
  17. package/dist/schema/widget-data.mjs +165 -148
  18. package/dist/schema/widget-data.mjs.map +4 -4
  19. package/dist/schema/widgets/checkout-and-beyond/common.d.ts +2 -1
  20. package/dist/schema/widgets/checkout-and-beyond/common.d.ts.map +1 -1
  21. package/dist/schema/widgets/checkout-and-beyond/discount.d.ts +30 -0
  22. package/dist/schema/widgets/checkout-and-beyond/discount.d.ts.map +1 -0
  23. package/dist/schema/widgets/checkout-and-beyond/index.d.ts +2 -0
  24. package/dist/schema/widgets/checkout-and-beyond/index.d.ts.map +1 -1
  25. package/dist/schema/widgets/checkout-and-beyond/offerLabels.d.ts +178 -0
  26. package/dist/schema/widgets/checkout-and-beyond/offerLabels.d.ts.map +1 -0
  27. package/dist/schema/widgets/checkout-and-beyond/shared.d.ts +2 -1
  28. package/dist/schema/widgets/checkout-and-beyond/shared.d.ts.map +1 -1
  29. package/dist/schema/widgets/checkout-and-beyond/utils.d.ts +2 -0
  30. package/dist/schema/widgets/checkout-and-beyond/utils.d.ts.map +1 -1
  31. package/dist/server/dataSourceResults.d.ts +18 -0
  32. package/dist/server/dataSourceResults.d.ts.map +1 -0
  33. package/dist/server/index.d.ts +6 -2
  34. package/dist/server/index.d.ts.map +1 -1
  35. package/dist/server/index.js +1162 -435
  36. package/dist/server/index.js.map +4 -4
  37. package/dist/server/index.mjs +1161 -434
  38. package/dist/server/index.mjs.map +4 -4
  39. package/dist/server/userConfig.d.ts +8 -0
  40. package/dist/server/userConfig.d.ts.map +1 -0
  41. package/dist/server/widgetSettings.d.ts.map +1 -1
  42. package/dist/transforms/index.d.ts +4 -0
  43. package/dist/transforms/index.d.ts.map +1 -1
  44. package/dist/transforms/index.js +1004 -81
  45. package/dist/transforms/index.js.map +4 -4
  46. package/dist/transforms/index.mjs +1004 -81
  47. package/dist/transforms/index.mjs.map +4 -4
  48. package/dist/transforms/offerV1/buildOfferTemplate.d.ts +13 -0
  49. package/dist/transforms/offerV1/buildOfferTemplate.d.ts.map +1 -0
  50. package/dist/transforms/offerV1/convertOfferToV2.d.ts +18 -0
  51. package/dist/transforms/offerV1/convertOfferToV2.d.ts.map +1 -0
  52. package/dist/transforms/offerV1/offerCard.d.ts +17 -0
  53. package/dist/transforms/offerV1/offerCard.d.ts.map +1 -0
  54. package/dist/transforms/offerV1/offerTemplateSeed.d.ts +339 -0
  55. package/dist/transforms/offerV1/offerTemplateSeed.d.ts.map +1 -0
  56. package/dist/transforms/offerV1/types.d.ts +145 -0
  57. package/dist/transforms/offerV1/types.d.ts.map +1 -0
  58. package/package.json +1 -1
@@ -0,0 +1,13 @@
1
+ import { CABRootSection } from '../../schema/widgets/checkout-and-beyond/root';
2
+ export type BuildOfferTemplateInput = {
3
+ location?: 'checkout' | 'order-status' | 'thank-you';
4
+ name?: string;
5
+ };
6
+ /**
7
+ * Build a brand-new "Checkout Offers" widget as a `CABRootSection` from the designed base layout.
8
+ * Pure and synchronous (admin-side, network-free): overlays the per-widget `name` + editor mode and
9
+ * the offer widget type, then parses. The seed carries NO section ids (enforced by a test), so `parse`
10
+ * mints fresh `uuidv7`s on every call — two created widgets never share section ids.
11
+ */
12
+ export declare const buildOfferTemplate: ({ location, name }?: BuildOfferTemplateInput) => CABRootSection;
13
+ //# sourceMappingURL=buildOfferTemplate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"buildOfferTemplate.d.ts","sourceRoot":"","sources":["../../../src/transforms/offerV1/buildOfferTemplate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,2CAA2C,CAAC;AAU3E,MAAM,MAAM,uBAAuB,GAAG;IAClC,QAAQ,CAAC,EAAE,UAAU,GAAG,cAAc,GAAG,WAAW,CAAC;IACrD,IAAI,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,GAAI,qBAAoB,uBAA4B,KAAG,cAOhF,CAAC"}
@@ -0,0 +1,18 @@
1
+ import { CABRootSection } from '../../schema/widgets/checkout-and-beyond/root';
2
+ import { type V1OfferConvertInput } from '../../transforms/offerV1/types';
3
+ /**
4
+ * Translates a v1 Offer (Checkout Offers / product recommendations) widget into
5
+ * a `CABRootSection`: an optional header (title/superTitle/description, reusing
6
+ * the content-block text converter) over a `carousel` wrapper that ALWAYS contains
7
+ * the `offers` section (the carousel is the required structural parent; it only
8
+ * paginates when the v1 layout has carousel on). The offers section's `dataSource`
9
+ * child carries the engine fetch config; its remaining children are the
10
+ * per-offer card (see `buildOfferCard`).
11
+ *
12
+ * v1 `layout` is per-breakpoint; CAB has none, so the converter collapses to
13
+ * the largest provided breakpoint. A widget-level discount becomes a config-only
14
+ * `discount` section and an opt-in undo `banner` is appended after the data
15
+ * source (discount above, banner pinned last) when each is configured.
16
+ */
17
+ export declare const convertOfferToV2: ({ id, name, settings }: V1OfferConvertInput) => CABRootSection;
18
+ //# sourceMappingURL=convertOfferToV2.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"convertOfferToV2.d.ts","sourceRoot":"","sources":["../../../src/transforms/offerV1/convertOfferToV2.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,2CAA2C,CAAC;AAG3E,OAAO,EAGH,KAAK,mBAAmB,EAE3B,MAAM,4BAA4B,CAAC;AAyGpC;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,gBAAgB,GAAI,wBAAwB,mBAAmB,KAAG,cAwE9E,CAAC"}
@@ -0,0 +1,17 @@
1
+ import { type V1OfferSettings } from '../../transforms/offerV1/types';
2
+ /**
3
+ * The per-offer product card: the sections rendered once per recommended product (the
4
+ * offers renderer mounts a product context, so the `{{...}}` tokens resolve per product).
5
+ *
6
+ * `horizontal` mirrors the v1 layout orientation (see `convertOfferToV2`):
7
+ * - horizontal (v1 `list`/default, vertical-stacked products): a 3-column grid card —
8
+ * image | title/price/reviews/variants | actions — matching the compact V1 row.
9
+ * - vertical (v1 `grid`/`line`, side-by-side products): a flat top-to-bottom stack
10
+ * (image → title → price → … → button), the narrow column card.
11
+ *
12
+ * Quantity is a full-width row beneath the card in the horizontal layout; in the vertical
13
+ * layout it sits inline in the stack. NOT carried: the savings-amount badge (no live v1
14
+ * control) and variant text styling (no CAB field).
15
+ */
16
+ export declare const buildOfferCard: (settings: V1OfferSettings, horizontal: boolean) => Record<string, unknown>[];
17
+ //# sourceMappingURL=offerCard.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"offerCard.d.ts","sourceRoot":"","sources":["../../../src/transforms/offerV1/offerCard.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,eAAe,EAAoB,MAAM,4BAA4B,CAAC;AA0OpF;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,cAAc,GAAI,UAAU,eAAe,EAAE,YAAY,OAAO,KAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAuCtG,CAAC"}
@@ -0,0 +1,339 @@
1
+ /**
2
+ * The canonical base "Checkout Offers" CAB layout — designed in the editor by Jeff (REB-23182) and
3
+ * exported. It was authored inside the content-block editor (the only surface that can lay out an
4
+ * offers section), so the export originally carried that widget type + the test store's data source;
5
+ * those have been cleaned here to read as a real offer template. `buildOfferTemplate` still strips any
6
+ * residual section ids (so each created widget gets fresh ones) and injects the per-widget name +
7
+ * editor mode at runtime. Regenerate by re-exporting + the generator script, not by hand.
8
+ */
9
+ export declare const OFFER_TEMPLATE_SEED: {
10
+ alignment: {
11
+ horizontal: string;
12
+ vertical: string;
13
+ };
14
+ border: {
15
+ radius: string;
16
+ style: string;
17
+ width: string;
18
+ };
19
+ direction: string;
20
+ editorMode: string;
21
+ grid: {
22
+ columns: string[];
23
+ rows: string[];
24
+ };
25
+ padding: string;
26
+ previewMode: boolean;
27
+ sections: {
28
+ alignment: {
29
+ horizontal: string;
30
+ vertical: string;
31
+ };
32
+ autoAdvanceInterval: number;
33
+ border: {
34
+ radius: string;
35
+ style: string;
36
+ width: string;
37
+ };
38
+ direction: string;
39
+ grid: {
40
+ columns: string[];
41
+ rows: string[];
42
+ };
43
+ itemsAtOnce: number;
44
+ padding: string;
45
+ sections: ({
46
+ alignment: {
47
+ horizontal: string;
48
+ vertical: string;
49
+ };
50
+ border: {
51
+ radius: string;
52
+ style: string;
53
+ width: string;
54
+ };
55
+ direction: string;
56
+ grid: {
57
+ columns: string[];
58
+ rows: string[];
59
+ };
60
+ name: string;
61
+ padding: string;
62
+ sections: {
63
+ action: string;
64
+ buttonStyle: string;
65
+ disableDowngrade: boolean;
66
+ popover: {
67
+ alignment: string;
68
+ position: string;
69
+ };
70
+ sections: {
71
+ buttonField: string;
72
+ content: {
73
+ ar: string;
74
+ cs: string;
75
+ da: string;
76
+ de: string;
77
+ en: string;
78
+ es: string;
79
+ fi: string;
80
+ fr: string;
81
+ ga: string;
82
+ he: string;
83
+ hi: string;
84
+ id: string;
85
+ it: string;
86
+ ja: string;
87
+ ko: string;
88
+ nl: string;
89
+ no: string;
90
+ pl: string;
91
+ pt: string;
92
+ ru: string;
93
+ sv: string;
94
+ th: string;
95
+ tr: string;
96
+ uk: string;
97
+ vi: string;
98
+ zh: string;
99
+ };
100
+ sectionType: string;
101
+ }[];
102
+ sectionType: string;
103
+ }[];
104
+ sectionType: string;
105
+ spacing: string;
106
+ width: number;
107
+ } | {
108
+ alignment: {
109
+ horizontal: string;
110
+ vertical: string;
111
+ };
112
+ border: {
113
+ radius: string;
114
+ style: string;
115
+ width: string;
116
+ };
117
+ direction: string;
118
+ grid: {
119
+ columns: string[];
120
+ rows: string[];
121
+ };
122
+ padding: string;
123
+ sections: ({
124
+ alignment: {
125
+ horizontal: string;
126
+ vertical: string;
127
+ };
128
+ border: {
129
+ radius: string;
130
+ style: string;
131
+ width: string;
132
+ };
133
+ direction: string;
134
+ grid: {
135
+ columns: string[];
136
+ rows: string[];
137
+ };
138
+ padding: string;
139
+ sections: ({
140
+ altText: string;
141
+ aspectRatio: null;
142
+ border: {
143
+ radius: string;
144
+ style: string;
145
+ width: string;
146
+ };
147
+ category: null;
148
+ name: string;
149
+ naturalHeight: number;
150
+ naturalWidth: number;
151
+ objectFit: string;
152
+ sectionType: string;
153
+ source: string;
154
+ width: number;
155
+ content?: undefined;
156
+ action?: undefined;
157
+ buttonStyle?: undefined;
158
+ disableDowngrade?: undefined;
159
+ popover?: undefined;
160
+ sections?: undefined;
161
+ } | {
162
+ content: {
163
+ en: {
164
+ attrs: {
165
+ blockSpacing: string;
166
+ };
167
+ content: {
168
+ attrs: {
169
+ textAlign: string;
170
+ };
171
+ content: {
172
+ marks: ({
173
+ attrs: {
174
+ color: string;
175
+ fontSize: string;
176
+ };
177
+ type: string;
178
+ } | {
179
+ type: string;
180
+ attrs?: undefined;
181
+ })[];
182
+ text: string;
183
+ type: string;
184
+ }[];
185
+ type: string;
186
+ }[];
187
+ type: string;
188
+ };
189
+ };
190
+ name: string;
191
+ sectionType: string;
192
+ altText?: undefined;
193
+ aspectRatio?: undefined;
194
+ border?: undefined;
195
+ category?: undefined;
196
+ naturalHeight?: undefined;
197
+ naturalWidth?: undefined;
198
+ objectFit?: undefined;
199
+ source?: undefined;
200
+ width?: undefined;
201
+ action?: undefined;
202
+ buttonStyle?: undefined;
203
+ disableDowngrade?: undefined;
204
+ popover?: undefined;
205
+ sections?: undefined;
206
+ } | {
207
+ action: string;
208
+ buttonStyle: string;
209
+ disableDowngrade: boolean;
210
+ popover: {
211
+ alignment: string;
212
+ position: string;
213
+ };
214
+ sections: {
215
+ buttonField: string;
216
+ content: {
217
+ ar: string;
218
+ cs: string;
219
+ da: string;
220
+ de: string;
221
+ en: string;
222
+ es: string;
223
+ fi: string;
224
+ fr: string;
225
+ ga: string;
226
+ he: string;
227
+ hi: string;
228
+ id: string;
229
+ it: string;
230
+ ja: string;
231
+ ko: string;
232
+ nl: string;
233
+ no: string;
234
+ pl: string;
235
+ pt: string;
236
+ ru: string;
237
+ sv: string;
238
+ th: string;
239
+ tr: string;
240
+ uk: string;
241
+ vi: string;
242
+ zh: string;
243
+ };
244
+ sectionType: string;
245
+ }[];
246
+ sectionType: string;
247
+ altText?: undefined;
248
+ aspectRatio?: undefined;
249
+ border?: undefined;
250
+ category?: undefined;
251
+ name?: undefined;
252
+ naturalHeight?: undefined;
253
+ naturalWidth?: undefined;
254
+ objectFit?: undefined;
255
+ source?: undefined;
256
+ width?: undefined;
257
+ content?: undefined;
258
+ })[];
259
+ sectionType: string;
260
+ spacing: string;
261
+ width: number;
262
+ limit?: undefined;
263
+ } | {
264
+ alignment: {
265
+ horizontal: string;
266
+ vertical: string;
267
+ };
268
+ border: {
269
+ radius: string;
270
+ style: string;
271
+ width: string;
272
+ };
273
+ direction: string;
274
+ grid: {
275
+ columns: string[];
276
+ rows: string[];
277
+ };
278
+ padding: string;
279
+ sections: {
280
+ errorMessages: {
281
+ en: {
282
+ max: string;
283
+ min: string;
284
+ neg: string;
285
+ };
286
+ };
287
+ inputType: string;
288
+ max: number;
289
+ min: number;
290
+ sectionType: string;
291
+ }[];
292
+ sectionType: string;
293
+ spacing: string;
294
+ width: number;
295
+ limit?: undefined;
296
+ } | {
297
+ limit: number;
298
+ sectionType: string;
299
+ alignment?: undefined;
300
+ border?: undefined;
301
+ direction?: undefined;
302
+ grid?: undefined;
303
+ padding?: undefined;
304
+ sections?: undefined;
305
+ spacing?: undefined;
306
+ width?: undefined;
307
+ } | {
308
+ sectionType: string;
309
+ alignment?: undefined;
310
+ border?: undefined;
311
+ direction?: undefined;
312
+ grid?: undefined;
313
+ padding?: undefined;
314
+ sections?: undefined;
315
+ spacing?: undefined;
316
+ width?: undefined;
317
+ limit?: undefined;
318
+ })[];
319
+ sectionType: string;
320
+ spacing: string;
321
+ width: number;
322
+ name?: undefined;
323
+ })[];
324
+ sectionType: string;
325
+ spacing: string;
326
+ width: number;
327
+ }[];
328
+ sectionType: string;
329
+ spacing: string;
330
+ targetArea: {
331
+ icon: string;
332
+ label: string;
333
+ width: string;
334
+ };
335
+ type: string;
336
+ version: number;
337
+ width: number;
338
+ };
339
+ //# sourceMappingURL=offerTemplateSeed.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"offerTemplateSeed.d.ts","sourceRoot":"","sources":["../../../src/transforms/offerV1/offerTemplateSeed.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmZ/B,CAAC"}
@@ -0,0 +1,145 @@
1
+ /**
2
+ * Minimal v1 Offer (Checkout Offers / product recommendations) input types.
3
+ * The legacy widget's settings `type` is the generic `shopify_checkout_extension`
4
+ * (the offer is the "base" checkout-extension type; other widgets carry
5
+ * `ui_extension_*`), which uniquely identifies it at the settings level.
6
+ */
7
+ import { type TiptapDocument } from '../../schema/widgets/checkout-and-beyond/text';
8
+ export declare const SHOPIFY_CHECKOUT_EXTENSION: "shopify_checkout_extension";
9
+ export type V1OfferLanguage = {
10
+ addedToCart?: string;
11
+ addingToCart?: string;
12
+ addToCart?: string;
13
+ /** Subscribe → one-time label for the offers `switchToSubscription` button. */
14
+ cartSwitchToOnetime?: string;
15
+ /** One-time → subscribe label (carries `{{subscription_discount}}`) for the `switchToSubscription` button. */
16
+ cartSwitchToSubscription?: string;
17
+ description?: string;
18
+ /** Real payload key is `sold_out_label` → `soldOutLabel` (NOT `soldOut`). */
19
+ soldOutLabel?: string;
20
+ /** Opt-in undo banner shown after a buyer adds a recommended product. */
21
+ successBannerEnabled?: boolean;
22
+ successBannerMessageRte?: TiptapDocument | string;
23
+ superTitle?: string;
24
+ title?: string;
25
+ /** Legacy "Upgrade to Subscription and Save {{subscription_discount}}%" upsell label. */
26
+ upgradeToSubscription?: string;
27
+ };
28
+ /** v1 per-product text styling; `textSize` is the CAB `textSizeNames` enum verbatim. */
29
+ export type V1TextStyle = {
30
+ textEmphasis?: 'base' | 'bold' | 'italic';
31
+ textSize?: 'extraSmall' | 'small' | 'base' | 'medium' | 'large' | 'extraLarge';
32
+ };
33
+ /** v1 `displaySettings` — the controls behind product/variant/image/review presentation. */
34
+ export type V1OfferDisplaySettings = {
35
+ image?: {
36
+ imageFit?: 'contain' | 'cover';
37
+ };
38
+ product?: V1TextStyle;
39
+ reviews?: {
40
+ color?: string;
41
+ size?: 'small' | 'default' | 'large';
42
+ };
43
+ variant?: V1TextStyle;
44
+ };
45
+ /**
46
+ * v1 layout is per-breakpoint; CAB has no breakpoints, so the converter collapses them.
47
+ * `style` drives orientation: list → rows, line → columns, grid → grid (none → rows).
48
+ */
49
+ export type V1OfferBreakpointLayout = {
50
+ carousel?: boolean;
51
+ columns?: number;
52
+ showPaginations?: boolean;
53
+ style?: 'grid' | 'line' | 'list' | 'none';
54
+ };
55
+ export type V1OfferSettings = {
56
+ /** Free-form in real payloads; the converter safelists to the CAB enum (junk → 'primary'). */
57
+ button?: {
58
+ kind?: string;
59
+ };
60
+ /** `showSavingAmount` false hides the compare-at (sale) price; `amount`/`type`/`discountedFrom`/`discountedBy` drive the discount-setting price computation (emitted onto the offers section for the client's pricing pass). */
61
+ discount?: {
62
+ amount?: number | string;
63
+ discountedBy?: string;
64
+ discountedFrom?: string;
65
+ /** Merchant-facing promo label (e.g. "Enjoy 10% off!") → carried onto the data-source discount. */
66
+ message?: string;
67
+ /** How many items the discount applies to (defaults to 1) → carried onto the discount section. */
68
+ quantity?: number;
69
+ showSavingAmount?: boolean;
70
+ type?: string;
71
+ };
72
+ /** Per-product/variant/image/review presentation controls. */
73
+ displaySettings?: V1OfferDisplaySettings;
74
+ /** Engine path appended to `/api/v1` (e.g. '/products/recommended'). */
75
+ endpoint?: string | null;
76
+ images?: {
77
+ source?: 'product' | 'variant';
78
+ };
79
+ integrations?: Record<string, boolean>;
80
+ language?: V1OfferLanguage;
81
+ layout?: {
82
+ large?: V1OfferBreakpointLayout;
83
+ medium?: V1OfferBreakpointLayout;
84
+ small?: V1OfferBreakpointLayout;
85
+ };
86
+ limit?: number;
87
+ location?: 'checkout' | 'order-status' | 'thank-you';
88
+ /** The legacy widget's name, present in the settings payload; carried to the converted root. */
89
+ name?: string;
90
+ previewMode?: boolean;
91
+ productOptions?: {
92
+ hideOutOfStockVariants?: boolean;
93
+ matchVariant?: boolean;
94
+ matchVariantOutOfStock?: boolean;
95
+ /** 'hide' (or absent) hides the per-card product description; any other value shows it. */
96
+ showProductDescription?: string;
97
+ showVariantOptions?: 'always' | 'default' | 'never';
98
+ showVariantsAsProducts?: boolean;
99
+ /** 'hide' (or absent) hides the selected-variant title line; any other value shows it. */
100
+ showVariantTitle?: string;
101
+ };
102
+ productType?: 'both' | 'one-time' | 'subscription';
103
+ quantityInputs?: {
104
+ enabled?: boolean;
105
+ /** Custom over-max error copy → CAB `errorMessages.en.max`. */
106
+ maxError?: string;
107
+ maxValue?: number;
108
+ /** Custom under-min error copy → CAB `errorMessages.en.min`. */
109
+ minError?: string;
110
+ minValue?: number;
111
+ /** Custom negative-value error copy → CAB `errorMessages.en.neg`. */
112
+ negativeError?: string;
113
+ /** Stepper kind ('dropdown-select' | 'buttons-manual-input') → CAB `inputType` (select | number). */
114
+ type?: string;
115
+ };
116
+ /** Default subscribe-vs-one-time when `productType` is `both`. */
117
+ subscriptionIsDefault?: boolean;
118
+ tracking?: {
119
+ enableAttribution?: boolean;
120
+ enableSource?: boolean;
121
+ enableWidget?: boolean;
122
+ };
123
+ treatAsGwp?: boolean;
124
+ type: typeof SHOPIFY_CHECKOUT_EXTENSION;
125
+ /** Absent on real checkout-offers payloads; only `type` is the reliable discriminator. */
126
+ version?: 1;
127
+ /** v1 `viewOptions.variantSelector` ('select' → CAB 'menu'). */
128
+ viewOptions?: {
129
+ variantSelector?: 'select' | 'radio' | 'button';
130
+ };
131
+ };
132
+ export type V1OfferConvertInput = {
133
+ id: number;
134
+ /** The legacy widget's name; set on the converted root (the admin save schema requires it). */
135
+ name?: string;
136
+ settings: V1OfferSettings;
137
+ };
138
+ /**
139
+ * The offer's settings `type` uniquely identifies it. Unlike the `ui_extension_*` widgets, the legacy
140
+ * checkout-offers payload carries NO top-level `version` — so we must NOT gate on it (doing so silently
141
+ * dropped real offers to the passthrough branch). `version: 2` payloads are already claimed upstream by
142
+ * `isCABRootSection`, so they never reach here.
143
+ */
144
+ export declare const isOfferV1: (data: unknown) => data is V1OfferSettings;
145
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/transforms/offerV1/types.ts"],"names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,OAAO,CAAC,EAAE,CAAC,CAAC;IACZ,gEAAgE;IAChE,WAAW,CAAC,EAAE;QAAE,eAAe,CAAC,EAAE,QAAQ,GAAG,OAAO,GAAG,QAAQ,CAAA;KAAE,CAAC;CACrE,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,+FAA+F;IAC/F,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,eAAe,CAAC;CAC7B,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,SAAS,GAAI,MAAM,OAAO,KAAG,IAAI,IAAI,eAIjD,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@rebuy/rebuy",
3
3
  "description": "This is the default library for Rebuy",
4
- "version": "2.27.0",
4
+ "version": "2.28.0",
5
5
  "license": "MIT",
6
6
  "author": "Rebuy, Inc.",
7
7
  "type": "module",