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