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