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