@rebuy/rebuy 3.35.0 → 3.36.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 (31) hide show
  1. package/dist/index.cjs +689 -571
  2. package/dist/index.mjs +689 -571
  3. package/dist/schema/index.d.ts +3 -0
  4. package/dist/schema/postPurchaseGroup.d.ts +15 -0
  5. package/dist/schema/postPurchaseProduct.d.ts +74 -24
  6. package/dist/schema/postPurchaseProductCalculation.d.ts +87 -0
  7. package/dist/schema/postPurchaseProductCollectionView.d.ts +724 -3
  8. package/dist/schema/postPurchaseProductDisplay.d.ts +41 -12
  9. package/dist/schema/postPurchaseProductView.d.ts +708 -0
  10. package/dist/schema/postPurchaseQuantity.d.ts +16 -3
  11. package/dist/schema/postPurchaseSubscriptionProduct.d.ts +74 -17
  12. package/dist/server/__fixtures__/postPurchaseGroup.d.ts +3 -0
  13. package/dist/server/index.cjs +818 -310
  14. package/dist/server/index.d.ts +13 -2
  15. package/dist/server/index.mjs +818 -310
  16. package/dist/server/postPurchaseProductDisplay.d.ts +38 -6
  17. package/dist/server/preparePostPurchaseAdmissionView.d.ts +418 -0
  18. package/dist/server/preparePostPurchaseCollectionGroup.d.ts +458 -0
  19. package/dist/server/preparePostPurchaseCollectionView.d.ts +442 -0
  20. package/dist/server/preparePostPurchaseGroupAdmissionView.d.ts +459 -0
  21. package/dist/server/preparePostPurchaseGroupDefault.d.ts +459 -0
  22. package/dist/server/preparePostPurchaseGroupView.d.ts +458 -0
  23. package/dist/server/preparePostPurchaseMemberView.d.ts +1466 -0
  24. package/dist/server/preparePostPurchaseProduct.d.ts +11 -0
  25. package/dist/server/preparePostPurchaseQuantityAdmissionView.d.ts +440 -0
  26. package/dist/server/preparePostPurchaseQuantityView.d.ts +427 -0
  27. package/dist/server/preparePostPurchaseSubscription.d.ts +37 -5
  28. package/dist/server/preparePostPurchaseView.d.ts +8 -0
  29. package/dist/server/projectPostPurchaseProduct.d.ts +37 -5
  30. package/dist/transforms/postPurchase/convertDescriptionRte.d.ts +11 -0
  31. package/package.json +1 -1
@@ -0,0 +1,458 @@
1
+ import { PostPurchaseGroupChoice } from '../schema/postPurchaseGroup';
2
+ import type { PostPurchaseExcludedProductIds } from '../schema/postPurchaseProductCollectionView';
3
+ import type { Reporter } from '../server/shared';
4
+ /** Pure group preparation retains the card identity separately from selected merchandise. */
5
+ export declare const preparePostPurchaseGroupView: (widgetId: number, settings: unknown, response: unknown, requested: PostPurchaseGroupChoice, report?: Reporter, excludedProductIds?: PostPurchaseExcludedProductIds) => {
6
+ groupCatalog: {
7
+ memberProductId: number;
8
+ options: {
9
+ productId: number;
10
+ title: string;
11
+ variantCatalog: {
12
+ displayMode: "single" | "separate";
13
+ options: {
14
+ name: string;
15
+ values: string[];
16
+ id: number;
17
+ position: number;
18
+ }[];
19
+ productId: number;
20
+ showSelectors: boolean;
21
+ variants: {
22
+ available: boolean;
23
+ id: number;
24
+ title: string;
25
+ option1?: string | undefined;
26
+ option2?: string | null | undefined;
27
+ option3?: string | null | undefined;
28
+ imageId?: number | null | undefined;
29
+ }[];
30
+ };
31
+ }[];
32
+ };
33
+ memberProductId: number;
34
+ productIndex: number;
35
+ reportingProduct: {
36
+ id: number;
37
+ title: string;
38
+ };
39
+ quantityPolicy: {
40
+ enabled: boolean;
41
+ initialQuantity: number;
42
+ maxValue: number;
43
+ minValue: number;
44
+ };
45
+ productId: number;
46
+ view: {
47
+ preparation: {
48
+ labels: {
49
+ declineAll: string;
50
+ free: string;
51
+ payNow: string;
52
+ quantity: string;
53
+ recurringShipping: string;
54
+ recurringSubtotal: string;
55
+ save: string;
56
+ shipping: string;
57
+ subtotal: string;
58
+ taxes: string;
59
+ total: string;
60
+ };
61
+ product: {
62
+ title: string;
63
+ id: number;
64
+ variant: {
65
+ title: string;
66
+ compareAtPrice: string | null;
67
+ id: number;
68
+ price: string;
69
+ };
70
+ image?: {
71
+ src: string;
72
+ } | null | undefined;
73
+ description?: string | null | undefined;
74
+ };
75
+ selection: {
76
+ productId: number;
77
+ quantity: number;
78
+ variantId: number;
79
+ sellingPlanId?: number | undefined;
80
+ };
81
+ status: "prepared";
82
+ terms: {
83
+ discount: {
84
+ amount: number;
85
+ title: string;
86
+ type: "none" | "fixed_amount" | "percentage";
87
+ };
88
+ shipping: {
89
+ amount: number;
90
+ title: string;
91
+ type: "fixed_amount" | "free";
92
+ };
93
+ subscription?: {
94
+ initialShippingPrice: number;
95
+ intervalLabel: string;
96
+ name: string;
97
+ recurringShippingPrice: number;
98
+ shippingOption: {
99
+ presentmentTitle: string;
100
+ title: string;
101
+ };
102
+ adjustment?: {
103
+ amount: number;
104
+ type: "price" | "fixed_amount" | "percentage";
105
+ } | undefined;
106
+ } | undefined;
107
+ };
108
+ display: {
109
+ discountedFrom: "price" | "compare_at_price";
110
+ language: {
111
+ description: string;
112
+ descriptionEnabled: boolean;
113
+ };
114
+ primaryImage: {
115
+ description: string;
116
+ source: string;
117
+ };
118
+ productOptions: {
119
+ showShipping: boolean;
120
+ showSubtotal: boolean;
121
+ showTaxes: boolean;
122
+ showTotal: boolean;
123
+ showVariantSelectors: boolean;
124
+ showDeclineAll?: "none" | "both" | "above" | "below" | undefined;
125
+ };
126
+ responseDescription: string;
127
+ shouldShowSavingText: boolean;
128
+ description: string | null;
129
+ descriptionDocument?: {
130
+ attrs: {
131
+ blockSpacing?: "none" | "base" | "extraTight" | "tight" | "loose" | "extraLoose" | undefined;
132
+ };
133
+ content: never[] | {
134
+ attrs: {
135
+ textAlign?: "start" | "center" | "end" | undefined;
136
+ };
137
+ content: never[] | {
138
+ text: string;
139
+ type: "text";
140
+ marks?: never[] | ({
141
+ type: "bold";
142
+ } | {
143
+ type: "italic";
144
+ } | {
145
+ attrs: {
146
+ class: string | null;
147
+ href: string;
148
+ rel: string;
149
+ target: string;
150
+ };
151
+ type: "link";
152
+ } | {
153
+ type: "strike";
154
+ } | {
155
+ attrs: {
156
+ color: "success" | "warning" | "critical" | "base" | "decorative" | "subdued" | "accent";
157
+ fontSize: "small" | "base" | "large" | "medium" | "extraSmall" | "extraLarge" | "heading";
158
+ };
159
+ type: "textStyle";
160
+ })[] | undefined;
161
+ }[];
162
+ type: "paragraph";
163
+ }[];
164
+ type: "doc";
165
+ } | undefined;
166
+ gallery?: {
167
+ images: {
168
+ description: string;
169
+ id: number;
170
+ source: string;
171
+ thumbnail: string;
172
+ }[];
173
+ selectedImageId?: number | undefined;
174
+ } | undefined;
175
+ };
176
+ };
177
+ sections: {
178
+ alignment: {
179
+ horizontal: "start" | "center" | "end";
180
+ vertical: "top" | "middle" | "bottom";
181
+ };
182
+ border: {
183
+ radius: "small" | "none" | "base" | "large" | "fullyRounded";
184
+ style: "none" | "base" | "dotted" | "dashed";
185
+ width: "base" | "medium" | "thick";
186
+ };
187
+ direction: "columns" | "rows" | "grid";
188
+ padding: "none" | "base" | "extraTight" | "tight" | "loose" | "extraLoose";
189
+ sectionId: string;
190
+ sections: never[] | import("..").CABSection[];
191
+ sectionType: "layout";
192
+ spacing: "none" | "base" | "extraTight" | "tight" | "loose" | "extraLoose";
193
+ width: number;
194
+ editorMode: "checkoutExtension" | "postPurchaseOffer" | "thankYouPage" | "orderStatusPage" | "ordersIndexPage" | "customerProfilePage";
195
+ previewMode: boolean;
196
+ storeId: number | null;
197
+ targetArea: {
198
+ icon: string;
199
+ label: string;
200
+ width: string;
201
+ fill?: boolean | undefined;
202
+ flip?: "vertical" | "horizontal" | "both" | undefined;
203
+ } | null;
204
+ tracking: {
205
+ enableAttribution: boolean;
206
+ enableSource: boolean;
207
+ enableWidget: boolean;
208
+ };
209
+ type: "product" | "bundle_builder" | "cart" | "cart_subscription" | "dynamic_bundle" | "gift_with_purchase" | "placeholder" | "pre_purchase" | "product_addon" | "product_upsell" | "recharge_checkout" | "recharge_customer_portal" | "recharge_post_purchase" | "shopify_checkout" | "shopify_checkout_extension" | "shopify_post_purchase" | "shopify_post_purchase_extension" | "switch_to_subscription" | "ui_extension_ad" | "ui_extension_button" | "ui_extension_content_block" | "ui_extension_line_item_editor" | "ui_extension_progress_bar";
210
+ uiLabels: {
211
+ currentPage: Record<string, string>;
212
+ guest: Record<string, string>;
213
+ loadingOptions: Record<string, string>;
214
+ nextPage: Record<string, string>;
215
+ offerCarousel: Record<string, string>;
216
+ offerDialog: Record<string, string>;
217
+ page: Record<string, string>;
218
+ previousPage: Record<string, string>;
219
+ selected: Record<string, string>;
220
+ subscriptionOptions: Record<string, string>;
221
+ updating: Record<string, string>;
222
+ };
223
+ version: 2;
224
+ widgetId: number | null;
225
+ buttonField?: "declineAllOffers" | "declineOffer" | "removeFromOrder" | "undoAddToOrder" | "activePage" | "addedToCart" | "addingToCart" | "addToCart" | "buttonLabel" | "destinationUrl" | "inactivePage" | "overlayContent" | "payNow" | "progressReached" | "progressRemaining" | "redirectToCheckout" | "showVariant" | "showVariants" | "soldOut" | "subscriptionOption" | "switchToOneTimePurchase" | "switchToSubscriptionNoDiscount" | "switchToSubscriptionWithDiscount" | undefined;
226
+ frame?: "callout" | "offer-content" | undefined;
227
+ grid?: {
228
+ columns: (string | number)[];
229
+ rows: (string | number)[];
230
+ } | undefined;
231
+ name?: string | undefined;
232
+ viewUrl?: string | undefined;
233
+ wrapping?: {
234
+ breakAt: number;
235
+ maxPerLine: number;
236
+ } | undefined;
237
+ mutators?: {
238
+ effect: "set_false" | "set_true" | "toggle";
239
+ variable: string;
240
+ when: {
241
+ operator: "is_empty" | "is_not_empty";
242
+ type: "content";
243
+ } | {
244
+ operator: "equals" | "greater_than" | "less_than";
245
+ type: "result_count";
246
+ value: number;
247
+ } | {
248
+ operator: "contains" | "does_not_contain";
249
+ type: "result_tag";
250
+ value: string;
251
+ } | {
252
+ event: "item_added" | "quantity_changed" | "variant_selected";
253
+ type: "event";
254
+ };
255
+ }[] | undefined;
256
+ variables?: ({
257
+ defaultValue: string;
258
+ name: string;
259
+ type: "text";
260
+ seed?: undefined;
261
+ } | {
262
+ defaultValue: number;
263
+ name: string;
264
+ type: "number";
265
+ seed?: undefined;
266
+ } | {
267
+ defaultValue: boolean;
268
+ name: string;
269
+ type: "boolean";
270
+ seed?: {
271
+ dataSourceId: number | null;
272
+ ruleset: {
273
+ exitIfMatched: boolean;
274
+ logic: {
275
+ rules: {
276
+ operator: "equals" | "greater_than" | "less_than" | "contains" | "does_not_contain" | "after" | "anything" | "before" | "contains_any" | "does_not_contain_any" | "does_not_equal";
277
+ products: never[] | unknown[];
278
+ 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";
279
+ value: string;
280
+ }[];
281
+ }[];
282
+ output: {
283
+ key: string;
284
+ type: "data_json";
285
+ value: string;
286
+ }[];
287
+ }[];
288
+ } | undefined;
289
+ })[] | undefined;
290
+ visibility?: {
291
+ variable: string;
292
+ visibleWhen: boolean;
293
+ } | undefined;
294
+ experiment?: {
295
+ elementId: number;
296
+ experimentId: number;
297
+ experimentType: string;
298
+ selectedId: number;
299
+ } | undefined;
300
+ };
301
+ groupCatalog?: {
302
+ memberProductId: number;
303
+ options: {
304
+ productId: number;
305
+ title: string;
306
+ variantCatalog: {
307
+ displayMode: "single" | "separate";
308
+ options: {
309
+ name: string;
310
+ values: string[];
311
+ id: number;
312
+ position: number;
313
+ }[];
314
+ productId: number;
315
+ showSelectors: boolean;
316
+ variants: {
317
+ available: boolean;
318
+ id: number;
319
+ title: string;
320
+ option1?: string | undefined;
321
+ option2?: string | null | undefined;
322
+ option3?: string | null | undefined;
323
+ imageId?: number | null | undefined;
324
+ }[];
325
+ };
326
+ }[];
327
+ } | undefined;
328
+ initialVariant?: {
329
+ variantId: number;
330
+ } | undefined;
331
+ planCatalog?: {
332
+ plans: {
333
+ id: number;
334
+ intervalLabel: string;
335
+ name: string;
336
+ adjustment?: {
337
+ amount: number;
338
+ type: "price" | "fixed_amount" | "percentage";
339
+ } | undefined;
340
+ intervalFrequency?: string | undefined;
341
+ }[];
342
+ productId: number;
343
+ requiresSellingPlan: boolean;
344
+ variantId: number;
345
+ } | null | undefined;
346
+ purchaseOptions?: {
347
+ defaultChoice: {
348
+ mode: "one-time";
349
+ } | {
350
+ mode: "subscription";
351
+ sellingPlanId: number;
352
+ };
353
+ modes: ("one-time" | "subscription")[];
354
+ selector: "radio" | "dropdown";
355
+ } | undefined;
356
+ variantCatalog?: {
357
+ displayMode: "single" | "separate";
358
+ options: {
359
+ name: string;
360
+ values: string[];
361
+ id: number;
362
+ position: number;
363
+ }[];
364
+ productId: number;
365
+ showSelectors: boolean;
366
+ variants: {
367
+ available: boolean;
368
+ id: number;
369
+ title: string;
370
+ option1?: string | undefined;
371
+ option2?: string | null | undefined;
372
+ option3?: string | null | undefined;
373
+ imageId?: number | null | undefined;
374
+ }[];
375
+ } | undefined;
376
+ } | {
377
+ preparation: {
378
+ reason: string;
379
+ status: "unsupported";
380
+ };
381
+ sections: null;
382
+ groupCatalog?: {
383
+ memberProductId: number;
384
+ options: {
385
+ productId: number;
386
+ title: string;
387
+ variantCatalog: {
388
+ displayMode: "single" | "separate";
389
+ options: {
390
+ name: string;
391
+ values: string[];
392
+ id: number;
393
+ position: number;
394
+ }[];
395
+ productId: number;
396
+ showSelectors: boolean;
397
+ variants: {
398
+ available: boolean;
399
+ id: number;
400
+ title: string;
401
+ option1?: string | undefined;
402
+ option2?: string | null | undefined;
403
+ option3?: string | null | undefined;
404
+ imageId?: number | null | undefined;
405
+ }[];
406
+ };
407
+ }[];
408
+ } | undefined;
409
+ initialVariant?: {
410
+ variantId: number;
411
+ } | undefined;
412
+ planCatalog?: {
413
+ plans: {
414
+ id: number;
415
+ intervalLabel: string;
416
+ name: string;
417
+ adjustment?: {
418
+ amount: number;
419
+ type: "price" | "fixed_amount" | "percentage";
420
+ } | undefined;
421
+ intervalFrequency?: string | undefined;
422
+ }[];
423
+ productId: number;
424
+ requiresSellingPlan: boolean;
425
+ variantId: number;
426
+ } | null | undefined;
427
+ purchaseOptions?: {
428
+ defaultChoice: {
429
+ mode: "one-time";
430
+ } | {
431
+ mode: "subscription";
432
+ sellingPlanId: number;
433
+ };
434
+ modes: ("one-time" | "subscription")[];
435
+ selector: "radio" | "dropdown";
436
+ } | undefined;
437
+ variantCatalog?: {
438
+ displayMode: "single" | "separate";
439
+ options: {
440
+ name: string;
441
+ values: string[];
442
+ id: number;
443
+ position: number;
444
+ }[];
445
+ productId: number;
446
+ showSelectors: boolean;
447
+ variants: {
448
+ available: boolean;
449
+ id: number;
450
+ title: string;
451
+ option1?: string | undefined;
452
+ option2?: string | null | undefined;
453
+ option3?: string | null | undefined;
454
+ imageId?: number | null | undefined;
455
+ }[];
456
+ } | undefined;
457
+ };
458
+ } | null;