@rebuy/rebuy 3.34.0 → 3.35.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 (30) hide show
  1. package/dist/index.cjs +878 -794
  2. package/dist/index.mjs +879 -795
  3. package/dist/schema/index.d.ts +5 -0
  4. package/dist/schema/postPurchaseGroupCatalog.d.ts +56 -0
  5. package/dist/schema/postPurchaseOfferEligibility.d.ts +32 -0
  6. package/dist/schema/postPurchaseOfferPresentation.d.ts +386 -0
  7. package/dist/schema/postPurchaseProductSource.d.ts +10 -5
  8. package/dist/schema/postPurchaseQuantity.d.ts +13 -0
  9. package/dist/schema/postPurchaseVariantDefault.d.ts +17 -0
  10. package/dist/schema/postPurchaseVariantDefaultContext.d.ts +10 -0
  11. package/dist/server/__fixtures__/postPurchaseGroup.d.ts +75 -0
  12. package/dist/server/classifyPostPurchaseOffer.d.ts +3 -0
  13. package/dist/server/createPostPurchaseOrderAttributes.d.ts +9 -0
  14. package/dist/server/index.cjs +605 -192
  15. package/dist/server/index.d.ts +8 -1
  16. package/dist/server/index.mjs +605 -192
  17. package/dist/server/postPurchaseMemberEligibility.d.ts +7 -0
  18. package/dist/server/postPurchaseOfferCopy.d.ts +3 -0
  19. package/dist/server/postPurchaseProductEligibility.d.ts +3 -7
  20. package/dist/server/postPurchaseSubscriptionEligibility.d.ts +2 -3
  21. package/dist/server/prepareNormalizedSubscription.d.ts +2 -3
  22. package/dist/server/preparePostPurchaseGroupDeclineDisplay.d.ts +12 -0
  23. package/dist/server/preparePostPurchaseOfferPresentation.d.ts +137 -0
  24. package/dist/server/projectPostPurchaseProduct.d.ts +5 -7
  25. package/dist/server/readPostPurchaseGroup.d.ts +101 -0
  26. package/dist/server/readPostPurchaseGroupSelection.d.ts +110 -0
  27. package/dist/server/readPostPurchaseQuantity.d.ts +27 -0
  28. package/dist/server/resolvePostPurchaseMemberDefault.d.ts +8 -0
  29. package/dist/server/selectPostPurchaseChoice.d.ts +2 -3
  30. package/package.json +1 -1
@@ -5,7 +5,10 @@ export * from './postPurchaseChoice';
5
5
  export * from './postPurchaseDiscount';
6
6
  export * from './postPurchaseEligibility';
7
7
  export * from './postPurchaseExitPolicy';
8
+ export * from './postPurchaseGroupCatalog';
8
9
  export * from './postPurchaseIdentity';
10
+ export * from './postPurchaseOfferEligibility';
11
+ export * from './postPurchaseOfferPresentation';
9
12
  export * from './postPurchaseOrderDecision';
10
13
  export * from './postPurchasePlanAdjustment';
11
14
  export * from './postPurchasePlanCatalog';
@@ -16,6 +19,7 @@ export * from './postPurchaseProductDisplay';
16
19
  export * from './postPurchaseProductGallery';
17
20
  export * from './postPurchaseProductSettings';
18
21
  export * from './postPurchaseProductSource';
22
+ export * from './postPurchaseQuantity';
19
23
  export * from './postPurchaseSelection';
20
24
  export * from './postPurchaseSession';
21
25
  export * from './postPurchaseSessionClose';
@@ -26,6 +30,7 @@ export * from './postPurchaseSubscriptionDisplay';
26
30
  export { PreparedPostPurchaseSubscription } from './postPurchaseSubscriptionProduct';
27
31
  export * from './postPurchaseVariantCatalog';
28
32
  export * from './postPurchaseVariantDefault';
33
+ export * from './postPurchaseVariantDefaultContext';
29
34
  export * from './product';
30
35
  export * from './shopConfig';
31
36
  export * from './smartCart';
@@ -0,0 +1,56 @@
1
+ import { z } from 'zod';
2
+ export declare const PostPurchaseGroupDescription: z.ZodObject<{
3
+ id: z.ZodNumber;
4
+ title: z.ZodString;
5
+ images: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
6
+ alt: z.ZodCatch<z.ZodOptional<z.ZodString>>;
7
+ id: z.ZodNumber;
8
+ src: z.ZodString;
9
+ }, z.core.$strip>>>>;
10
+ description: z.ZodDefault<z.ZodNullable<z.ZodOptional<z.ZodString>>>;
11
+ image: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodObject<{
12
+ src: z.ZodString;
13
+ }, z.core.$strip>>>>;
14
+ options: z.ZodDefault<z.ZodArray<z.ZodObject<{
15
+ name: z.ZodString;
16
+ values: z.ZodArray<z.ZodString>;
17
+ id: z.ZodNumber;
18
+ position: z.ZodNumber;
19
+ }, z.core.$strip>>>;
20
+ }, z.core.$strip>;
21
+ export declare const PostPurchaseGroupCatalog: z.ZodObject<{
22
+ memberProductId: z.ZodNumber;
23
+ options: z.ZodArray<z.ZodObject<{
24
+ productId: z.ZodNumber;
25
+ title: z.ZodString;
26
+ variantCatalog: z.ZodObject<{
27
+ displayMode: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
28
+ single: "single";
29
+ separate: "separate";
30
+ }>>>;
31
+ options: z.ZodArray<z.ZodObject<{
32
+ name: z.ZodString;
33
+ values: z.ZodArray<z.ZodString>;
34
+ id: z.ZodNumber;
35
+ position: z.ZodNumber;
36
+ }, z.core.$strip>>;
37
+ productId: z.ZodNumber;
38
+ showSelectors: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
39
+ variants: z.ZodArray<z.ZodObject<{
40
+ option1: z.ZodOptional<z.ZodString>;
41
+ option2: z.ZodOptional<z.ZodNullable<z.ZodString>>;
42
+ option3: z.ZodOptional<z.ZodNullable<z.ZodString>>;
43
+ available: z.ZodBoolean;
44
+ id: z.ZodNumber;
45
+ imageId: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
46
+ title: z.ZodString;
47
+ }, z.core.$strip>>;
48
+ }, z.core.$strip>;
49
+ }, z.core.$strip>>;
50
+ }, z.core.$strip>;
51
+ export type PostPurchaseGroupCatalog = z.infer<typeof PostPurchaseGroupCatalog>;
52
+ export declare const PostPurchaseGroupSelection: z.ZodObject<{
53
+ memberProductId: z.ZodNumber;
54
+ productId: z.ZodNumber;
55
+ }, z.core.$strip>;
56
+ export type PostPurchaseGroupSelection = z.infer<typeof PostPurchaseGroupSelection>;
@@ -0,0 +1,32 @@
1
+ import { z } from 'zod';
2
+ export declare const PostPurchaseOfferSkipReason: z.ZodEnum<{
3
+ empty: "empty";
4
+ "no-eligible-subscription": "no-eligible-subscription";
5
+ }>;
6
+ export declare const PostPurchaseOfferEligibilityContext: z.ZodObject<{
7
+ excludedProductIds: z.ZodDefault<z.ZodArray<z.ZodNumber>>;
8
+ originalLineItems: z.ZodArray<z.ZodObject<{
9
+ productId: z.ZodNumber;
10
+ sellingPlanId: z.ZodOptional<z.ZodNumber>;
11
+ variantId: z.ZodNumber;
12
+ }, z.core.$strip>>;
13
+ }, z.core.$strip>;
14
+ export type PostPurchaseOfferEligibilityContext = z.infer<typeof PostPurchaseOfferEligibilityContext>;
15
+ /** Retained catalog membership does not certify presentation or purchase preparation. */
16
+ export declare const PostPurchaseOfferEligibility: z.ZodDiscriminatedUnion<[z.ZodObject<{
17
+ members: z.ZodArray<z.ZodObject<{
18
+ productId: z.ZodNumber;
19
+ productIndex: z.ZodNumber;
20
+ }, z.core.$strip>>;
21
+ status: z.ZodLiteral<"retain">;
22
+ }, z.core.$strip>, z.ZodObject<{
23
+ reason: z.ZodEnum<{
24
+ empty: "empty";
25
+ "no-eligible-subscription": "no-eligible-subscription";
26
+ }>;
27
+ status: z.ZodLiteral<"skip">;
28
+ }, z.core.$strip>, z.ZodObject<{
29
+ reason: z.ZodOptional<z.ZodLiteral<"eligible-upgrade">>;
30
+ status: z.ZodLiteral<"unavailable">;
31
+ }, z.core.$strip>], "status">;
32
+ export type PostPurchaseOfferEligibility = z.infer<typeof PostPurchaseOfferEligibility>;
@@ -0,0 +1,386 @@
1
+ import { z } from 'zod';
2
+ /** The Offer frame only: no purchasable product, terms or selection. Its route contracts arrive with the route. */
3
+ export declare const PostPurchaseOfferPresentation: z.ZodObject<{
4
+ labels: z.ZodObject<{
5
+ declineAll: z.ZodDefault<z.ZodOptional<z.ZodString>>;
6
+ declineThisOffer: z.ZodDefault<z.ZodString>;
7
+ }, z.core.$strip>;
8
+ layout: z.ZodDefault<z.ZodOptional<z.ZodObject<{
9
+ itemsPerPage: z.ZodOptional<z.ZodNumber>;
10
+ type: z.ZodDefault<z.ZodEnum<{
11
+ grid: "grid";
12
+ carousel: "carousel";
13
+ list: "list";
14
+ }>>;
15
+ }, z.core.$strip>>>;
16
+ sections: z.ZodNullable<z.ZodObject<{
17
+ alignment: z.ZodDefault<z.ZodObject<{
18
+ horizontal: z.ZodDefault<z.ZodEnum<{
19
+ start: "start";
20
+ center: "center";
21
+ end: "end";
22
+ }>>;
23
+ vertical: z.ZodDefault<z.ZodEnum<{
24
+ top: "top";
25
+ middle: "middle";
26
+ bottom: "bottom";
27
+ }>>;
28
+ }, z.core.$strip>>;
29
+ border: z.ZodLazy<z.ZodDefault<z.ZodObject<{
30
+ radius: z.ZodDefault<z.ZodEnum<{
31
+ small: "small";
32
+ none: "none";
33
+ base: "base";
34
+ large: "large";
35
+ fullyRounded: "fullyRounded";
36
+ }>>;
37
+ style: z.ZodDefault<z.ZodEnum<{
38
+ none: "none";
39
+ base: "base";
40
+ dotted: "dotted";
41
+ dashed: "dashed";
42
+ }>>;
43
+ width: z.ZodDefault<z.ZodEnum<{
44
+ base: "base";
45
+ medium: "medium";
46
+ thick: "thick";
47
+ }>>;
48
+ }, z.core.$strip>>>;
49
+ buttonField: z.ZodOptional<z.ZodEnum<{
50
+ declineAllOffers: "declineAllOffers";
51
+ declineOffer: "declineOffer";
52
+ removeFromOrder: "removeFromOrder";
53
+ undoAddToOrder: "undoAddToOrder";
54
+ activePage: "activePage";
55
+ addedToCart: "addedToCart";
56
+ addingToCart: "addingToCart";
57
+ addToCart: "addToCart";
58
+ buttonLabel: "buttonLabel";
59
+ destinationUrl: "destinationUrl";
60
+ inactivePage: "inactivePage";
61
+ overlayContent: "overlayContent";
62
+ payNow: "payNow";
63
+ progressReached: "progressReached";
64
+ progressRemaining: "progressRemaining";
65
+ redirectToCheckout: "redirectToCheckout";
66
+ showVariant: "showVariant";
67
+ showVariants: "showVariants";
68
+ soldOut: "soldOut";
69
+ subscriptionOption: "subscriptionOption";
70
+ switchToOneTimePurchase: "switchToOneTimePurchase";
71
+ switchToSubscriptionNoDiscount: "switchToSubscriptionNoDiscount";
72
+ switchToSubscriptionWithDiscount: "switchToSubscriptionWithDiscount";
73
+ }>>;
74
+ direction: z.ZodDefault<z.ZodEnum<{
75
+ columns: "columns";
76
+ rows: "rows";
77
+ grid: "grid";
78
+ }>>;
79
+ frame: z.ZodOptional<z.ZodEnum<{
80
+ callout: "callout";
81
+ "offer-content": "offer-content";
82
+ }>>;
83
+ grid: z.ZodOptional<z.ZodDefault<z.ZodObject<{
84
+ columns: z.ZodDefault<z.ZodUnion<readonly [z.ZodArray<z.ZodUnion<readonly [z.ZodLiteral<"auto">, z.ZodLiteral<"fill">, z.ZodString, z.ZodNumber]>>, z.ZodUndefined]>>;
85
+ rows: z.ZodDefault<z.ZodUnion<readonly [z.ZodArray<z.ZodUnion<readonly [z.ZodLiteral<"auto">, z.ZodLiteral<"fill">, z.ZodString, z.ZodNumber]>>, z.ZodUndefined]>>;
86
+ }, z.core.$strip>>>;
87
+ name: z.ZodOptional<z.ZodString>;
88
+ padding: z.ZodDefault<z.ZodEnum<{
89
+ none: "none";
90
+ base: "base";
91
+ extraTight: "extraTight";
92
+ tight: "tight";
93
+ loose: "loose";
94
+ extraLoose: "extraLoose";
95
+ }>>;
96
+ sectionId: z.ZodDefault<z.ZodUUID>;
97
+ sections: z.ZodDefault<z.ZodUnion<readonly [z.ZodArray<z.ZodLazy<z.ZodType<import(".").CABSection, unknown, z.core.$ZodTypeInternals<import(".").CABSection, unknown>>>>, z.ZodPipe<z.ZodObject<{}, z.core.$strict>, z.ZodTransform<never[], Record<string, never>>>]>>;
98
+ sectionType: z.ZodDefault<z.ZodLiteral<"layout">>;
99
+ spacing: z.ZodDefault<z.ZodEnum<{
100
+ none: "none";
101
+ base: "base";
102
+ extraTight: "extraTight";
103
+ tight: "tight";
104
+ loose: "loose";
105
+ extraLoose: "extraLoose";
106
+ }>>;
107
+ viewUrl: z.ZodOptional<z.ZodString>;
108
+ width: z.ZodDefault<z.ZodNumber>;
109
+ wrapping: z.ZodOptional<z.ZodObject<{
110
+ breakAt: z.ZodNumber;
111
+ maxPerLine: z.ZodNumber;
112
+ }, z.core.$strip>>;
113
+ mutators: z.ZodOptional<z.ZodArray<z.ZodObject<{
114
+ effect: z.ZodDefault<z.ZodEnum<{
115
+ set_false: "set_false";
116
+ set_true: "set_true";
117
+ toggle: "toggle";
118
+ }>>;
119
+ variable: z.ZodString;
120
+ when: z.ZodDiscriminatedUnion<[z.ZodObject<{
121
+ operator: z.ZodDefault<z.ZodEnum<{
122
+ is_empty: "is_empty";
123
+ is_not_empty: "is_not_empty";
124
+ }>>;
125
+ type: z.ZodLiteral<"content">;
126
+ }, z.core.$strip>, z.ZodObject<{
127
+ event: z.ZodEnum<{
128
+ item_added: "item_added";
129
+ quantity_changed: "quantity_changed";
130
+ variant_selected: "variant_selected";
131
+ }>;
132
+ type: z.ZodLiteral<"event">;
133
+ }, z.core.$strip>, z.ZodObject<{
134
+ operator: z.ZodDefault<z.ZodEnum<{
135
+ equals: "equals";
136
+ greater_than: "greater_than";
137
+ less_than: "less_than";
138
+ }>>;
139
+ type: z.ZodLiteral<"result_count">;
140
+ value: z.ZodDefault<z.ZodNumber>;
141
+ }, z.core.$strip>, z.ZodObject<{
142
+ operator: z.ZodDefault<z.ZodEnum<{
143
+ contains: "contains";
144
+ does_not_contain: "does_not_contain";
145
+ }>>;
146
+ type: z.ZodLiteral<"result_tag">;
147
+ value: z.ZodString;
148
+ }, z.core.$strip>], "type">;
149
+ }, z.core.$strip>>>;
150
+ variables: z.ZodOptional<z.ZodArray<z.ZodPipe<z.ZodUnion<readonly [z.ZodObject<{
151
+ defaultValue: z.ZodString;
152
+ name: z.ZodString;
153
+ seed: z.ZodOptional<z.ZodNever>;
154
+ type: z.ZodLiteral<"text">;
155
+ }, z.core.$strip>, z.ZodObject<{
156
+ defaultValue: z.ZodNumber;
157
+ name: z.ZodString;
158
+ seed: z.ZodOptional<z.ZodNever>;
159
+ type: z.ZodLiteral<"number">;
160
+ }, z.core.$strip>, z.ZodObject<{
161
+ defaultValue: z.ZodOptional<z.ZodBoolean>;
162
+ name: z.ZodString;
163
+ seed: z.ZodOptional<z.ZodObject<{
164
+ dataSourceId: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
165
+ ruleset: z.ZodDefault<z.ZodUnion<readonly [z.ZodArray<z.ZodObject<{
166
+ exitIfMatched: z.ZodDefault<z.ZodBoolean>;
167
+ logic: z.ZodDefault<z.ZodArray<z.ZodObject<{
168
+ rules: z.ZodDefault<z.ZodArray<z.ZodObject<{
169
+ operator: z.ZodDefault<z.ZodEnum<{
170
+ equals: "equals";
171
+ greater_than: "greater_than";
172
+ less_than: "less_than";
173
+ contains: "contains";
174
+ does_not_contain: "does_not_contain";
175
+ after: "after";
176
+ anything: "anything";
177
+ before: "before";
178
+ contains_any: "contains_any";
179
+ does_not_contain_any: "does_not_contain_any";
180
+ does_not_equal: "does_not_equal";
181
+ }>>;
182
+ products: z.ZodDefault<z.ZodUnion<readonly [z.ZodArray<z.ZodUnknown>, z.ZodPipe<z.ZodObject<{}, z.core.$strict>, z.ZodTransform<never[], Record<string, never>>>]>>;
183
+ type: z.ZodDefault<z.ZodEnum<{
184
+ product: "product";
185
+ date: "date";
186
+ cart: "cart";
187
+ cart_count: "cart_count";
188
+ cart_item_count: "cart_item_count";
189
+ cart_line_count: "cart_line_count";
190
+ cart_subtotal: "cart_subtotal";
191
+ collection: "collection";
192
+ customer: "customer";
193
+ customer_order_count: "customer_order_count";
194
+ customer_tag: "customer_tag";
195
+ customer_total_spent: "customer_total_spent";
196
+ product_tag: "product_tag";
197
+ product_title: "product_title";
198
+ product_type: "product_type";
199
+ product_vendor: "product_vendor";
200
+ }>>;
201
+ value: z.ZodDefault<z.ZodCoercedString<unknown>>;
202
+ }, z.core.$strip>>>;
203
+ }, z.core.$strip>>>;
204
+ output: z.ZodDefault<z.ZodArray<z.ZodObject<{
205
+ key: z.ZodDefault<z.ZodString>;
206
+ type: z.ZodDefault<z.ZodLiteral<"data_json">>;
207
+ value: z.ZodDefault<z.ZodString>;
208
+ }, z.core.$strip>>>;
209
+ }, z.core.$strip>>, z.ZodPipe<z.ZodObject<{}, z.core.$strict>, z.ZodTransform<{
210
+ exitIfMatched: boolean;
211
+ logic: {
212
+ rules: {
213
+ operator: "equals" | "greater_than" | "less_than" | "contains" | "does_not_contain" | "after" | "anything" | "before" | "contains_any" | "does_not_contain_any" | "does_not_equal";
214
+ products: never[] | unknown[];
215
+ 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";
216
+ value: string;
217
+ }[];
218
+ }[];
219
+ output: {
220
+ key: string;
221
+ type: "data_json";
222
+ value: string;
223
+ }[];
224
+ }[], Record<string, never>>>]>>;
225
+ }, z.core.$strip>>;
226
+ type: z.ZodDefault<z.ZodLiteral<"boolean">>;
227
+ }, z.core.$strip>]>, z.ZodTransform<{
228
+ defaultValue: string;
229
+ name: string;
230
+ type: "text";
231
+ seed?: undefined;
232
+ } | {
233
+ defaultValue: number;
234
+ name: string;
235
+ type: "number";
236
+ seed?: undefined;
237
+ } | {
238
+ defaultValue: boolean;
239
+ name: string;
240
+ type: "boolean";
241
+ seed?: {
242
+ dataSourceId: number | null;
243
+ ruleset: {
244
+ exitIfMatched: boolean;
245
+ logic: {
246
+ rules: {
247
+ operator: "equals" | "greater_than" | "less_than" | "contains" | "does_not_contain" | "after" | "anything" | "before" | "contains_any" | "does_not_contain_any" | "does_not_equal";
248
+ products: never[] | unknown[];
249
+ 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";
250
+ value: string;
251
+ }[];
252
+ }[];
253
+ output: {
254
+ key: string;
255
+ type: "data_json";
256
+ value: string;
257
+ }[];
258
+ }[];
259
+ } | undefined;
260
+ }, {
261
+ name: string;
262
+ type: "boolean";
263
+ defaultValue?: boolean | undefined;
264
+ seed?: {
265
+ dataSourceId: number | null;
266
+ ruleset: {
267
+ exitIfMatched: boolean;
268
+ logic: {
269
+ rules: {
270
+ operator: "equals" | "greater_than" | "less_than" | "contains" | "does_not_contain" | "after" | "anything" | "before" | "contains_any" | "does_not_contain_any" | "does_not_equal";
271
+ products: never[] | unknown[];
272
+ 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";
273
+ value: string;
274
+ }[];
275
+ }[];
276
+ output: {
277
+ key: string;
278
+ type: "data_json";
279
+ value: string;
280
+ }[];
281
+ }[];
282
+ } | undefined;
283
+ } | {
284
+ defaultValue: string;
285
+ name: string;
286
+ type: "text";
287
+ seed?: undefined;
288
+ } | {
289
+ defaultValue: number;
290
+ name: string;
291
+ type: "number";
292
+ seed?: undefined;
293
+ }>>>>;
294
+ visibility: z.ZodOptional<z.ZodObject<{
295
+ variable: z.ZodString;
296
+ visibleWhen: z.ZodDefault<z.ZodBoolean>;
297
+ }, z.core.$strip>>;
298
+ editorMode: z.ZodDefault<z.ZodEnum<{
299
+ checkoutExtension: "checkoutExtension";
300
+ postPurchaseOffer: "postPurchaseOffer";
301
+ thankYouPage: "thankYouPage";
302
+ orderStatusPage: "orderStatusPage";
303
+ ordersIndexPage: "ordersIndexPage";
304
+ customerProfilePage: "customerProfilePage";
305
+ }>>;
306
+ experiment: z.ZodOptional<z.ZodObject<{
307
+ elementId: z.ZodNumber;
308
+ experimentId: z.ZodNumber;
309
+ experimentType: z.ZodString;
310
+ selectedId: z.ZodNumber;
311
+ }, z.core.$strip>>;
312
+ previewMode: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodBoolean>>, z.ZodTransform<boolean, boolean | null | undefined>>;
313
+ storeId: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
314
+ targetArea: z.ZodNullable<z.ZodDefault<z.ZodObject<{
315
+ fill: z.ZodOptional<z.ZodBoolean>;
316
+ flip: z.ZodOptional<z.ZodEnum<{
317
+ vertical: "vertical";
318
+ horizontal: "horizontal";
319
+ both: "both";
320
+ }>>;
321
+ icon: z.ZodString;
322
+ label: z.ZodString;
323
+ width: z.ZodString;
324
+ }, z.core.$strip>>>;
325
+ tracking: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodObject<{
326
+ enableAttribution: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodBoolean>>, z.ZodTransform<boolean, boolean | null | undefined>>;
327
+ enableSource: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodBoolean>>, z.ZodTransform<boolean, boolean | null | undefined>>;
328
+ enableWidget: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodBoolean>>, z.ZodTransform<boolean, boolean | null | undefined>>;
329
+ }, z.core.$strip>>>, z.ZodTransform<{
330
+ enableAttribution: boolean;
331
+ enableSource: boolean;
332
+ enableWidget: boolean;
333
+ }, {
334
+ enableAttribution: boolean;
335
+ enableSource: boolean;
336
+ enableWidget: boolean;
337
+ } | null | undefined>>;
338
+ type: z.ZodDefault<z.ZodEnum<{
339
+ product: "product";
340
+ bundle_builder: "bundle_builder";
341
+ cart: "cart";
342
+ cart_subscription: "cart_subscription";
343
+ dynamic_bundle: "dynamic_bundle";
344
+ gift_with_purchase: "gift_with_purchase";
345
+ placeholder: "placeholder";
346
+ pre_purchase: "pre_purchase";
347
+ product_addon: "product_addon";
348
+ product_upsell: "product_upsell";
349
+ recharge_checkout: "recharge_checkout";
350
+ recharge_customer_portal: "recharge_customer_portal";
351
+ recharge_post_purchase: "recharge_post_purchase";
352
+ shopify_checkout: "shopify_checkout";
353
+ shopify_checkout_extension: "shopify_checkout_extension";
354
+ shopify_post_purchase: "shopify_post_purchase";
355
+ shopify_post_purchase_extension: "shopify_post_purchase_extension";
356
+ switch_to_subscription: "switch_to_subscription";
357
+ ui_extension_ad: "ui_extension_ad";
358
+ ui_extension_button: "ui_extension_button";
359
+ ui_extension_content_block: "ui_extension_content_block";
360
+ ui_extension_line_item_editor: "ui_extension_line_item_editor";
361
+ ui_extension_progress_bar: "ui_extension_progress_bar";
362
+ }>>;
363
+ uiLabels: z.ZodDefault<z.ZodObject<{
364
+ currentPage: z.ZodPipe<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>, z.ZodTransform<Record<string, string>, Record<string, string>>>;
365
+ guest: z.ZodPipe<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>, z.ZodTransform<Record<string, string>, Record<string, string>>>;
366
+ loadingOptions: z.ZodPipe<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>, z.ZodTransform<Record<string, string>, Record<string, string>>>;
367
+ nextPage: z.ZodPipe<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>, z.ZodTransform<Record<string, string>, Record<string, string>>>;
368
+ offerCarousel: z.ZodPipe<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>, z.ZodTransform<Record<string, string>, Record<string, string>>>;
369
+ offerDialog: z.ZodPipe<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>, z.ZodTransform<Record<string, string>, Record<string, string>>>;
370
+ page: z.ZodPipe<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>, z.ZodTransform<Record<string, string>, Record<string, string>>>;
371
+ previousPage: z.ZodPipe<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>, z.ZodTransform<Record<string, string>, Record<string, string>>>;
372
+ selected: z.ZodPipe<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>, z.ZodTransform<Record<string, string>, Record<string, string>>>;
373
+ subscriptionOptions: z.ZodPipe<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>, z.ZodTransform<Record<string, string>, Record<string, string>>>;
374
+ updating: z.ZodPipe<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>, z.ZodTransform<Record<string, string>, Record<string, string>>>;
375
+ }, z.core.$strip>>;
376
+ version: z.ZodDefault<z.ZodLiteral<2>>;
377
+ widgetId: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
378
+ }, z.core.$strip>>;
379
+ showDeclineAll: z.ZodOptional<z.ZodEnum<{
380
+ none: "none";
381
+ both: "both";
382
+ above: "above";
383
+ below: "below";
384
+ }>>;
385
+ }, z.core.$strict>;
386
+ export type PostPurchaseOfferPresentation = z.infer<typeof PostPurchaseOfferPresentation>;
@@ -4,11 +4,16 @@ export declare const PostPurchaseAmount: z.ZodString;
4
4
  export declare const PostPurchaseProductId: z.ZodNumber;
5
5
  export declare const PostPurchaseVariantId: z.ZodNumber;
6
6
  /**
7
- * The data-source product/variant response shape `normalizePostPurchaseProduct` validates. `recommendedVariantIds`
8
- * is deliberately not declared here (decision 15): the legacy build never delivered the v2-recommendation
9
- * branch it fed (the equivalent legacy schema stripped the field before any reader ran), so this rebuild
10
- * does not carry it forward either — an undeclared key is simply dropped by `.parse()`, matching that dead
11
- * behaviour rather than reviving it.
7
+ * The data-source product/variant response shape `normalizePostPurchaseProduct` validates.
8
+ *
9
+ * `metadata.productQuantity` is **new behaviour**, kept per decision 15 because the rebuild already implemented
10
+ * it: legacy `initializeProduct.ts:100-104` read it, but its schema stripped `metadata` first, so no merchant ever
11
+ * had a metadata quantity override (L82, reconciliation F2). Here it is the initial quantity ahead of the picker
12
+ * default, read by `readPostPurchaseQuantity` and `projectPostPurchaseProduct` alike.
13
+ *
14
+ * `recommendedVariantIds`, by contrast, is deliberately not declared here (decision 15): the legacy build never
15
+ * delivered the v2-recommendation branch it fed (the equivalent legacy schema stripped the field before any
16
+ * reader ran), and the rebuild had dropped that step, so an undeclared key is simply dropped by `.parse()`.
12
17
  *
13
18
  * The `unknown` product/variant fields (`options`, `option1–3`, selling-plan fields, `selectedVariant`,
14
19
  * `productGroupVariants`, `metafields`) are likewise parsed at their point of use — e.g.
@@ -0,0 +1,13 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * Today's picker bounds plus the trusted initial quantity; the buyer-choice schemas arrive with the member views.
4
+ * A minimum of 0, which the settings schema accepts and maps unreadable values to, floors at 1: nothing can be
5
+ * bought at 0, and legacy still rendered that picker, so it must not refuse the Offer.
6
+ */
7
+ export declare const PostPurchaseQuantityPolicy: z.ZodObject<{
8
+ enabled: z.ZodDefault<z.ZodBoolean>;
9
+ initialQuantity: z.ZodNumber;
10
+ maxValue: z.ZodNumber;
11
+ minValue: z.ZodUnion<[z.ZodPipe<z.ZodLiteral<0>, z.ZodTransform<number, 0>>, z.ZodNumber]>;
12
+ }, z.core.$strip>;
13
+ export type PostPurchaseQuantityPolicy = z.infer<typeof PostPurchaseQuantityPolicy>;
@@ -34,3 +34,20 @@ export declare const PostPurchaseVariantDefaultSettings: z.ZodObject<{
34
34
  hideOutOfStockVariants: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
35
35
  }, z.core.$strip>;
36
36
  export declare const PostPurchaseOrderAttributes: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>>;
37
+ export declare const PostPurchaseOriginalVariants: z.ZodArray<z.ZodObject<{
38
+ productId: z.ZodNumber;
39
+ variantId: z.ZodNumber;
40
+ }, z.core.$strip>>;
41
+ export declare const PostPurchaseAttributeProducts: z.ZodArray<z.ZodObject<{
42
+ id: z.ZodNumber;
43
+ options: z.ZodArray<z.ZodObject<{
44
+ values: z.ZodArray<z.ZodString>;
45
+ name: z.ZodString;
46
+ }, z.core.$strip>>;
47
+ variants: z.ZodArray<z.ZodObject<{
48
+ option2: z.ZodOptional<z.ZodNullable<z.ZodString>>;
49
+ option3: z.ZodOptional<z.ZodNullable<z.ZodString>>;
50
+ option1: z.ZodOptional<z.ZodNullable<z.ZodString>>;
51
+ id: z.ZodNumber;
52
+ }, z.core.$strip>>;
53
+ }, z.core.$strip>>;
@@ -0,0 +1,10 @@
1
+ import { z } from 'zod';
2
+ /** Server-owned original-order facts; enrichment is parsed only when matching consumes it. */
3
+ export declare const PostPurchaseVariantDefaultContext: z.ZodObject<{
4
+ enrichedLineItems: z.ZodOptional<z.ZodUnknown>;
5
+ originalVariants: z.ZodArray<z.ZodObject<{
6
+ productId: z.ZodNumber;
7
+ variantId: z.ZodNumber;
8
+ }, z.core.$strip>>;
9
+ }, z.core.$strip>;
10
+ export type PostPurchaseVariantDefaultContext = z.infer<typeof PostPurchaseVariantDefaultContext>;
@@ -0,0 +1,75 @@
1
+ /** Synthetic group wire grounded in legacy schemas/consumers; not a captured upstream response. */
2
+ export declare const groupSettings: {
3
+ quantity_inputs: {
4
+ default_quantity: number;
5
+ enabled: boolean;
6
+ };
7
+ blocks: {
8
+ type: string;
9
+ }[];
10
+ discount: {
11
+ amount: string;
12
+ type: string;
13
+ };
14
+ endpoint: string;
15
+ integrations: {};
16
+ key: string;
17
+ language: {};
18
+ product_limit: number;
19
+ product_options: {};
20
+ product_type: string;
21
+ shipping: {
22
+ amount: string;
23
+ title: string;
24
+ type: string;
25
+ };
26
+ };
27
+ export declare const groupResponse: () => {
28
+ data: {
29
+ options: {
30
+ id: number;
31
+ name: string;
32
+ position: number;
33
+ values: string[];
34
+ }[];
35
+ product_group_variants: ({
36
+ description: string;
37
+ id: number;
38
+ image: null;
39
+ options: {
40
+ id: number;
41
+ name: string;
42
+ position: number;
43
+ values: string[];
44
+ }[];
45
+ title: string;
46
+ } | null)[];
47
+ variants: ({
48
+ inventory_quantity: number;
49
+ option1: string;
50
+ compare_at_price: string;
51
+ id: number;
52
+ inventory_management: string;
53
+ inventory_policy: string;
54
+ price: string;
55
+ product_id: number;
56
+ title: string;
57
+ } | {
58
+ id: number;
59
+ product_id: number;
60
+ title: string;
61
+ compare_at_price: string;
62
+ inventory_management: string;
63
+ inventory_policy: string;
64
+ inventory_quantity: number;
65
+ price: string;
66
+ })[];
67
+ description: string;
68
+ id: number;
69
+ image: {
70
+ src: string;
71
+ };
72
+ title: string;
73
+ }[];
74
+ metadata: {};
75
+ };
@@ -0,0 +1,3 @@
1
+ import { type z } from 'zod';
2
+ import { type PostPurchaseOfferEligibility, PostPurchaseOfferEligibilityContext } from '../schema/postPurchaseOfferEligibility';
3
+ export declare const classifyPostPurchaseOffer: (settings: unknown, response: unknown, context: z.input<typeof PostPurchaseOfferEligibilityContext>) => PostPurchaseOfferEligibility;