@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
@@ -1,7 +1,7 @@
1
1
  import type { PostPurchaseProductSettings } from '../schema/postPurchaseProductSettings';
2
2
  import type { PostPurchaseProductSource } from '../schema/postPurchaseProductSource';
3
3
  /**
4
- * Keep response-description provenance: it precedes merchant RTE even after settings are merged. Reviews
4
+ * Keep response-description provenance: it precedes the merchant's rich description even after settings are merged. Reviews
5
5
  * are Slice 26's addition (see `postPurchaseProductDisplay` schema); nothing here computes them yet.
6
6
  */
7
7
  export declare const projectPostPurchaseProductDisplay: (effective: PostPurchaseProductSettings, metadata: PostPurchaseProductSource["metadata"], product: PostPurchaseProductSource["data"][number]) => {
@@ -9,11 +9,6 @@ export declare const projectPostPurchaseProductDisplay: (effective: PostPurchase
9
9
  language: {
10
10
  description: string;
11
11
  descriptionEnabled: boolean;
12
- descriptionRte?: {
13
- content: unknown[];
14
- type: string;
15
- } | undefined;
16
- descriptionSpacing?: "default" | "none" | "tight" | "loose" | "xtight" | "xloose" | undefined;
17
12
  };
18
13
  primaryImage: {
19
14
  description: string;
@@ -29,6 +24,43 @@ export declare const projectPostPurchaseProductDisplay: (effective: PostPurchase
29
24
  };
30
25
  responseDescription: string;
31
26
  shouldShowSavingText: boolean;
27
+ descriptionDocument?: {
28
+ attrs: {
29
+ blockSpacing?: "none" | "base" | "extraTight" | "tight" | "loose" | "extraLoose" | undefined;
30
+ };
31
+ content: never[] | {
32
+ attrs: {
33
+ textAlign?: "start" | "center" | "end" | undefined;
34
+ };
35
+ content: never[] | {
36
+ text: string;
37
+ type: "text";
38
+ marks?: never[] | ({
39
+ type: "bold";
40
+ } | {
41
+ type: "italic";
42
+ } | {
43
+ attrs: {
44
+ class: string | null;
45
+ href: string;
46
+ rel: string;
47
+ target: string;
48
+ };
49
+ type: "link";
50
+ } | {
51
+ type: "strike";
52
+ } | {
53
+ attrs: {
54
+ color: "success" | "warning" | "critical" | "base" | "decorative" | "subdued" | "accent";
55
+ fontSize: "small" | "base" | "large" | "medium" | "extraSmall" | "extraLarge" | "heading";
56
+ };
57
+ type: "textStyle";
58
+ })[] | undefined;
59
+ }[];
60
+ type: "paragraph";
61
+ }[];
62
+ type: "doc";
63
+ } | undefined;
32
64
  gallery?: {
33
65
  images: {
34
66
  description: string;
@@ -0,0 +1,418 @@
1
+ import type { PostPurchaseChoice } from '../schema/postPurchaseChoice';
2
+ import type { Reporter } from '../server/shared';
3
+ /** Private admission facts and public view share one effective configuration; no settings reread. */
4
+ export declare const preparePostPurchaseAdmissionView: (widgetId: number, settings: unknown, response: unknown, report?: Reporter, choice?: PostPurchaseChoice) => {
5
+ removePartialOrder: boolean;
6
+ view: {
7
+ preparation: {
8
+ labels: {
9
+ declineAll: string;
10
+ free: string;
11
+ payNow: string;
12
+ quantity: string;
13
+ recurringShipping: string;
14
+ recurringSubtotal: string;
15
+ save: string;
16
+ shipping: string;
17
+ subtotal: string;
18
+ taxes: string;
19
+ total: string;
20
+ };
21
+ product: {
22
+ title: string;
23
+ id: number;
24
+ variant: {
25
+ title: string;
26
+ compareAtPrice: string | null;
27
+ id: number;
28
+ price: string;
29
+ };
30
+ image?: {
31
+ src: string;
32
+ } | null | undefined;
33
+ description?: string | null | undefined;
34
+ };
35
+ selection: {
36
+ productId: number;
37
+ quantity: number;
38
+ variantId: number;
39
+ sellingPlanId?: number | undefined;
40
+ };
41
+ status: "prepared";
42
+ terms: {
43
+ discount: {
44
+ amount: number;
45
+ title: string;
46
+ type: "none" | "fixed_amount" | "percentage";
47
+ };
48
+ shipping: {
49
+ amount: number;
50
+ title: string;
51
+ type: "fixed_amount" | "free";
52
+ };
53
+ subscription?: {
54
+ initialShippingPrice: number;
55
+ intervalLabel: string;
56
+ name: string;
57
+ recurringShippingPrice: number;
58
+ shippingOption: {
59
+ presentmentTitle: string;
60
+ title: string;
61
+ };
62
+ adjustment?: {
63
+ amount: number;
64
+ type: "price" | "fixed_amount" | "percentage";
65
+ } | undefined;
66
+ } | undefined;
67
+ };
68
+ display: {
69
+ discountedFrom: "price" | "compare_at_price";
70
+ language: {
71
+ description: string;
72
+ descriptionEnabled: boolean;
73
+ };
74
+ primaryImage: {
75
+ description: string;
76
+ source: string;
77
+ };
78
+ productOptions: {
79
+ showShipping: boolean;
80
+ showSubtotal: boolean;
81
+ showTaxes: boolean;
82
+ showTotal: boolean;
83
+ showVariantSelectors: boolean;
84
+ showDeclineAll?: "none" | "both" | "above" | "below" | undefined;
85
+ };
86
+ responseDescription: string;
87
+ shouldShowSavingText: boolean;
88
+ description: string | null;
89
+ descriptionDocument?: {
90
+ attrs: {
91
+ blockSpacing?: "none" | "base" | "extraTight" | "tight" | "loose" | "extraLoose" | undefined;
92
+ };
93
+ content: never[] | {
94
+ attrs: {
95
+ textAlign?: "start" | "center" | "end" | undefined;
96
+ };
97
+ content: never[] | {
98
+ text: string;
99
+ type: "text";
100
+ marks?: never[] | ({
101
+ type: "bold";
102
+ } | {
103
+ type: "italic";
104
+ } | {
105
+ attrs: {
106
+ class: string | null;
107
+ href: string;
108
+ rel: string;
109
+ target: string;
110
+ };
111
+ type: "link";
112
+ } | {
113
+ type: "strike";
114
+ } | {
115
+ attrs: {
116
+ color: "success" | "warning" | "critical" | "base" | "decorative" | "subdued" | "accent";
117
+ fontSize: "small" | "base" | "large" | "medium" | "extraSmall" | "extraLarge" | "heading";
118
+ };
119
+ type: "textStyle";
120
+ })[] | undefined;
121
+ }[];
122
+ type: "paragraph";
123
+ }[];
124
+ type: "doc";
125
+ } | undefined;
126
+ gallery?: {
127
+ images: {
128
+ description: string;
129
+ id: number;
130
+ source: string;
131
+ thumbnail: string;
132
+ }[];
133
+ selectedImageId?: number | undefined;
134
+ } | undefined;
135
+ };
136
+ };
137
+ sections: {
138
+ alignment: {
139
+ horizontal: "start" | "center" | "end";
140
+ vertical: "top" | "middle" | "bottom";
141
+ };
142
+ border: {
143
+ radius: "small" | "none" | "base" | "large" | "fullyRounded";
144
+ style: "none" | "base" | "dotted" | "dashed";
145
+ width: "base" | "medium" | "thick";
146
+ };
147
+ direction: "columns" | "rows" | "grid";
148
+ padding: "none" | "base" | "extraTight" | "tight" | "loose" | "extraLoose";
149
+ sectionId: string;
150
+ sections: never[] | import("..").CABSection[];
151
+ sectionType: "layout";
152
+ spacing: "none" | "base" | "extraTight" | "tight" | "loose" | "extraLoose";
153
+ width: number;
154
+ editorMode: "checkoutExtension" | "postPurchaseOffer" | "thankYouPage" | "orderStatusPage" | "ordersIndexPage" | "customerProfilePage";
155
+ previewMode: boolean;
156
+ storeId: number | null;
157
+ targetArea: {
158
+ icon: string;
159
+ label: string;
160
+ width: string;
161
+ fill?: boolean | undefined;
162
+ flip?: "vertical" | "horizontal" | "both" | undefined;
163
+ } | null;
164
+ tracking: {
165
+ enableAttribution: boolean;
166
+ enableSource: boolean;
167
+ enableWidget: boolean;
168
+ };
169
+ 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";
170
+ uiLabels: {
171
+ currentPage: Record<string, string>;
172
+ guest: Record<string, string>;
173
+ loadingOptions: Record<string, string>;
174
+ nextPage: Record<string, string>;
175
+ offerCarousel: Record<string, string>;
176
+ offerDialog: Record<string, string>;
177
+ page: Record<string, string>;
178
+ previousPage: Record<string, string>;
179
+ selected: Record<string, string>;
180
+ subscriptionOptions: Record<string, string>;
181
+ updating: Record<string, string>;
182
+ };
183
+ version: 2;
184
+ widgetId: number | null;
185
+ 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;
186
+ frame?: "callout" | "offer-content" | undefined;
187
+ grid?: {
188
+ columns: (string | number)[];
189
+ rows: (string | number)[];
190
+ } | undefined;
191
+ name?: string | undefined;
192
+ viewUrl?: string | undefined;
193
+ wrapping?: {
194
+ breakAt: number;
195
+ maxPerLine: number;
196
+ } | undefined;
197
+ mutators?: {
198
+ effect: "set_false" | "set_true" | "toggle";
199
+ variable: string;
200
+ when: {
201
+ operator: "is_empty" | "is_not_empty";
202
+ type: "content";
203
+ } | {
204
+ operator: "equals" | "greater_than" | "less_than";
205
+ type: "result_count";
206
+ value: number;
207
+ } | {
208
+ operator: "contains" | "does_not_contain";
209
+ type: "result_tag";
210
+ value: string;
211
+ } | {
212
+ event: "item_added" | "quantity_changed" | "variant_selected";
213
+ type: "event";
214
+ };
215
+ }[] | undefined;
216
+ variables?: ({
217
+ defaultValue: string;
218
+ name: string;
219
+ type: "text";
220
+ seed?: undefined;
221
+ } | {
222
+ defaultValue: number;
223
+ name: string;
224
+ type: "number";
225
+ seed?: undefined;
226
+ } | {
227
+ defaultValue: boolean;
228
+ name: string;
229
+ type: "boolean";
230
+ seed?: {
231
+ dataSourceId: number | null;
232
+ ruleset: {
233
+ exitIfMatched: boolean;
234
+ logic: {
235
+ rules: {
236
+ operator: "equals" | "greater_than" | "less_than" | "contains" | "does_not_contain" | "after" | "anything" | "before" | "contains_any" | "does_not_contain_any" | "does_not_equal";
237
+ products: never[] | unknown[];
238
+ 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";
239
+ value: string;
240
+ }[];
241
+ }[];
242
+ output: {
243
+ key: string;
244
+ type: "data_json";
245
+ value: string;
246
+ }[];
247
+ }[];
248
+ } | undefined;
249
+ })[] | undefined;
250
+ visibility?: {
251
+ variable: string;
252
+ visibleWhen: boolean;
253
+ } | undefined;
254
+ experiment?: {
255
+ elementId: number;
256
+ experimentId: number;
257
+ experimentType: string;
258
+ selectedId: number;
259
+ } | undefined;
260
+ };
261
+ groupCatalog?: {
262
+ memberProductId: number;
263
+ options: {
264
+ productId: number;
265
+ title: string;
266
+ variantCatalog: {
267
+ displayMode: "single" | "separate";
268
+ options: {
269
+ name: string;
270
+ values: string[];
271
+ id: number;
272
+ position: number;
273
+ }[];
274
+ productId: number;
275
+ showSelectors: boolean;
276
+ variants: {
277
+ available: boolean;
278
+ id: number;
279
+ title: string;
280
+ option1?: string | undefined;
281
+ option2?: string | null | undefined;
282
+ option3?: string | null | undefined;
283
+ imageId?: number | null | undefined;
284
+ }[];
285
+ };
286
+ }[];
287
+ } | undefined;
288
+ initialVariant?: {
289
+ variantId: number;
290
+ } | undefined;
291
+ planCatalog?: {
292
+ plans: {
293
+ id: number;
294
+ intervalLabel: string;
295
+ name: string;
296
+ adjustment?: {
297
+ amount: number;
298
+ type: "price" | "fixed_amount" | "percentage";
299
+ } | undefined;
300
+ intervalFrequency?: string | undefined;
301
+ }[];
302
+ productId: number;
303
+ requiresSellingPlan: boolean;
304
+ variantId: number;
305
+ } | null | undefined;
306
+ purchaseOptions?: {
307
+ defaultChoice: {
308
+ mode: "one-time";
309
+ } | {
310
+ mode: "subscription";
311
+ sellingPlanId: number;
312
+ };
313
+ modes: ("one-time" | "subscription")[];
314
+ selector: "radio" | "dropdown";
315
+ } | undefined;
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
+ } | undefined;
336
+ } | {
337
+ preparation: {
338
+ reason: string;
339
+ status: "unsupported";
340
+ };
341
+ sections: null;
342
+ groupCatalog?: {
343
+ memberProductId: number;
344
+ options: {
345
+ productId: number;
346
+ title: string;
347
+ variantCatalog: {
348
+ displayMode: "single" | "separate";
349
+ options: {
350
+ name: string;
351
+ values: string[];
352
+ id: number;
353
+ position: number;
354
+ }[];
355
+ productId: number;
356
+ showSelectors: boolean;
357
+ variants: {
358
+ available: boolean;
359
+ id: number;
360
+ title: string;
361
+ option1?: string | undefined;
362
+ option2?: string | null | undefined;
363
+ option3?: string | null | undefined;
364
+ imageId?: number | null | undefined;
365
+ }[];
366
+ };
367
+ }[];
368
+ } | undefined;
369
+ initialVariant?: {
370
+ variantId: number;
371
+ } | undefined;
372
+ planCatalog?: {
373
+ plans: {
374
+ id: number;
375
+ intervalLabel: string;
376
+ name: string;
377
+ adjustment?: {
378
+ amount: number;
379
+ type: "price" | "fixed_amount" | "percentage";
380
+ } | undefined;
381
+ intervalFrequency?: string | undefined;
382
+ }[];
383
+ productId: number;
384
+ requiresSellingPlan: boolean;
385
+ variantId: number;
386
+ } | null | undefined;
387
+ purchaseOptions?: {
388
+ defaultChoice: {
389
+ mode: "one-time";
390
+ } | {
391
+ mode: "subscription";
392
+ sellingPlanId: number;
393
+ };
394
+ modes: ("one-time" | "subscription")[];
395
+ selector: "radio" | "dropdown";
396
+ } | undefined;
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
+ } | undefined;
417
+ };
418
+ };