@rebuy/rebuy 3.29.0 → 3.30.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 (47) hide show
  1. package/dist/index.cjs +1543 -1346
  2. package/dist/index.mjs +1537 -1340
  3. package/dist/schema/index.d.ts +7 -0
  4. package/dist/schema/postPurchaseProductCollectionView.d.ts +8 -0
  5. package/dist/schema/postPurchaseProductDisplay.d.ts +59 -0
  6. package/dist/schema/postPurchaseProductGallery.d.ts +11 -0
  7. package/dist/schema/postPurchaseProductSettings.d.ts +117 -0
  8. package/dist/schema/postPurchaseProductSource.d.ts +65 -0
  9. package/dist/schema/postPurchaseVariantCatalog.d.ts +41 -0
  10. package/dist/schema/postPurchaseVariantDefault.d.ts +36 -0
  11. package/dist/schema/shopConfig.d.ts +2 -2
  12. package/dist/schema/userConfig.d.ts +2 -2
  13. package/dist/schema/widgetData.d.ts +2 -2
  14. package/dist/schema/widgets/checkout-and-beyond/banner.d.ts +29 -29
  15. package/dist/schema/widgets/checkout-and-beyond/carousel.d.ts +29 -29
  16. package/dist/schema/widgets/checkout-and-beyond/cartLine.d.ts +29 -29
  17. package/dist/schema/widgets/checkout-and-beyond/common.d.ts +5 -5
  18. package/dist/schema/widgets/checkout-and-beyond/offers.d.ts +29 -29
  19. package/dist/schema/widgets/checkout-and-beyond/progressBar.d.ts +29 -29
  20. package/dist/schema/widgets/checkout-and-beyond/root.d.ts +1 -1
  21. package/dist/schema/widgets/contentBlock.d.ts +4 -4
  22. package/dist/schema/widgets/post-purchase-offer/constants.d.ts +4 -4
  23. package/dist/schema/widgets/post-purchase-offer/postPurchaseBlocks.d.ts +2 -2
  24. package/dist/schema/widgets/post-purchase-offer/postPurchaseOffer.d.ts +2 -2
  25. package/dist/schema/widgets/post-purchase-offer/postPurchaseSettings.d.ts +2 -2
  26. package/dist/schema/widgets/post-purchase-offer/postPurchaseWidget.d.ts +2 -2
  27. package/dist/server/__fixtures__/postPurchaseProduct.d.ts +137 -0
  28. package/dist/server/__fixtures__/postPurchaseVariantDefaults.d.ts +26 -0
  29. package/dist/server/__fixtures__/postPurchaseVariants.d.ts +47 -0
  30. package/dist/server/index.cjs +6 -2
  31. package/dist/server/index.mjs +6 -2
  32. package/dist/server/matchPostPurchaseVariantDefault.d.ts +17 -0
  33. package/dist/server/normalizePostPurchaseCollection.d.ts +250 -0
  34. package/dist/server/normalizePostPurchaseProduct.d.ts +202 -0
  35. package/dist/server/postPurchasePrimaryImage.d.ts +6 -0
  36. package/dist/server/postPurchaseProductDisplay.d.ts +41 -0
  37. package/dist/server/postPurchaseProductEligibility.d.ts +8 -0
  38. package/dist/server/postPurchaseProductGallery.d.ts +5 -0
  39. package/dist/server/postPurchaseVariantAvailable.d.ts +12 -0
  40. package/dist/server/postPurchaseVariantCatalog.d.ts +3 -0
  41. package/dist/server/projectPostPurchaseProduct.d.ts +127 -0
  42. package/dist/server/resolvePostPurchaseVariantDefault.d.ts +10 -0
  43. package/dist/transforms/index.cjs +7 -3
  44. package/dist/transforms/index.mjs +7 -3
  45. package/dist/transforms/offerV1/offerTemplateSeed.d.ts +8 -5
  46. package/dist/transforms/postPurchase/imageContentSettings.d.ts +1 -1
  47. package/package.json +1 -1
@@ -145,7 +145,6 @@ export type HorizontalAlignment = (typeof horizontalAlignments)[number];
145
145
  export declare const languageKeys: readonly ["ar", "cs", "da", "de", "en", "es", "fi", "fr", "ga", "he", "hi", "id", "it", "ja", "ko", "nl", "no", "pl", "pt", "ru", "sv", "th", "tr", "uk", "vi", "zh"];
146
146
  export declare const LanguageKey: {
147
147
  readonly id: "id";
148
- readonly no: "no";
149
148
  readonly ar: "ar";
150
149
  readonly cs: "cs";
151
150
  readonly da: "da";
@@ -161,6 +160,7 @@ export declare const LanguageKey: {
161
160
  readonly ja: "ja";
162
161
  readonly ko: "ko";
163
162
  readonly nl: "nl";
163
+ readonly no: "no";
164
164
  readonly pl: "pl";
165
165
  readonly pt: "pt";
166
166
  readonly ru: "ru";
@@ -274,9 +274,11 @@ export declare const SectionType: {
274
274
  readonly variants: "variants";
275
275
  readonly image: "image";
276
276
  readonly discount: "discount";
277
- readonly carousel: "carousel";
277
+ readonly separator: "separator";
278
+ readonly text: "text";
278
279
  readonly banner: "banner";
279
280
  readonly button: "button";
281
+ readonly carousel: "carousel";
280
282
  readonly cartLine: "cartLine";
281
283
  readonly dataSource: "dataSource";
282
284
  readonly layout: "layout";
@@ -284,8 +286,6 @@ export declare const SectionType: {
284
286
  readonly progressBar: "progressBar";
285
287
  readonly quantity: "quantity";
286
288
  readonly reviews: "reviews";
287
- readonly separator: "separator";
288
- readonly text: "text";
289
289
  };
290
290
  export type SectionType = (typeof sectionTypes)[number];
291
291
  export declare const spacings: readonly ["none", "extraTight", "tight", "base", "loose", "extraLoose"];
@@ -393,12 +393,12 @@ export type VerticalAlignment = (typeof verticalAlignments)[number];
393
393
  export declare const widgetTypes: readonly ["bundle_builder", "cart", "cart_subscription", "dynamic_bundle", "gift_with_purchase", "placeholder", "pre_purchase", "product", "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"];
394
394
  export declare const WidgetType: {
395
395
  readonly product: "product";
396
- readonly placeholder: "placeholder";
397
396
  readonly bundle_builder: "bundle_builder";
398
397
  readonly cart: "cart";
399
398
  readonly cart_subscription: "cart_subscription";
400
399
  readonly dynamic_bundle: "dynamic_bundle";
401
400
  readonly gift_with_purchase: "gift_with_purchase";
401
+ readonly placeholder: "placeholder";
402
402
  readonly pre_purchase: "pre_purchase";
403
403
  readonly product_addon: "product_addon";
404
404
  readonly product_upsell: "product_upsell";
@@ -9,6 +9,18 @@ export declare const CABOffersSection: z.ZodLazy<z.ZodObject<{
9
9
  columns: z.ZodDefault<z.ZodUnion<readonly [z.ZodArray<z.ZodUnion<readonly [z.ZodLiteral<"auto">, z.ZodLiteral<"fill">, z.ZodString, z.ZodNumber]>>, z.ZodUndefined]>>;
10
10
  rows: z.ZodDefault<z.ZodUnion<readonly [z.ZodArray<z.ZodUnion<readonly [z.ZodLiteral<"auto">, z.ZodLiteral<"fill">, z.ZodString, z.ZodNumber]>>, z.ZodUndefined]>>;
11
11
  }, z.core.$strip>>>;
12
+ alignment: z.ZodDefault<z.ZodObject<{
13
+ horizontal: z.ZodDefault<z.ZodEnum<{
14
+ start: "start";
15
+ center: "center";
16
+ end: "end";
17
+ }>>;
18
+ vertical: z.ZodDefault<z.ZodEnum<{
19
+ top: "top";
20
+ middle: "middle";
21
+ bottom: "bottom";
22
+ }>>;
23
+ }, z.core.$strip>>;
12
24
  border: z.ZodLazy<z.ZodDefault<z.ZodObject<{
13
25
  radius: z.ZodDefault<z.ZodEnum<{
14
26
  small: "small";
@@ -54,6 +66,23 @@ export declare const CABOffersSection: z.ZodLazy<z.ZodObject<{
54
66
  switchToSubscriptionNoDiscount: "switchToSubscriptionNoDiscount";
55
67
  switchToSubscriptionWithDiscount: "switchToSubscriptionWithDiscount";
56
68
  }>>;
69
+ direction: z.ZodDefault<z.ZodEnum<{
70
+ columns: "columns";
71
+ rows: "rows";
72
+ grid: "grid";
73
+ }>>;
74
+ frame: z.ZodOptional<z.ZodEnum<{
75
+ callout: "callout";
76
+ "offer-content": "offer-content";
77
+ }>>;
78
+ padding: z.ZodDefault<z.ZodEnum<{
79
+ none: "none";
80
+ base: "base";
81
+ extraTight: "extraTight";
82
+ tight: "tight";
83
+ loose: "loose";
84
+ extraLoose: "extraLoose";
85
+ }>>;
57
86
  mutators: z.ZodOptional<z.ZodArray<z.ZodObject<{
58
87
  effect: z.ZodDefault<z.ZodEnum<{
59
88
  set_false: "set_false";
@@ -239,35 +268,6 @@ export declare const CABOffersSection: z.ZodLazy<z.ZodObject<{
239
268
  variable: z.ZodString;
240
269
  visibleWhen: z.ZodDefault<z.ZodBoolean>;
241
270
  }, z.core.$strip>>;
242
- alignment: z.ZodDefault<z.ZodObject<{
243
- horizontal: z.ZodDefault<z.ZodEnum<{
244
- start: "start";
245
- center: "center";
246
- end: "end";
247
- }>>;
248
- vertical: z.ZodDefault<z.ZodEnum<{
249
- top: "top";
250
- middle: "middle";
251
- bottom: "bottom";
252
- }>>;
253
- }, z.core.$strip>>;
254
- direction: z.ZodDefault<z.ZodEnum<{
255
- columns: "columns";
256
- rows: "rows";
257
- grid: "grid";
258
- }>>;
259
- frame: z.ZodOptional<z.ZodEnum<{
260
- callout: "callout";
261
- "offer-content": "offer-content";
262
- }>>;
263
- padding: z.ZodDefault<z.ZodEnum<{
264
- none: "none";
265
- base: "base";
266
- extraTight: "extraTight";
267
- tight: "tight";
268
- loose: "loose";
269
- extraLoose: "extraLoose";
270
- }>>;
271
271
  spacing: z.ZodDefault<z.ZodEnum<{
272
272
  none: "none";
273
273
  base: "base";
@@ -74,6 +74,18 @@ export declare const CABProgressBarSection: z.ZodLazy<z.ZodObject<{
74
74
  columns: z.ZodDefault<z.ZodUnion<readonly [z.ZodArray<z.ZodUnion<readonly [z.ZodLiteral<"auto">, z.ZodLiteral<"fill">, z.ZodString, z.ZodNumber]>>, z.ZodUndefined]>>;
75
75
  rows: z.ZodDefault<z.ZodUnion<readonly [z.ZodArray<z.ZodUnion<readonly [z.ZodLiteral<"auto">, z.ZodLiteral<"fill">, z.ZodString, z.ZodNumber]>>, z.ZodUndefined]>>;
76
76
  }, z.core.$strip>>>;
77
+ alignment: z.ZodDefault<z.ZodObject<{
78
+ horizontal: z.ZodDefault<z.ZodEnum<{
79
+ start: "start";
80
+ center: "center";
81
+ end: "end";
82
+ }>>;
83
+ vertical: z.ZodDefault<z.ZodEnum<{
84
+ top: "top";
85
+ middle: "middle";
86
+ bottom: "bottom";
87
+ }>>;
88
+ }, z.core.$strip>>;
77
89
  border: z.ZodLazy<z.ZodDefault<z.ZodObject<{
78
90
  radius: z.ZodDefault<z.ZodEnum<{
79
91
  small: "small";
@@ -119,6 +131,23 @@ export declare const CABProgressBarSection: z.ZodLazy<z.ZodObject<{
119
131
  switchToSubscriptionNoDiscount: "switchToSubscriptionNoDiscount";
120
132
  switchToSubscriptionWithDiscount: "switchToSubscriptionWithDiscount";
121
133
  }>>;
134
+ direction: z.ZodDefault<z.ZodEnum<{
135
+ columns: "columns";
136
+ rows: "rows";
137
+ grid: "grid";
138
+ }>>;
139
+ frame: z.ZodOptional<z.ZodEnum<{
140
+ callout: "callout";
141
+ "offer-content": "offer-content";
142
+ }>>;
143
+ padding: z.ZodDefault<z.ZodEnum<{
144
+ none: "none";
145
+ base: "base";
146
+ extraTight: "extraTight";
147
+ tight: "tight";
148
+ loose: "loose";
149
+ extraLoose: "extraLoose";
150
+ }>>;
122
151
  mutators: z.ZodOptional<z.ZodArray<z.ZodObject<{
123
152
  effect: z.ZodDefault<z.ZodEnum<{
124
153
  set_false: "set_false";
@@ -304,35 +333,6 @@ export declare const CABProgressBarSection: z.ZodLazy<z.ZodObject<{
304
333
  variable: z.ZodString;
305
334
  visibleWhen: z.ZodDefault<z.ZodBoolean>;
306
335
  }, z.core.$strip>>;
307
- alignment: z.ZodDefault<z.ZodObject<{
308
- horizontal: z.ZodDefault<z.ZodEnum<{
309
- start: "start";
310
- center: "center";
311
- end: "end";
312
- }>>;
313
- vertical: z.ZodDefault<z.ZodEnum<{
314
- top: "top";
315
- middle: "middle";
316
- bottom: "bottom";
317
- }>>;
318
- }, z.core.$strip>>;
319
- direction: z.ZodDefault<z.ZodEnum<{
320
- columns: "columns";
321
- rows: "rows";
322
- grid: "grid";
323
- }>>;
324
- frame: z.ZodOptional<z.ZodEnum<{
325
- callout: "callout";
326
- "offer-content": "offer-content";
327
- }>>;
328
- padding: z.ZodDefault<z.ZodEnum<{
329
- none: "none";
330
- base: "base";
331
- extraTight: "extraTight";
332
- tight: "tight";
333
- loose: "loose";
334
- extraLoose: "extraLoose";
335
- }>>;
336
336
  sections: z.ZodDefault<z.ZodUnion<readonly [z.ZodArray<z.ZodLazy<z.ZodType<import("./shared").CABSection, unknown, z.core.$ZodTypeInternals<import("./shared").CABSection, unknown>>>>, z.ZodPipe<z.ZodObject<{}, z.core.$strict>, z.ZodTransform<never[], Record<string, never>>>]>>;
337
337
  spacing: z.ZodDefault<z.ZodEnum<{
338
338
  none: "none";
@@ -393,12 +393,12 @@ export declare const CABRootSection: z.ZodObject<{
393
393
  } | null | undefined>>;
394
394
  type: z.ZodDefault<z.ZodEnum<{
395
395
  product: "product";
396
- placeholder: "placeholder";
397
396
  bundle_builder: "bundle_builder";
398
397
  cart: "cart";
399
398
  cart_subscription: "cart_subscription";
400
399
  dynamic_bundle: "dynamic_bundle";
401
400
  gift_with_purchase: "gift_with_purchase";
401
+ placeholder: "placeholder";
402
402
  pre_purchase: "pre_purchase";
403
403
  product_addon: "product_addon";
404
404
  product_upsell: "product_upsell";
@@ -15,15 +15,15 @@ export declare const ContentBlockV1: z.ZodObject<{
15
15
  imagePlacement: z.ZodEnum<{
16
16
  top: "top";
17
17
  bottom: "bottom";
18
- right: "right";
19
18
  left: "left";
19
+ right: "right";
20
20
  }>;
21
21
  imageSize: z.ZodNumber;
22
22
  imageUrl: z.ZodURL;
23
23
  textAlignment: z.ZodEnum<{
24
24
  center: "center";
25
- right: "right";
26
25
  left: "left";
26
+ right: "right";
27
27
  }>;
28
28
  textSize: z.ZodEnum<{
29
29
  small: "small";
@@ -63,15 +63,15 @@ export declare const ContentBlock: z.ZodDiscriminatedUnion<[z.ZodObject<{
63
63
  imagePlacement: z.ZodEnum<{
64
64
  top: "top";
65
65
  bottom: "bottom";
66
- right: "right";
67
66
  left: "left";
67
+ right: "right";
68
68
  }>;
69
69
  imageSize: z.ZodNumber;
70
70
  imageUrl: z.ZodURL;
71
71
  textAlignment: z.ZodEnum<{
72
72
  center: "center";
73
- right: "right";
74
73
  left: "left";
74
+ right: "right";
75
75
  }>;
76
76
  textSize: z.ZodEnum<{
77
77
  small: "small";
@@ -2,22 +2,22 @@ import { z } from 'zod';
2
2
  export declare const blockTypes: readonly ["callout_banner", "image", "image_content", "pay_button", "product_information", "separator", "text", "timer"];
3
3
  declare const blockType: z.ZodEnum<{
4
4
  image: "image";
5
- separator: "separator";
6
- text: "text";
7
5
  callout_banner: "callout_banner";
8
6
  image_content: "image_content";
9
7
  pay_button: "pay_button";
10
8
  product_information: "product_information";
9
+ separator: "separator";
10
+ text: "text";
11
11
  timer: "timer";
12
12
  }>;
13
13
  export declare const BlockType: {
14
14
  image: "image";
15
- separator: "separator";
16
- text: "text";
17
15
  callout_banner: "callout_banner";
18
16
  image_content: "image_content";
19
17
  pay_button: "pay_button";
20
18
  product_information: "product_information";
19
+ separator: "separator";
20
+ text: "text";
21
21
  timer: "timer";
22
22
  };
23
23
  export type BlockType = z.infer<typeof blockType>;
@@ -183,8 +183,8 @@ export declare const ImageContentBlock: z.ZodObject<{
183
183
  imagePlacement: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
184
184
  top: "top";
185
185
  bottom: "bottom";
186
- right: "right";
187
186
  left: "left";
187
+ right: "right";
188
188
  }>>>;
189
189
  imageSize: z.ZodDefault<z.ZodNumber>;
190
190
  superTitle: z.ZodDefault<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
@@ -726,8 +726,8 @@ export declare const PostPurchaseBlock: z.ZodDiscriminatedUnion<[z.ZodObject<{
726
726
  imagePlacement: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
727
727
  top: "top";
728
728
  bottom: "bottom";
729
- right: "right";
730
729
  left: "left";
730
+ right: "right";
731
731
  }>>>;
732
732
  imageSize: z.ZodDefault<z.ZodNumber>;
733
733
  superTitle: z.ZodDefault<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
@@ -204,8 +204,8 @@ export declare const PostPurchaseOffer: z.ZodDiscriminatedUnion<[z.ZodObject<{
204
204
  imagePlacement: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
205
205
  top: "top";
206
206
  bottom: "bottom";
207
- right: "right";
208
207
  left: "left";
208
+ right: "right";
209
209
  }>>>;
210
210
  imageSize: z.ZodDefault<z.ZodNumber>;
211
211
  superTitle: z.ZodDefault<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
@@ -627,8 +627,8 @@ export declare const PostPurchaseOffer: z.ZodDiscriminatedUnion<[z.ZodObject<{
627
627
  offersLayout: z.ZodDefault<z.ZodOptional<z.ZodObject<{
628
628
  itemsPerPage: z.ZodOptional<z.ZodNumber>;
629
629
  type: z.ZodDefault<z.ZodEnum<{
630
- carousel: "carousel";
631
630
  grid: "grid";
631
+ carousel: "carousel";
632
632
  list: "list";
633
633
  }>>;
634
634
  }, z.core.$strip>>>;
@@ -183,8 +183,8 @@ export declare const PostPurchaseSettings: z.ZodObject<{
183
183
  imagePlacement: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
184
184
  top: "top";
185
185
  bottom: "bottom";
186
- right: "right";
187
186
  left: "left";
187
+ right: "right";
188
188
  }>>>;
189
189
  imageSize: z.ZodDefault<z.ZodNumber>;
190
190
  superTitle: z.ZodDefault<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
@@ -606,8 +606,8 @@ export declare const PostPurchaseSettings: z.ZodObject<{
606
606
  offersLayout: z.ZodDefault<z.ZodOptional<z.ZodObject<{
607
607
  itemsPerPage: z.ZodOptional<z.ZodNumber>;
608
608
  type: z.ZodDefault<z.ZodEnum<{
609
- carousel: "carousel";
610
609
  grid: "grid";
610
+ carousel: "carousel";
611
611
  list: "list";
612
612
  }>>;
613
613
  }, z.core.$strip>>>;
@@ -201,8 +201,8 @@ export declare const PostPurchaseWidget: z.ZodObject<{
201
201
  imagePlacement: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
202
202
  top: "top";
203
203
  bottom: "bottom";
204
- right: "right";
205
204
  left: "left";
205
+ right: "right";
206
206
  }>>>;
207
207
  imageSize: z.ZodDefault<z.ZodNumber>;
208
208
  superTitle: z.ZodDefault<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
@@ -624,8 +624,8 @@ export declare const PostPurchaseWidget: z.ZodObject<{
624
624
  offersLayout: z.ZodDefault<z.ZodOptional<z.ZodObject<{
625
625
  itemsPerPage: z.ZodOptional<z.ZodNumber>;
626
626
  type: z.ZodDefault<z.ZodEnum<{
627
- carousel: "carousel";
628
627
  grid: "grid";
628
+ carousel: "carousel";
629
629
  list: "list";
630
630
  }>>;
631
631
  }, z.core.$strip>>>;
@@ -0,0 +1,137 @@
1
+ /** Sanitized legacy settings/data-source payloads, shared across this Slice's tests. */
2
+ export declare const fixedProductSettings: {
3
+ blocks: {
4
+ type: string;
5
+ }[];
6
+ discount: {
7
+ amount: string;
8
+ type: string;
9
+ };
10
+ endpoint: string;
11
+ integrations: {};
12
+ key: string;
13
+ language: {};
14
+ product_limit: number;
15
+ product_options: {};
16
+ product_type: string;
17
+ quantity_inputs: {
18
+ default_quantity: number;
19
+ enabled: boolean;
20
+ };
21
+ shipping: {
22
+ amount: string;
23
+ title: string;
24
+ type: string;
25
+ };
26
+ };
27
+ export declare const fixedProductResponse: {
28
+ data: {
29
+ description: string;
30
+ id: number;
31
+ image: {
32
+ src: string;
33
+ };
34
+ title: string;
35
+ variants: {
36
+ compare_at_price: string;
37
+ id: number;
38
+ inventory_management: string;
39
+ inventory_policy: string;
40
+ inventory_quantity: number;
41
+ price: string;
42
+ product_id: number;
43
+ title: string;
44
+ }[];
45
+ }[];
46
+ metadata: {};
47
+ };
48
+ /** Conflicting original/response values prove that the display consumes effective configuration. */
49
+ export declare const fixedDisplaySettings: {
50
+ discounted_from: string;
51
+ language: {
52
+ description: string;
53
+ description_enabled: boolean;
54
+ description_rte: {
55
+ content: {
56
+ content: {
57
+ text: string;
58
+ type: string;
59
+ }[];
60
+ type: string;
61
+ }[];
62
+ type: string;
63
+ };
64
+ description_spacing: string;
65
+ };
66
+ product_options: {
67
+ show_shipping: boolean;
68
+ show_subtotal: boolean;
69
+ show_taxes: boolean;
70
+ show_total: boolean;
71
+ show_variant_selectors: boolean;
72
+ };
73
+ blocks: {
74
+ type: string;
75
+ }[];
76
+ discount: {
77
+ amount: string;
78
+ type: string;
79
+ };
80
+ endpoint: string;
81
+ integrations: {};
82
+ key: string;
83
+ product_limit: number;
84
+ product_type: string;
85
+ quantity_inputs: {
86
+ default_quantity: number;
87
+ enabled: boolean;
88
+ };
89
+ shipping: {
90
+ amount: string;
91
+ title: string;
92
+ type: string;
93
+ };
94
+ };
95
+ export declare const fixedDisplayResponse: {
96
+ data: {
97
+ images: {
98
+ id: number;
99
+ src: string;
100
+ }[];
101
+ variants: {
102
+ image_id: number;
103
+ compare_at_price: string;
104
+ id: number;
105
+ inventory_management: string;
106
+ inventory_policy: string;
107
+ inventory_quantity: number;
108
+ price: string;
109
+ product_id: number;
110
+ title: string;
111
+ }[];
112
+ description: string;
113
+ id: number;
114
+ image: {
115
+ src: string;
116
+ };
117
+ title: string;
118
+ }[];
119
+ metadata: {
120
+ widget: {
121
+ discount: {
122
+ amount: string;
123
+ should_show_saving_text: boolean;
124
+ type: string;
125
+ };
126
+ discounted_from: string;
127
+ language: {
128
+ description: string;
129
+ description_spacing: string;
130
+ };
131
+ product_options: {
132
+ show_shipping: boolean;
133
+ show_taxes: boolean;
134
+ };
135
+ };
136
+ };
137
+ };
@@ -0,0 +1,26 @@
1
+ /** `recommendedVariantIds` is not part of the schema (decision 15) — see that schema file's comment. */
2
+ export declare const variantDefaults: () => {
3
+ id: number;
4
+ options: {
5
+ values: string[];
6
+ name: string;
7
+ }[];
8
+ variants: {
9
+ id: number;
10
+ inventoryManagement: string | null;
11
+ inventoryPolicy: string;
12
+ inventoryQuantity: number;
13
+ option2?: string | null | undefined;
14
+ option3?: string | null | undefined;
15
+ option1?: string | null | undefined;
16
+ }[];
17
+ selectedVariant?: {
18
+ id: number;
19
+ inventoryManagement: string | null;
20
+ inventoryPolicy: string;
21
+ inventoryQuantity: number;
22
+ option2?: string | null | undefined;
23
+ option3?: string | null | undefined;
24
+ option1?: string | null | undefined;
25
+ } | undefined;
26
+ };
@@ -0,0 +1,47 @@
1
+ export declare const variantResponse: {
2
+ data: {
3
+ images: {
4
+ id: number;
5
+ src: string;
6
+ }[];
7
+ options: {
8
+ id: number;
9
+ name: string;
10
+ position: number;
11
+ values: string[];
12
+ }[];
13
+ variants: ({
14
+ option1: string;
15
+ option2: null;
16
+ option3: null;
17
+ compare_at_price: string;
18
+ id: number;
19
+ inventory_management: string;
20
+ inventory_policy: string;
21
+ inventory_quantity: number;
22
+ price: string;
23
+ product_id: number;
24
+ title: string;
25
+ } | {
26
+ id: number;
27
+ image_id: number;
28
+ option1: string;
29
+ option2: null;
30
+ option3: null;
31
+ price: string;
32
+ title: string;
33
+ compare_at_price: string;
34
+ inventory_management: string;
35
+ inventory_policy: string;
36
+ inventory_quantity: number;
37
+ product_id: number;
38
+ })[];
39
+ description: string;
40
+ id: number;
41
+ image: {
42
+ src: string;
43
+ };
44
+ title: string;
45
+ }[];
46
+ metadata: {};
47
+ };
@@ -3224,9 +3224,13 @@ var buildPriceContent = () => ({
3224
3224
  content: [
3225
3225
  {
3226
3226
  content: [
3227
- /** Legacy renders the price in the checkout's brand color (`<Text appearance="accent">`). */
3227
+ /**
3228
+ * Regular text color, not legacy's `<Text appearance="accent">`: the checkout's web components
3229
+ * can't render app text in the accent color, and `accent`'s nearest tint shows default blue on
3230
+ * most stores (REB-24049).
3231
+ */
3228
3232
  {
3229
- marks: [{ attrs: { color: "accent", fontSize: "base" }, type: "textStyle" }],
3233
+ marks: [{ attrs: { color: "base", fontSize: "base" }, type: "textStyle" }],
3230
3234
  text: "{{variantPrice}}",
3231
3235
  type: "text"
3232
3236
  },
@@ -3173,9 +3173,13 @@ var buildPriceContent = () => ({
3173
3173
  content: [
3174
3174
  {
3175
3175
  content: [
3176
- /** Legacy renders the price in the checkout's brand color (`<Text appearance="accent">`). */
3176
+ /**
3177
+ * Regular text color, not legacy's `<Text appearance="accent">`: the checkout's web components
3178
+ * can't render app text in the accent color, and `accent`'s nearest tint shows default blue on
3179
+ * most stores (REB-24049).
3180
+ */
3177
3181
  {
3178
- marks: [{ attrs: { color: "accent", fontSize: "base" }, type: "textStyle" }],
3182
+ marks: [{ attrs: { color: "base", fontSize: "base" }, type: "textStyle" }],
3179
3183
  text: "{{variantPrice}}",
3180
3184
  type: "text"
3181
3185
  },
@@ -0,0 +1,17 @@
1
+ import type { z } from 'zod';
2
+ import type { PostPurchaseOrderAttributes, PostPurchaseVariantDefaultProduct } from '../schema/postPurchaseVariantDefault';
3
+ /**
4
+ * Legacy rank starts at one; empty positions count and ties preserve source order (L79/L80). The stock
5
+ * filter is legacy `variantMatching`'s `isVariantAvailable`, carried as-is: it ignores
6
+ * `inventoryManagement`, so an unmanaged `deny` variant at zero quantity is skipped here even though
7
+ * `postPurchaseVariantAvailable` treats it as available.
8
+ */
9
+ export declare const matchPostPurchaseVariantDefault: (product: z.infer<typeof PostPurchaseVariantDefaultProduct>, attributes: z.infer<typeof PostPurchaseOrderAttributes>, filterOutOfStock: boolean) => {
10
+ id: number;
11
+ inventoryManagement: string | null;
12
+ inventoryPolicy: string;
13
+ inventoryQuantity: number;
14
+ option2?: string | null | undefined;
15
+ option3?: string | null | undefined;
16
+ option1?: string | null | undefined;
17
+ } | undefined;