@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
@@ -5,6 +5,7 @@ export * from './postPurchaseChoice';
5
5
  export * from './postPurchaseDiscount';
6
6
  export * from './postPurchaseEligibility';
7
7
  export * from './postPurchaseExitPolicy';
8
+ export * from './postPurchaseGroup';
8
9
  export * from './postPurchaseGroupCatalog';
9
10
  export * from './postPurchaseIdentity';
10
11
  export * from './postPurchaseOfferEligibility';
@@ -14,11 +15,14 @@ export * from './postPurchasePlanAdjustment';
14
15
  export * from './postPurchasePlanCatalog';
15
16
  export * from './postPurchasePolicy';
16
17
  export * from './postPurchaseProduct';
18
+ export * from './postPurchaseProductCalculation';
17
19
  export * from './postPurchaseProductCollectionView';
18
20
  export * from './postPurchaseProductDisplay';
19
21
  export * from './postPurchaseProductGallery';
22
+ export * from './postPurchaseProductReviews';
20
23
  export * from './postPurchaseProductSettings';
21
24
  export * from './postPurchaseProductSource';
25
+ export * from './postPurchaseProductView';
22
26
  export * from './postPurchaseQuantity';
23
27
  export * from './postPurchaseSelection';
24
28
  export * from './postPurchaseSession';
@@ -0,0 +1,15 @@
1
+ import { type z } from 'zod';
2
+ /** A buyer's choice inside one grouped member: the card identity plus the selected merchandise. */
3
+ export declare const PostPurchaseGroupChoice: z.ZodObject<{
4
+ choice: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
5
+ mode: z.ZodLiteral<"one-time">;
6
+ }, z.core.$strict>, z.ZodObject<{
7
+ mode: z.ZodLiteral<"subscription">;
8
+ sellingPlanId: z.ZodNumber;
9
+ }, z.core.$strict>], "mode">>;
10
+ productId: z.ZodNumber;
11
+ variantId: z.ZodOptional<z.ZodNumber>;
12
+ quantity: z.ZodOptional<z.ZodNumber>;
13
+ memberProductId: z.ZodNumber;
14
+ }, z.core.$strict>;
15
+ export type PostPurchaseGroupChoice = z.infer<typeof PostPurchaseGroupChoice>;
@@ -9,6 +9,43 @@ export type PostPurchaseVariant = z.infer<typeof PostPurchaseVariant>;
9
9
  /** One prepared purchasable product: the display, the exact selection and the terms a changeset is built from. */
10
10
  export declare const PreparedPostPurchaseProduct: z.ZodObject<{
11
11
  display: z.ZodObject<{
12
+ descriptionDocument: z.ZodOptional<z.ZodObject<{
13
+ attrs: z.ZodDefault<z.ZodObject<{
14
+ blockSpacing: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<"none" | "base" | "extraTight" | "tight" | "loose" | "extraLoose" | undefined, string>>>;
15
+ }, z.core.$strip>>;
16
+ content: z.ZodDefault<z.ZodUnion<readonly [z.ZodArray<z.ZodObject<{
17
+ attrs: z.ZodDefault<z.ZodObject<{
18
+ textAlign: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<"start" | "center" | "end" | undefined, string>>>;
19
+ }, z.core.$strip>>;
20
+ content: z.ZodDefault<z.ZodUnion<readonly [z.ZodArray<z.ZodObject<{
21
+ marks: z.ZodOptional<z.ZodUnion<readonly [z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
22
+ type: z.ZodLiteral<"bold">;
23
+ }, z.core.$strip>, z.ZodObject<{
24
+ type: z.ZodLiteral<"italic">;
25
+ }, z.core.$strip>, z.ZodObject<{
26
+ attrs: z.ZodObject<{
27
+ class: z.ZodNullable<z.ZodString>;
28
+ href: z.ZodUnion<readonly [z.ZodURL, z.ZodLiteral<"#">, z.ZodString, z.ZodString]>;
29
+ rel: z.ZodDefault<z.ZodString>;
30
+ target: z.ZodDefault<z.ZodString>;
31
+ }, z.core.$strip>;
32
+ type: z.ZodLiteral<"link">;
33
+ }, z.core.$strip>, z.ZodObject<{
34
+ type: z.ZodLiteral<"strike">;
35
+ }, z.core.$strip>, z.ZodObject<{
36
+ attrs: z.ZodObject<{
37
+ color: z.ZodDefault<z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<"success" | "warning" | "critical" | "base" | "decorative" | "subdued" | "accent" | undefined, string>>>>;
38
+ fontSize: z.ZodDefault<z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<"small" | "base" | "large" | "medium" | "extraSmall" | "extraLarge" | "heading" | undefined, string>>>>;
39
+ }, z.core.$strip>;
40
+ type: z.ZodLiteral<"textStyle">;
41
+ }, z.core.$strip>], "type">>, z.ZodPipe<z.ZodObject<{}, z.core.$strict>, z.ZodTransform<never[], Record<string, never>>>]>>;
42
+ text: z.ZodDefault<z.ZodString>;
43
+ type: z.ZodDefault<z.ZodLiteral<"text">>;
44
+ }, z.core.$strip>>, z.ZodPipe<z.ZodObject<{}, z.core.$strict>, z.ZodTransform<never[], Record<string, never>>>]>>;
45
+ type: z.ZodDefault<z.ZodLiteral<"paragraph">>;
46
+ }, z.core.$strip>>, z.ZodPipe<z.ZodObject<{}, z.core.$strict>, z.ZodTransform<never[], Record<string, never>>>]>>;
47
+ type: z.ZodDefault<z.ZodLiteral<"doc">>;
48
+ }, z.core.$strip>>;
12
49
  discountedFrom: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
13
50
  price: "price";
14
51
  compare_at_price: "compare_at_price";
@@ -25,18 +62,6 @@ export declare const PreparedPostPurchaseProduct: z.ZodObject<{
25
62
  language: z.ZodObject<{
26
63
  description: z.ZodDefault<z.ZodUnion<readonly [z.ZodString, z.ZodPipe<z.ZodUnknown, z.ZodTransform<string, unknown>>]>>;
27
64
  descriptionEnabled: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
28
- descriptionRte: z.ZodOptional<z.ZodObject<{
29
- content: z.ZodArray<z.ZodUnknown>;
30
- type: z.ZodString;
31
- }, z.core.$strip>>;
32
- descriptionSpacing: z.ZodOptional<z.ZodEnum<{
33
- default: "default";
34
- none: "none";
35
- tight: "tight";
36
- loose: "loose";
37
- xtight: "xtight";
38
- xloose: "xloose";
39
- }>>;
40
65
  }, z.core.$strip>;
41
66
  primaryImage: z.ZodObject<{
42
67
  description: z.ZodString;
@@ -56,6 +81,20 @@ export declare const PreparedPostPurchaseProduct: z.ZodObject<{
56
81
  showVariantSelectors: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
57
82
  }, z.core.$strip>;
58
83
  responseDescription: z.ZodDefault<z.ZodUnion<readonly [z.ZodString, z.ZodPipe<z.ZodUnknown, z.ZodTransform<string, unknown>>]>>;
84
+ reviews: z.ZodDefault<z.ZodNullable<z.ZodObject<{
85
+ color: z.ZodString;
86
+ rating: z.ZodNumber;
87
+ reviewCount: z.ZodNumber;
88
+ reviewsPlural: z.ZodString;
89
+ reviewsSingular: z.ZodString;
90
+ size: z.ZodEnum<{
91
+ small: "small";
92
+ large: "large";
93
+ medium: "medium";
94
+ }>;
95
+ strokeColor: z.ZodString;
96
+ strokeWidth: z.ZodNumber;
97
+ }, z.core.$strip>>>;
59
98
  shouldShowSavingText: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
60
99
  }, z.core.$strip>;
61
100
  labels: z.ZodObject<{
@@ -133,6 +172,43 @@ export declare const PreparedPostPurchaseProduct: z.ZodObject<{
133
172
  export type PreparedPostPurchaseProduct = z.infer<typeof PreparedPostPurchaseProduct>;
134
173
  export declare const PostPurchasePreparation: z.ZodDiscriminatedUnion<[z.ZodObject<{
135
174
  display: z.ZodObject<{
175
+ descriptionDocument: z.ZodOptional<z.ZodObject<{
176
+ attrs: z.ZodDefault<z.ZodObject<{
177
+ blockSpacing: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<"none" | "base" | "extraTight" | "tight" | "loose" | "extraLoose" | undefined, string>>>;
178
+ }, z.core.$strip>>;
179
+ content: z.ZodDefault<z.ZodUnion<readonly [z.ZodArray<z.ZodObject<{
180
+ attrs: z.ZodDefault<z.ZodObject<{
181
+ textAlign: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<"start" | "center" | "end" | undefined, string>>>;
182
+ }, z.core.$strip>>;
183
+ content: z.ZodDefault<z.ZodUnion<readonly [z.ZodArray<z.ZodObject<{
184
+ marks: z.ZodOptional<z.ZodUnion<readonly [z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
185
+ type: z.ZodLiteral<"bold">;
186
+ }, z.core.$strip>, z.ZodObject<{
187
+ type: z.ZodLiteral<"italic">;
188
+ }, z.core.$strip>, z.ZodObject<{
189
+ attrs: z.ZodObject<{
190
+ class: z.ZodNullable<z.ZodString>;
191
+ href: z.ZodUnion<readonly [z.ZodURL, z.ZodLiteral<"#">, z.ZodString, z.ZodString]>;
192
+ rel: z.ZodDefault<z.ZodString>;
193
+ target: z.ZodDefault<z.ZodString>;
194
+ }, z.core.$strip>;
195
+ type: z.ZodLiteral<"link">;
196
+ }, z.core.$strip>, z.ZodObject<{
197
+ type: z.ZodLiteral<"strike">;
198
+ }, z.core.$strip>, z.ZodObject<{
199
+ attrs: z.ZodObject<{
200
+ color: z.ZodDefault<z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<"success" | "warning" | "critical" | "base" | "decorative" | "subdued" | "accent" | undefined, string>>>>;
201
+ fontSize: z.ZodDefault<z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<"small" | "base" | "large" | "medium" | "extraSmall" | "extraLarge" | "heading" | undefined, string>>>>;
202
+ }, z.core.$strip>;
203
+ type: z.ZodLiteral<"textStyle">;
204
+ }, z.core.$strip>], "type">>, z.ZodPipe<z.ZodObject<{}, z.core.$strict>, z.ZodTransform<never[], Record<string, never>>>]>>;
205
+ text: z.ZodDefault<z.ZodString>;
206
+ type: z.ZodDefault<z.ZodLiteral<"text">>;
207
+ }, z.core.$strip>>, z.ZodPipe<z.ZodObject<{}, z.core.$strict>, z.ZodTransform<never[], Record<string, never>>>]>>;
208
+ type: z.ZodDefault<z.ZodLiteral<"paragraph">>;
209
+ }, z.core.$strip>>, z.ZodPipe<z.ZodObject<{}, z.core.$strict>, z.ZodTransform<never[], Record<string, never>>>]>>;
210
+ type: z.ZodDefault<z.ZodLiteral<"doc">>;
211
+ }, z.core.$strip>>;
136
212
  discountedFrom: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
137
213
  price: "price";
138
214
  compare_at_price: "compare_at_price";
@@ -149,18 +225,6 @@ export declare const PostPurchasePreparation: z.ZodDiscriminatedUnion<[z.ZodObje
149
225
  language: z.ZodObject<{
150
226
  description: z.ZodDefault<z.ZodUnion<readonly [z.ZodString, z.ZodPipe<z.ZodUnknown, z.ZodTransform<string, unknown>>]>>;
151
227
  descriptionEnabled: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
152
- descriptionRte: z.ZodOptional<z.ZodObject<{
153
- content: z.ZodArray<z.ZodUnknown>;
154
- type: z.ZodString;
155
- }, z.core.$strip>>;
156
- descriptionSpacing: z.ZodOptional<z.ZodEnum<{
157
- default: "default";
158
- none: "none";
159
- tight: "tight";
160
- loose: "loose";
161
- xtight: "xtight";
162
- xloose: "xloose";
163
- }>>;
164
228
  }, z.core.$strip>;
165
229
  primaryImage: z.ZodObject<{
166
230
  description: z.ZodString;
@@ -180,6 +244,20 @@ export declare const PostPurchasePreparation: z.ZodDiscriminatedUnion<[z.ZodObje
180
244
  showVariantSelectors: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
181
245
  }, z.core.$strip>;
182
246
  responseDescription: z.ZodDefault<z.ZodUnion<readonly [z.ZodString, z.ZodPipe<z.ZodUnknown, z.ZodTransform<string, unknown>>]>>;
247
+ reviews: z.ZodDefault<z.ZodNullable<z.ZodObject<{
248
+ color: z.ZodString;
249
+ rating: z.ZodNumber;
250
+ reviewCount: z.ZodNumber;
251
+ reviewsPlural: z.ZodString;
252
+ reviewsSingular: z.ZodString;
253
+ size: z.ZodEnum<{
254
+ small: "small";
255
+ large: "large";
256
+ medium: "medium";
257
+ }>;
258
+ strokeColor: z.ZodString;
259
+ strokeWidth: z.ZodNumber;
260
+ }, z.core.$strip>>>;
183
261
  shouldShowSavingText: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
184
262
  }, z.core.$strip>;
185
263
  labels: z.ZodObject<{
@@ -0,0 +1,87 @@
1
+ import { z } from 'zod';
2
+ export declare const PostPurchaseProductCalculation: z.ZodObject<{
3
+ calculatedPurchase: z.ZodObject<{
4
+ addedShippingLines: z.ZodArray<z.ZodObject<{
5
+ priceSet: z.ZodObject<{
6
+ presentmentMoney: z.ZodObject<{
7
+ amount: z.ZodString;
8
+ currencyCode: z.ZodString;
9
+ }, z.core.$strip>;
10
+ }, z.core.$strip>;
11
+ }, z.core.$strip>>;
12
+ addedTaxLines: z.ZodArray<z.ZodObject<{
13
+ priceSet: z.ZodObject<{
14
+ presentmentMoney: z.ZodObject<{
15
+ amount: z.ZodString;
16
+ currencyCode: z.ZodString;
17
+ }, z.core.$strip>;
18
+ }, z.core.$strip>;
19
+ }, z.core.$strip>>;
20
+ totalOutstandingSet: z.ZodObject<{
21
+ presentmentMoney: z.ZodObject<{
22
+ amount: z.ZodString;
23
+ currencyCode: z.ZodString;
24
+ }, z.core.$strip>;
25
+ }, z.core.$strip>;
26
+ updatedLineItems: z.ZodArray<z.ZodObject<{
27
+ priceSet: z.ZodOptional<z.ZodUnknown>;
28
+ productId: z.ZodNumber;
29
+ sellingPlanId: z.ZodOptional<z.ZodUnknown>;
30
+ variantId: z.ZodNumber;
31
+ }, z.core.$strip>>;
32
+ }, z.core.$strip>;
33
+ errors: z.ZodArray<z.ZodUnknown>;
34
+ status: z.ZodLiteral<"processed">;
35
+ }, z.core.$strip>;
36
+ export declare const PostPurchaseProductCosts: z.ZodObject<{
37
+ currencyCode: z.ZodString;
38
+ recurringDisplay: z.ZodOptional<z.ZodObject<{
39
+ shippingMinor: z.ZodNumber;
40
+ subtotalMinor: z.ZodNumber;
41
+ totalMinor: z.ZodNumber;
42
+ }, z.core.$strip>>;
43
+ shippingMinor: z.ZodNumber;
44
+ subtotalMinor: z.ZodNumber;
45
+ taxesMinor: z.ZodNumber;
46
+ totalMinor: z.ZodNumber;
47
+ }, z.core.$strip>;
48
+ export type PostPurchaseProductCosts = z.infer<typeof PostPurchaseProductCosts>;
49
+ export declare const PostPurchaseProductChangeset: z.ZodObject<{
50
+ changes: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
51
+ discount: z.ZodOptional<z.ZodObject<{
52
+ title: z.ZodString;
53
+ value: z.ZodNumber;
54
+ valueType: z.ZodEnum<{
55
+ fixed_amount: "fixed_amount";
56
+ percentage: "percentage";
57
+ }>;
58
+ }, z.core.$strip>>;
59
+ quantity: z.ZodNumber;
60
+ type: z.ZodLiteral<"add_variant">;
61
+ variantId: z.ZodNumber;
62
+ }, z.core.$strip>, z.ZodObject<{
63
+ price: z.ZodNumber;
64
+ title: z.ZodString;
65
+ type: z.ZodLiteral<"add_shipping_line">;
66
+ }, z.core.$strip>, z.ZodObject<{
67
+ initialShippingPrice: z.ZodNumber;
68
+ recurringShippingPrice: z.ZodNumber;
69
+ shippingOption: z.ZodObject<{
70
+ presentmentTitle: z.ZodString;
71
+ title: z.ZodString;
72
+ }, z.core.$strip>;
73
+ discount: z.ZodOptional<z.ZodObject<{
74
+ title: z.ZodString;
75
+ value: z.ZodNumber;
76
+ valueType: z.ZodEnum<{
77
+ fixed_amount: "fixed_amount";
78
+ percentage: "percentage";
79
+ }>;
80
+ }, z.core.$strip>>;
81
+ quantity: z.ZodNumber;
82
+ sellingPlanId: z.ZodNumber;
83
+ type: z.ZodLiteral<"add_subscription">;
84
+ variantId: z.ZodNumber;
85
+ }, z.core.$strip>]>>;
86
+ }, z.core.$strip>;
87
+ export type PostPurchaseProductChangeset = z.infer<typeof PostPurchaseProductChangeset>;