@rebuy/rebuy 3.35.0 → 3.37.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 (42) hide show
  1. package/dist/index.cjs +799 -648
  2. package/dist/index.mjs +799 -648
  3. package/dist/schema/index.d.ts +4 -0
  4. package/dist/schema/postPurchaseGroup.d.ts +15 -0
  5. package/dist/schema/postPurchaseProduct.d.ts +102 -24
  6. package/dist/schema/postPurchaseProductCalculation.d.ts +87 -0
  7. package/dist/schema/postPurchaseProductCollectionView.d.ts +738 -3
  8. package/dist/schema/postPurchaseProductDisplay.d.ts +57 -16
  9. package/dist/schema/postPurchaseProductReviews.d.ts +36 -0
  10. package/dist/schema/postPurchaseProductView.d.ts +722 -0
  11. package/dist/schema/postPurchaseQuantity.d.ts +16 -3
  12. package/dist/schema/postPurchaseSubscriptionProduct.d.ts +98 -17
  13. package/dist/server/__fixtures__/postPurchaseGroup.d.ts +3 -0
  14. package/dist/server/__fixtures__/postPurchaseReviewProviders.d.ts +30 -0
  15. package/dist/server/__fixtures__/postPurchaseReviews.d.ts +67 -0
  16. package/dist/server/index.cjs +1014 -348
  17. package/dist/server/index.d.ts +13 -2
  18. package/dist/server/index.mjs +1014 -348
  19. package/dist/server/postPurchaseJudgeMeReviews.d.ts +6 -0
  20. package/dist/server/postPurchaseOkendoReviews.d.ts +6 -0
  21. package/dist/server/postPurchaseProductDisplay.d.ts +49 -7
  22. package/dist/server/postPurchaseReviewData.d.ts +7 -0
  23. package/dist/server/postPurchaseReviewFields.d.ts +7 -0
  24. package/dist/server/postPurchaseReviewProvider.d.ts +2 -0
  25. package/dist/server/postPurchaseReviews.d.ts +5 -0
  26. package/dist/server/postPurchaseScalarReviews.d.ts +6 -0
  27. package/dist/server/prepareNormalizedSubscription.d.ts +2 -2
  28. package/dist/server/preparePostPurchaseAdmissionView.d.ts +428 -0
  29. package/dist/server/preparePostPurchaseCollectionGroup.d.ts +468 -0
  30. package/dist/server/preparePostPurchaseCollectionView.d.ts +452 -0
  31. package/dist/server/preparePostPurchaseGroupAdmissionView.d.ts +469 -0
  32. package/dist/server/preparePostPurchaseGroupDefault.d.ts +469 -0
  33. package/dist/server/preparePostPurchaseGroupView.d.ts +468 -0
  34. package/dist/server/preparePostPurchaseMemberView.d.ts +1496 -0
  35. package/dist/server/preparePostPurchaseProduct.d.ts +8 -0
  36. package/dist/server/preparePostPurchaseQuantityAdmissionView.d.ts +450 -0
  37. package/dist/server/preparePostPurchaseQuantityView.d.ts +437 -0
  38. package/dist/server/preparePostPurchaseSubscription.d.ts +47 -5
  39. package/dist/server/preparePostPurchaseView.d.ts +8 -0
  40. package/dist/server/projectPostPurchaseProduct.d.ts +49 -6
  41. package/dist/transforms/postPurchase/convertDescriptionRte.d.ts +11 -0
  42. package/package.json +1 -1
@@ -0,0 +1,468 @@
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
+ reviews: {
128
+ color: string;
129
+ rating: number;
130
+ reviewCount: number;
131
+ reviewsPlural: string;
132
+ reviewsSingular: string;
133
+ size: "small" | "large" | "medium";
134
+ strokeColor: string;
135
+ strokeWidth: number;
136
+ } | null;
137
+ shouldShowSavingText: boolean;
138
+ description: string | null;
139
+ descriptionDocument?: {
140
+ attrs: {
141
+ blockSpacing?: "none" | "base" | "extraTight" | "tight" | "loose" | "extraLoose" | undefined;
142
+ };
143
+ content: never[] | {
144
+ attrs: {
145
+ textAlign?: "start" | "center" | "end" | undefined;
146
+ };
147
+ content: never[] | {
148
+ text: string;
149
+ type: "text";
150
+ marks?: never[] | ({
151
+ type: "bold";
152
+ } | {
153
+ type: "italic";
154
+ } | {
155
+ attrs: {
156
+ class: string | null;
157
+ href: string;
158
+ rel: string;
159
+ target: string;
160
+ };
161
+ type: "link";
162
+ } | {
163
+ type: "strike";
164
+ } | {
165
+ attrs: {
166
+ color: "success" | "warning" | "critical" | "base" | "decorative" | "subdued" | "accent";
167
+ fontSize: "small" | "base" | "large" | "medium" | "extraSmall" | "extraLarge" | "heading";
168
+ };
169
+ type: "textStyle";
170
+ })[] | undefined;
171
+ }[];
172
+ type: "paragraph";
173
+ }[];
174
+ type: "doc";
175
+ } | undefined;
176
+ gallery?: {
177
+ images: {
178
+ description: string;
179
+ id: number;
180
+ source: string;
181
+ thumbnail: string;
182
+ }[];
183
+ selectedImageId?: number | undefined;
184
+ } | undefined;
185
+ };
186
+ };
187
+ sections: {
188
+ alignment: {
189
+ horizontal: "start" | "center" | "end";
190
+ vertical: "top" | "middle" | "bottom";
191
+ };
192
+ border: {
193
+ radius: "small" | "none" | "base" | "large" | "fullyRounded";
194
+ style: "none" | "base" | "dotted" | "dashed";
195
+ width: "base" | "medium" | "thick";
196
+ };
197
+ direction: "columns" | "rows" | "grid";
198
+ padding: "none" | "base" | "extraTight" | "tight" | "loose" | "extraLoose";
199
+ sectionId: string;
200
+ sections: never[] | import("..").CABSection[];
201
+ sectionType: "layout";
202
+ spacing: "none" | "base" | "extraTight" | "tight" | "loose" | "extraLoose";
203
+ width: number;
204
+ editorMode: "checkoutExtension" | "postPurchaseOffer" | "thankYouPage" | "orderStatusPage" | "ordersIndexPage" | "customerProfilePage";
205
+ previewMode: boolean;
206
+ storeId: number | null;
207
+ targetArea: {
208
+ icon: string;
209
+ label: string;
210
+ width: string;
211
+ fill?: boolean | undefined;
212
+ flip?: "vertical" | "horizontal" | "both" | undefined;
213
+ } | null;
214
+ tracking: {
215
+ enableAttribution: boolean;
216
+ enableSource: boolean;
217
+ enableWidget: boolean;
218
+ };
219
+ 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";
220
+ uiLabels: {
221
+ currentPage: Record<string, string>;
222
+ guest: Record<string, string>;
223
+ loadingOptions: Record<string, string>;
224
+ nextPage: Record<string, string>;
225
+ offerCarousel: Record<string, string>;
226
+ offerDialog: Record<string, string>;
227
+ page: Record<string, string>;
228
+ previousPage: Record<string, string>;
229
+ selected: Record<string, string>;
230
+ subscriptionOptions: Record<string, string>;
231
+ updating: Record<string, string>;
232
+ };
233
+ version: 2;
234
+ widgetId: number | null;
235
+ 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;
236
+ frame?: "callout" | "offer-content" | undefined;
237
+ grid?: {
238
+ columns: (string | number)[];
239
+ rows: (string | number)[];
240
+ } | undefined;
241
+ name?: string | undefined;
242
+ viewUrl?: string | undefined;
243
+ wrapping?: {
244
+ breakAt: number;
245
+ maxPerLine: number;
246
+ } | undefined;
247
+ mutators?: {
248
+ effect: "set_false" | "set_true" | "toggle";
249
+ variable: string;
250
+ when: {
251
+ operator: "is_empty" | "is_not_empty";
252
+ type: "content";
253
+ } | {
254
+ operator: "equals" | "greater_than" | "less_than";
255
+ type: "result_count";
256
+ value: number;
257
+ } | {
258
+ operator: "contains" | "does_not_contain";
259
+ type: "result_tag";
260
+ value: string;
261
+ } | {
262
+ event: "item_added" | "quantity_changed" | "variant_selected";
263
+ type: "event";
264
+ };
265
+ }[] | undefined;
266
+ variables?: ({
267
+ defaultValue: string;
268
+ name: string;
269
+ type: "text";
270
+ seed?: undefined;
271
+ } | {
272
+ defaultValue: number;
273
+ name: string;
274
+ type: "number";
275
+ seed?: undefined;
276
+ } | {
277
+ defaultValue: boolean;
278
+ name: string;
279
+ type: "boolean";
280
+ seed?: {
281
+ dataSourceId: number | null;
282
+ ruleset: {
283
+ exitIfMatched: boolean;
284
+ logic: {
285
+ rules: {
286
+ operator: "equals" | "greater_than" | "less_than" | "contains" | "does_not_contain" | "after" | "anything" | "before" | "contains_any" | "does_not_contain_any" | "does_not_equal";
287
+ products: never[] | unknown[];
288
+ 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";
289
+ value: string;
290
+ }[];
291
+ }[];
292
+ output: {
293
+ key: string;
294
+ type: "data_json";
295
+ value: string;
296
+ }[];
297
+ }[];
298
+ } | undefined;
299
+ })[] | undefined;
300
+ visibility?: {
301
+ variable: string;
302
+ visibleWhen: boolean;
303
+ } | undefined;
304
+ experiment?: {
305
+ elementId: number;
306
+ experimentId: number;
307
+ experimentType: string;
308
+ selectedId: number;
309
+ } | undefined;
310
+ };
311
+ groupCatalog?: {
312
+ memberProductId: number;
313
+ options: {
314
+ productId: number;
315
+ title: string;
316
+ variantCatalog: {
317
+ displayMode: "single" | "separate";
318
+ options: {
319
+ name: string;
320
+ values: string[];
321
+ id: number;
322
+ position: number;
323
+ }[];
324
+ productId: number;
325
+ showSelectors: boolean;
326
+ variants: {
327
+ available: boolean;
328
+ id: number;
329
+ title: string;
330
+ option1?: string | undefined;
331
+ option2?: string | null | undefined;
332
+ option3?: string | null | undefined;
333
+ imageId?: number | null | undefined;
334
+ }[];
335
+ };
336
+ }[];
337
+ } | undefined;
338
+ initialVariant?: {
339
+ variantId: number;
340
+ } | undefined;
341
+ planCatalog?: {
342
+ plans: {
343
+ id: number;
344
+ intervalLabel: string;
345
+ name: string;
346
+ adjustment?: {
347
+ amount: number;
348
+ type: "price" | "fixed_amount" | "percentage";
349
+ } | undefined;
350
+ intervalFrequency?: string | undefined;
351
+ }[];
352
+ productId: number;
353
+ requiresSellingPlan: boolean;
354
+ variantId: number;
355
+ } | null | undefined;
356
+ purchaseOptions?: {
357
+ defaultChoice: {
358
+ mode: "one-time";
359
+ } | {
360
+ mode: "subscription";
361
+ sellingPlanId: number;
362
+ };
363
+ modes: ("one-time" | "subscription")[];
364
+ selector: "radio" | "dropdown";
365
+ } | undefined;
366
+ variantCatalog?: {
367
+ displayMode: "single" | "separate";
368
+ options: {
369
+ name: string;
370
+ values: string[];
371
+ id: number;
372
+ position: number;
373
+ }[];
374
+ productId: number;
375
+ showSelectors: boolean;
376
+ variants: {
377
+ available: boolean;
378
+ id: number;
379
+ title: string;
380
+ option1?: string | undefined;
381
+ option2?: string | null | undefined;
382
+ option3?: string | null | undefined;
383
+ imageId?: number | null | undefined;
384
+ }[];
385
+ } | undefined;
386
+ } | {
387
+ preparation: {
388
+ reason: string;
389
+ status: "unsupported";
390
+ };
391
+ sections: null;
392
+ groupCatalog?: {
393
+ memberProductId: number;
394
+ options: {
395
+ productId: number;
396
+ title: string;
397
+ variantCatalog: {
398
+ displayMode: "single" | "separate";
399
+ options: {
400
+ name: string;
401
+ values: string[];
402
+ id: number;
403
+ position: number;
404
+ }[];
405
+ productId: number;
406
+ showSelectors: boolean;
407
+ variants: {
408
+ available: boolean;
409
+ id: number;
410
+ title: string;
411
+ option1?: string | undefined;
412
+ option2?: string | null | undefined;
413
+ option3?: string | null | undefined;
414
+ imageId?: number | null | undefined;
415
+ }[];
416
+ };
417
+ }[];
418
+ } | undefined;
419
+ initialVariant?: {
420
+ variantId: number;
421
+ } | undefined;
422
+ planCatalog?: {
423
+ plans: {
424
+ id: number;
425
+ intervalLabel: string;
426
+ name: string;
427
+ adjustment?: {
428
+ amount: number;
429
+ type: "price" | "fixed_amount" | "percentage";
430
+ } | undefined;
431
+ intervalFrequency?: string | undefined;
432
+ }[];
433
+ productId: number;
434
+ requiresSellingPlan: boolean;
435
+ variantId: number;
436
+ } | null | undefined;
437
+ purchaseOptions?: {
438
+ defaultChoice: {
439
+ mode: "one-time";
440
+ } | {
441
+ mode: "subscription";
442
+ sellingPlanId: number;
443
+ };
444
+ modes: ("one-time" | "subscription")[];
445
+ selector: "radio" | "dropdown";
446
+ } | undefined;
447
+ variantCatalog?: {
448
+ displayMode: "single" | "separate";
449
+ options: {
450
+ name: string;
451
+ values: string[];
452
+ id: number;
453
+ position: number;
454
+ }[];
455
+ productId: number;
456
+ showSelectors: boolean;
457
+ variants: {
458
+ available: boolean;
459
+ id: number;
460
+ title: string;
461
+ option1?: string | undefined;
462
+ option2?: string | null | undefined;
463
+ option3?: string | null | undefined;
464
+ imageId?: number | null | undefined;
465
+ }[];
466
+ } | undefined;
467
+ };
468
+ } | null;