@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
@@ -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,13 @@ 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';
20
22
  export * from './postPurchaseProductSettings';
21
23
  export * from './postPurchaseProductSource';
24
+ export * from './postPurchaseProductView';
22
25
  export * from './postPurchaseQuantity';
23
26
  export * from './postPurchaseSelection';
24
27
  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;
@@ -133,6 +158,43 @@ export declare const PreparedPostPurchaseProduct: z.ZodObject<{
133
158
  export type PreparedPostPurchaseProduct = z.infer<typeof PreparedPostPurchaseProduct>;
134
159
  export declare const PostPurchasePreparation: z.ZodDiscriminatedUnion<[z.ZodObject<{
135
160
  display: z.ZodObject<{
161
+ descriptionDocument: z.ZodOptional<z.ZodObject<{
162
+ attrs: z.ZodDefault<z.ZodObject<{
163
+ blockSpacing: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<"none" | "base" | "extraTight" | "tight" | "loose" | "extraLoose" | undefined, string>>>;
164
+ }, z.core.$strip>>;
165
+ content: z.ZodDefault<z.ZodUnion<readonly [z.ZodArray<z.ZodObject<{
166
+ attrs: z.ZodDefault<z.ZodObject<{
167
+ textAlign: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<"start" | "center" | "end" | undefined, string>>>;
168
+ }, z.core.$strip>>;
169
+ content: z.ZodDefault<z.ZodUnion<readonly [z.ZodArray<z.ZodObject<{
170
+ marks: z.ZodOptional<z.ZodUnion<readonly [z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
171
+ type: z.ZodLiteral<"bold">;
172
+ }, z.core.$strip>, z.ZodObject<{
173
+ type: z.ZodLiteral<"italic">;
174
+ }, z.core.$strip>, z.ZodObject<{
175
+ attrs: z.ZodObject<{
176
+ class: z.ZodNullable<z.ZodString>;
177
+ href: z.ZodUnion<readonly [z.ZodURL, z.ZodLiteral<"#">, z.ZodString, z.ZodString]>;
178
+ rel: z.ZodDefault<z.ZodString>;
179
+ target: z.ZodDefault<z.ZodString>;
180
+ }, z.core.$strip>;
181
+ type: z.ZodLiteral<"link">;
182
+ }, z.core.$strip>, z.ZodObject<{
183
+ type: z.ZodLiteral<"strike">;
184
+ }, z.core.$strip>, z.ZodObject<{
185
+ attrs: z.ZodObject<{
186
+ color: z.ZodDefault<z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<"success" | "warning" | "critical" | "base" | "decorative" | "subdued" | "accent" | undefined, string>>>>;
187
+ fontSize: z.ZodDefault<z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<"small" | "base" | "large" | "medium" | "extraSmall" | "extraLarge" | "heading" | undefined, string>>>>;
188
+ }, z.core.$strip>;
189
+ type: z.ZodLiteral<"textStyle">;
190
+ }, z.core.$strip>], "type">>, z.ZodPipe<z.ZodObject<{}, z.core.$strict>, z.ZodTransform<never[], Record<string, never>>>]>>;
191
+ text: z.ZodDefault<z.ZodString>;
192
+ type: z.ZodDefault<z.ZodLiteral<"text">>;
193
+ }, z.core.$strip>>, z.ZodPipe<z.ZodObject<{}, z.core.$strict>, z.ZodTransform<never[], Record<string, never>>>]>>;
194
+ type: z.ZodDefault<z.ZodLiteral<"paragraph">>;
195
+ }, z.core.$strip>>, z.ZodPipe<z.ZodObject<{}, z.core.$strict>, z.ZodTransform<never[], Record<string, never>>>]>>;
196
+ type: z.ZodDefault<z.ZodLiteral<"doc">>;
197
+ }, z.core.$strip>>;
136
198
  discountedFrom: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
137
199
  price: "price";
138
200
  compare_at_price: "compare_at_price";
@@ -149,18 +211,6 @@ export declare const PostPurchasePreparation: z.ZodDiscriminatedUnion<[z.ZodObje
149
211
  language: z.ZodObject<{
150
212
  description: z.ZodDefault<z.ZodUnion<readonly [z.ZodString, z.ZodPipe<z.ZodUnknown, z.ZodTransform<string, unknown>>]>>;
151
213
  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
214
  }, z.core.$strip>;
165
215
  primaryImage: z.ZodObject<{
166
216
  description: z.ZodString;
@@ -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>;