@rebuy/rebuy 3.32.0 → 3.34.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.
- package/README.md +1 -1
- package/dist/cab/index.cjs +12 -1
- package/dist/cab/index.d.ts +1 -0
- package/dist/cab/index.mjs +12 -1
- package/dist/cab/utf8ByteLength.d.ts +6 -0
- package/dist/index.cjs +1138 -923
- package/dist/index.d.ts +1 -0
- package/dist/index.mjs +1138 -923
- package/dist/pricing/postPurchaseSubscriptionDisplay.d.ts +5 -0
- package/dist/schema/index.d.ts +8 -0
- package/dist/schema/postPurchaseChoice.d.ts +25 -0
- package/dist/schema/postPurchaseDiscount.d.ts +22 -0
- package/dist/schema/postPurchasePlanAdjustment.d.ts +11 -0
- package/dist/schema/postPurchasePlanCatalog.d.ts +42 -0
- package/dist/schema/postPurchaseProduct.d.ts +260 -0
- package/dist/schema/postPurchaseProductSettings.d.ts +1 -1
- package/dist/schema/postPurchaseProductSource.d.ts +2 -2
- package/dist/schema/postPurchaseSubscription.d.ts +21 -0
- package/dist/schema/postPurchaseSubscriptionDisplay.d.ts +10 -0
- package/dist/schema/postPurchaseSubscriptionProduct.d.ts +224 -0
- package/dist/schema/postPurchaseSubscriptionSettings.d.ts +22 -0
- package/dist/schema/widgets/checkout-and-beyond/banner.d.ts +1 -1
- package/dist/schema/widgets/checkout-and-beyond/carousel.d.ts +1 -1
- package/dist/schema/widgets/checkout-and-beyond/cartLine.d.ts +1 -1
- package/dist/schema/widgets/checkout-and-beyond/common.d.ts +1 -1
- package/dist/schema/widgets/checkout-and-beyond/dataSource.d.ts +2 -2
- package/dist/schema/widgets/checkout-and-beyond/discount.d.ts +1 -1
- package/dist/schema/widgets/checkout-and-beyond/icons.d.ts +1 -1
- package/dist/schema/widgets/checkout-and-beyond/image.d.ts +2 -2
- package/dist/schema/widgets/checkout-and-beyond/offers.d.ts +1 -1
- package/dist/schema/widgets/checkout-and-beyond/progressBar.d.ts +1 -1
- package/dist/schema/widgets/post-purchase-offer/postPurchaseOffer.d.ts +2 -2
- package/dist/schema/widgets/post-purchase-offer/postPurchaseSettings.d.ts +2 -2
- package/dist/schema/widgets/post-purchase-offer/postPurchaseWidget.d.ts +2 -2
- package/dist/server/__fixtures__/postPurchaseLegacyPlans.d.ts +35 -0
- package/dist/server/__fixtures__/postPurchaseSubscription.d.ts +75 -0
- package/dist/server/index.cjs +802 -118
- package/dist/server/index.d.ts +3 -1
- package/dist/server/index.mjs +802 -118
- package/dist/server/normalizePostPurchaseCollection.d.ts +16 -16
- package/dist/server/normalizePostPurchaseProduct.d.ts +9 -9
- package/dist/server/postPurchaseLegacyPlans.d.ts +3 -0
- package/dist/server/postPurchaseModernPlans.d.ts +7 -0
- package/dist/server/postPurchasePlanAdjustment.d.ts +3 -0
- package/dist/server/postPurchasePlanCatalog.d.ts +5 -0
- package/dist/server/postPurchaseSubscriptionEligibility.d.ts +5 -0
- package/dist/server/prepareNormalizedSubscription.d.ts +11 -0
- package/dist/server/preparePostPurchaseSubscription.d.ts +102 -0
- package/dist/server/projectPostPurchaseProduct.d.ts +7 -7
- package/dist/server/requestSchemas.d.ts +1 -1
- package/dist/server/selectPostPurchaseChoice.d.ts +43 -0
- package/package.json +1 -1
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { z } from 'zod';
|
|
2
|
+
import type { PreparedPostPurchaseProduct } from '../schema/postPurchaseProduct';
|
|
3
|
+
import { PostPurchaseSubscriptionDisplay } from '../schema/postPurchaseSubscriptionDisplay';
|
|
4
|
+
/** Plan first, Widget second; compare-at changes the comparison, never the reduction base. */
|
|
5
|
+
export declare const postPurchaseSubscriptionDisplay: (prepared: z.infer<typeof PreparedPostPurchaseProduct>, currencyCode: string) => PostPurchaseSubscriptionDisplay | undefined;
|
package/dist/schema/index.d.ts
CHANGED
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
export * from './cabShopConfig';
|
|
2
2
|
export * from './metadata';
|
|
3
3
|
export * from './offerProduct';
|
|
4
|
+
export * from './postPurchaseChoice';
|
|
5
|
+
export * from './postPurchaseDiscount';
|
|
4
6
|
export * from './postPurchaseEligibility';
|
|
5
7
|
export * from './postPurchaseExitPolicy';
|
|
6
8
|
export * from './postPurchaseIdentity';
|
|
7
9
|
export * from './postPurchaseOrderDecision';
|
|
10
|
+
export * from './postPurchasePlanAdjustment';
|
|
11
|
+
export * from './postPurchasePlanCatalog';
|
|
8
12
|
export * from './postPurchasePolicy';
|
|
13
|
+
export * from './postPurchaseProduct';
|
|
9
14
|
export * from './postPurchaseProductCollectionView';
|
|
10
15
|
export * from './postPurchaseProductDisplay';
|
|
11
16
|
export * from './postPurchaseProductGallery';
|
|
@@ -16,6 +21,9 @@ export * from './postPurchaseSession';
|
|
|
16
21
|
export * from './postPurchaseSessionClose';
|
|
17
22
|
export * from './postPurchaseShadow';
|
|
18
23
|
export * from './postPurchaseSkipTrace';
|
|
24
|
+
export * from './postPurchaseSubscription';
|
|
25
|
+
export * from './postPurchaseSubscriptionDisplay';
|
|
26
|
+
export { PreparedPostPurchaseSubscription } from './postPurchaseSubscriptionProduct';
|
|
19
27
|
export * from './postPurchaseVariantCatalog';
|
|
20
28
|
export * from './postPurchaseVariantDefault';
|
|
21
29
|
export * from './product';
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const PostPurchaseChoice: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
3
|
+
mode: z.ZodLiteral<"one-time">;
|
|
4
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
5
|
+
mode: z.ZodLiteral<"subscription">;
|
|
6
|
+
sellingPlanId: z.ZodNumber;
|
|
7
|
+
}, z.core.$strict>], "mode">;
|
|
8
|
+
export type PostPurchaseChoice = z.infer<typeof PostPurchaseChoice>;
|
|
9
|
+
export declare const PostPurchaseOptions: z.ZodObject<{
|
|
10
|
+
defaultChoice: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
11
|
+
mode: z.ZodLiteral<"one-time">;
|
|
12
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
13
|
+
mode: z.ZodLiteral<"subscription">;
|
|
14
|
+
sellingPlanId: z.ZodNumber;
|
|
15
|
+
}, z.core.$strict>], "mode">;
|
|
16
|
+
modes: z.ZodArray<z.ZodEnum<{
|
|
17
|
+
"one-time": "one-time";
|
|
18
|
+
subscription: "subscription";
|
|
19
|
+
}>>;
|
|
20
|
+
selector: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
21
|
+
radio: "radio";
|
|
22
|
+
dropdown: "dropdown";
|
|
23
|
+
}>>>;
|
|
24
|
+
}, z.core.$strip>;
|
|
25
|
+
export type PostPurchaseOptions = z.infer<typeof PostPurchaseOptions>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
declare const Discount: z.ZodObject<{
|
|
3
|
+
amount: z.ZodNumber;
|
|
4
|
+
title: z.ZodString;
|
|
5
|
+
type: z.ZodEnum<{
|
|
6
|
+
none: "none";
|
|
7
|
+
fixed_amount: "fixed_amount";
|
|
8
|
+
percentage: "percentage";
|
|
9
|
+
}>;
|
|
10
|
+
}, z.core.$strip>;
|
|
11
|
+
export declare const validPostPurchaseDiscount: (discount: Pick<z.infer<typeof Discount>, "amount" | "type">) => boolean;
|
|
12
|
+
export declare const PostPurchaseDiscount: z.ZodObject<{
|
|
13
|
+
amount: z.ZodNumber;
|
|
14
|
+
title: z.ZodString;
|
|
15
|
+
type: z.ZodEnum<{
|
|
16
|
+
none: "none";
|
|
17
|
+
fixed_amount: "fixed_amount";
|
|
18
|
+
percentage: "percentage";
|
|
19
|
+
}>;
|
|
20
|
+
}, z.core.$strip>;
|
|
21
|
+
export type PostPurchaseDiscount = z.infer<typeof PostPurchaseDiscount>;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/** First selected-plan display adjustment, never an explicit Widget charge or renewal quote. */
|
|
3
|
+
export declare const PostPurchasePlanAdjustment: z.ZodObject<{
|
|
4
|
+
amount: z.ZodNumber;
|
|
5
|
+
type: z.ZodEnum<{
|
|
6
|
+
price: "price";
|
|
7
|
+
fixed_amount: "fixed_amount";
|
|
8
|
+
percentage: "percentage";
|
|
9
|
+
}>;
|
|
10
|
+
}, z.core.$strip>;
|
|
11
|
+
export type PostPurchasePlanAdjustment = z.infer<typeof PostPurchasePlanAdjustment>;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* One catalog shape for both producers, which differ only in `intervalFrequency`: legacy Core rows always carry it,
|
|
4
|
+
* while a modern plan's cadence arrives only as option text (`options[0].value` → `intervalLabel`), so it is never
|
|
5
|
+
* set there. Display reads `intervalLabel`; nothing may require the frequency.
|
|
6
|
+
*/
|
|
7
|
+
export declare const PostPurchasePlanOption: z.ZodObject<{
|
|
8
|
+
adjustment: z.ZodOptional<z.ZodObject<{
|
|
9
|
+
amount: z.ZodNumber;
|
|
10
|
+
type: z.ZodEnum<{
|
|
11
|
+
price: "price";
|
|
12
|
+
fixed_amount: "fixed_amount";
|
|
13
|
+
percentage: "percentage";
|
|
14
|
+
}>;
|
|
15
|
+
}, z.core.$strip>>;
|
|
16
|
+
id: z.ZodNumber;
|
|
17
|
+
intervalFrequency: z.ZodOptional<z.ZodString>;
|
|
18
|
+
intervalLabel: z.ZodString;
|
|
19
|
+
name: z.ZodString;
|
|
20
|
+
}, z.core.$strip>;
|
|
21
|
+
export type PostPurchasePlanOption = z.infer<typeof PostPurchasePlanOption>;
|
|
22
|
+
/** Ordered eligible choices, not permission to admit a client-supplied selection. */
|
|
23
|
+
export declare const PostPurchasePlanCatalog: z.ZodObject<{
|
|
24
|
+
plans: z.ZodArray<z.ZodObject<{
|
|
25
|
+
adjustment: z.ZodOptional<z.ZodObject<{
|
|
26
|
+
amount: z.ZodNumber;
|
|
27
|
+
type: z.ZodEnum<{
|
|
28
|
+
price: "price";
|
|
29
|
+
fixed_amount: "fixed_amount";
|
|
30
|
+
percentage: "percentage";
|
|
31
|
+
}>;
|
|
32
|
+
}, z.core.$strip>>;
|
|
33
|
+
id: z.ZodNumber;
|
|
34
|
+
intervalFrequency: z.ZodOptional<z.ZodString>;
|
|
35
|
+
intervalLabel: z.ZodString;
|
|
36
|
+
name: z.ZodString;
|
|
37
|
+
}, z.core.$strip>>;
|
|
38
|
+
productId: z.ZodNumber;
|
|
39
|
+
requiresSellingPlan: z.ZodBoolean;
|
|
40
|
+
variantId: z.ZodNumber;
|
|
41
|
+
}, z.core.$strip>;
|
|
42
|
+
export type PostPurchasePlanCatalog = z.infer<typeof PostPurchasePlanCatalog>;
|
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const PostPurchaseVariant: z.ZodObject<{
|
|
3
|
+
title: z.ZodString;
|
|
4
|
+
compareAtPrice: z.ZodNullable<z.ZodString>;
|
|
5
|
+
id: z.ZodNumber;
|
|
6
|
+
price: z.ZodString;
|
|
7
|
+
}, z.core.$strip>;
|
|
8
|
+
export type PostPurchaseVariant = z.infer<typeof PostPurchaseVariant>;
|
|
9
|
+
/** One prepared purchasable product: the display, the exact selection and the terms a changeset is built from. */
|
|
10
|
+
export declare const PreparedPostPurchaseProduct: z.ZodObject<{
|
|
11
|
+
display: z.ZodObject<{
|
|
12
|
+
discountedFrom: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
13
|
+
price: "price";
|
|
14
|
+
compare_at_price: "compare_at_price";
|
|
15
|
+
}>>>;
|
|
16
|
+
gallery: z.ZodOptional<z.ZodObject<{
|
|
17
|
+
images: z.ZodArray<z.ZodObject<{
|
|
18
|
+
description: z.ZodString;
|
|
19
|
+
id: z.ZodNumber;
|
|
20
|
+
source: z.ZodString;
|
|
21
|
+
thumbnail: z.ZodString;
|
|
22
|
+
}, z.core.$strip>>;
|
|
23
|
+
selectedImageId: z.ZodOptional<z.ZodNumber>;
|
|
24
|
+
}, z.core.$strip>>;
|
|
25
|
+
language: z.ZodObject<{
|
|
26
|
+
description: z.ZodDefault<z.ZodUnion<readonly [z.ZodString, z.ZodPipe<z.ZodUnknown, z.ZodTransform<string, unknown>>]>>;
|
|
27
|
+
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
|
+
}, z.core.$strip>;
|
|
41
|
+
primaryImage: z.ZodObject<{
|
|
42
|
+
description: z.ZodString;
|
|
43
|
+
source: z.ZodString;
|
|
44
|
+
}, z.core.$strip>;
|
|
45
|
+
productOptions: z.ZodObject<{
|
|
46
|
+
showDeclineAll: z.ZodOptional<z.ZodEnum<{
|
|
47
|
+
none: "none";
|
|
48
|
+
both: "both";
|
|
49
|
+
above: "above";
|
|
50
|
+
below: "below";
|
|
51
|
+
}>>;
|
|
52
|
+
showShipping: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
53
|
+
showSubtotal: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
54
|
+
showTaxes: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
55
|
+
showTotal: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
56
|
+
showVariantSelectors: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
57
|
+
}, z.core.$strip>;
|
|
58
|
+
responseDescription: z.ZodDefault<z.ZodUnion<readonly [z.ZodString, z.ZodPipe<z.ZodUnknown, z.ZodTransform<string, unknown>>]>>;
|
|
59
|
+
shouldShowSavingText: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
60
|
+
}, z.core.$strip>;
|
|
61
|
+
labels: z.ZodObject<{
|
|
62
|
+
declineAll: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
63
|
+
free: z.ZodString;
|
|
64
|
+
payNow: z.ZodString;
|
|
65
|
+
quantity: z.ZodString;
|
|
66
|
+
recurringShipping: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
67
|
+
recurringSubtotal: z.ZodDefault<z.ZodString>;
|
|
68
|
+
save: z.ZodString;
|
|
69
|
+
shipping: z.ZodString;
|
|
70
|
+
subtotal: z.ZodString;
|
|
71
|
+
taxes: z.ZodString;
|
|
72
|
+
total: z.ZodString;
|
|
73
|
+
}, z.core.$strip>;
|
|
74
|
+
product: z.ZodObject<{
|
|
75
|
+
title: z.ZodString;
|
|
76
|
+
image: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
77
|
+
src: z.ZodString;
|
|
78
|
+
}, z.core.$strip>>>;
|
|
79
|
+
description: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
80
|
+
id: z.ZodNumber;
|
|
81
|
+
variant: z.ZodObject<{
|
|
82
|
+
title: z.ZodString;
|
|
83
|
+
compareAtPrice: z.ZodNullable<z.ZodString>;
|
|
84
|
+
id: z.ZodNumber;
|
|
85
|
+
price: z.ZodString;
|
|
86
|
+
}, z.core.$strip>;
|
|
87
|
+
}, z.core.$strip>;
|
|
88
|
+
selection: z.ZodObject<{
|
|
89
|
+
productId: z.ZodNumber;
|
|
90
|
+
quantity: z.ZodNumber;
|
|
91
|
+
sellingPlanId: z.ZodOptional<z.ZodNumber>;
|
|
92
|
+
variantId: z.ZodNumber;
|
|
93
|
+
}, z.core.$strip>;
|
|
94
|
+
status: z.ZodLiteral<"prepared">;
|
|
95
|
+
terms: z.ZodObject<{
|
|
96
|
+
discount: z.ZodObject<{
|
|
97
|
+
amount: z.ZodNumber;
|
|
98
|
+
title: z.ZodString;
|
|
99
|
+
type: z.ZodEnum<{
|
|
100
|
+
none: "none";
|
|
101
|
+
fixed_amount: "fixed_amount";
|
|
102
|
+
percentage: "percentage";
|
|
103
|
+
}>;
|
|
104
|
+
}, z.core.$strip>;
|
|
105
|
+
shipping: z.ZodObject<{
|
|
106
|
+
amount: z.ZodNumber;
|
|
107
|
+
title: z.ZodString;
|
|
108
|
+
type: z.ZodEnum<{
|
|
109
|
+
fixed_amount: "fixed_amount";
|
|
110
|
+
free: "free";
|
|
111
|
+
}>;
|
|
112
|
+
}, z.core.$strip>;
|
|
113
|
+
subscription: z.ZodOptional<z.ZodObject<{
|
|
114
|
+
adjustment: z.ZodOptional<z.ZodObject<{
|
|
115
|
+
amount: z.ZodNumber;
|
|
116
|
+
type: z.ZodEnum<{
|
|
117
|
+
price: "price";
|
|
118
|
+
fixed_amount: "fixed_amount";
|
|
119
|
+
percentage: "percentage";
|
|
120
|
+
}>;
|
|
121
|
+
}, z.core.$strip>>;
|
|
122
|
+
initialShippingPrice: z.ZodNumber;
|
|
123
|
+
intervalLabel: z.ZodString;
|
|
124
|
+
name: z.ZodString;
|
|
125
|
+
recurringShippingPrice: z.ZodNumber;
|
|
126
|
+
shippingOption: z.ZodObject<{
|
|
127
|
+
presentmentTitle: z.ZodString;
|
|
128
|
+
title: z.ZodString;
|
|
129
|
+
}, z.core.$strip>;
|
|
130
|
+
}, z.core.$strip>>;
|
|
131
|
+
}, z.core.$strip>;
|
|
132
|
+
}, z.core.$strip>;
|
|
133
|
+
export type PreparedPostPurchaseProduct = z.infer<typeof PreparedPostPurchaseProduct>;
|
|
134
|
+
export declare const PostPurchasePreparation: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
135
|
+
display: z.ZodObject<{
|
|
136
|
+
discountedFrom: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
137
|
+
price: "price";
|
|
138
|
+
compare_at_price: "compare_at_price";
|
|
139
|
+
}>>>;
|
|
140
|
+
gallery: z.ZodOptional<z.ZodObject<{
|
|
141
|
+
images: z.ZodArray<z.ZodObject<{
|
|
142
|
+
description: z.ZodString;
|
|
143
|
+
id: z.ZodNumber;
|
|
144
|
+
source: z.ZodString;
|
|
145
|
+
thumbnail: z.ZodString;
|
|
146
|
+
}, z.core.$strip>>;
|
|
147
|
+
selectedImageId: z.ZodOptional<z.ZodNumber>;
|
|
148
|
+
}, z.core.$strip>>;
|
|
149
|
+
language: z.ZodObject<{
|
|
150
|
+
description: z.ZodDefault<z.ZodUnion<readonly [z.ZodString, z.ZodPipe<z.ZodUnknown, z.ZodTransform<string, unknown>>]>>;
|
|
151
|
+
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
|
+
}, z.core.$strip>;
|
|
165
|
+
primaryImage: z.ZodObject<{
|
|
166
|
+
description: z.ZodString;
|
|
167
|
+
source: z.ZodString;
|
|
168
|
+
}, z.core.$strip>;
|
|
169
|
+
productOptions: z.ZodObject<{
|
|
170
|
+
showDeclineAll: z.ZodOptional<z.ZodEnum<{
|
|
171
|
+
none: "none";
|
|
172
|
+
both: "both";
|
|
173
|
+
above: "above";
|
|
174
|
+
below: "below";
|
|
175
|
+
}>>;
|
|
176
|
+
showShipping: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
177
|
+
showSubtotal: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
178
|
+
showTaxes: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
179
|
+
showTotal: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
180
|
+
showVariantSelectors: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
181
|
+
}, z.core.$strip>;
|
|
182
|
+
responseDescription: z.ZodDefault<z.ZodUnion<readonly [z.ZodString, z.ZodPipe<z.ZodUnknown, z.ZodTransform<string, unknown>>]>>;
|
|
183
|
+
shouldShowSavingText: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
184
|
+
}, z.core.$strip>;
|
|
185
|
+
labels: z.ZodObject<{
|
|
186
|
+
declineAll: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
187
|
+
free: z.ZodString;
|
|
188
|
+
payNow: z.ZodString;
|
|
189
|
+
quantity: z.ZodString;
|
|
190
|
+
recurringShipping: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
191
|
+
recurringSubtotal: z.ZodDefault<z.ZodString>;
|
|
192
|
+
save: z.ZodString;
|
|
193
|
+
shipping: z.ZodString;
|
|
194
|
+
subtotal: z.ZodString;
|
|
195
|
+
taxes: z.ZodString;
|
|
196
|
+
total: z.ZodString;
|
|
197
|
+
}, z.core.$strip>;
|
|
198
|
+
product: z.ZodObject<{
|
|
199
|
+
title: z.ZodString;
|
|
200
|
+
image: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
201
|
+
src: z.ZodString;
|
|
202
|
+
}, z.core.$strip>>>;
|
|
203
|
+
description: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
204
|
+
id: z.ZodNumber;
|
|
205
|
+
variant: z.ZodObject<{
|
|
206
|
+
title: z.ZodString;
|
|
207
|
+
compareAtPrice: z.ZodNullable<z.ZodString>;
|
|
208
|
+
id: z.ZodNumber;
|
|
209
|
+
price: z.ZodString;
|
|
210
|
+
}, z.core.$strip>;
|
|
211
|
+
}, z.core.$strip>;
|
|
212
|
+
selection: z.ZodObject<{
|
|
213
|
+
productId: z.ZodNumber;
|
|
214
|
+
quantity: z.ZodNumber;
|
|
215
|
+
sellingPlanId: z.ZodOptional<z.ZodNumber>;
|
|
216
|
+
variantId: z.ZodNumber;
|
|
217
|
+
}, z.core.$strip>;
|
|
218
|
+
status: z.ZodLiteral<"prepared">;
|
|
219
|
+
terms: z.ZodObject<{
|
|
220
|
+
discount: z.ZodObject<{
|
|
221
|
+
amount: z.ZodNumber;
|
|
222
|
+
title: z.ZodString;
|
|
223
|
+
type: z.ZodEnum<{
|
|
224
|
+
none: "none";
|
|
225
|
+
fixed_amount: "fixed_amount";
|
|
226
|
+
percentage: "percentage";
|
|
227
|
+
}>;
|
|
228
|
+
}, z.core.$strip>;
|
|
229
|
+
shipping: z.ZodObject<{
|
|
230
|
+
amount: z.ZodNumber;
|
|
231
|
+
title: z.ZodString;
|
|
232
|
+
type: z.ZodEnum<{
|
|
233
|
+
fixed_amount: "fixed_amount";
|
|
234
|
+
free: "free";
|
|
235
|
+
}>;
|
|
236
|
+
}, z.core.$strip>;
|
|
237
|
+
subscription: z.ZodOptional<z.ZodObject<{
|
|
238
|
+
adjustment: z.ZodOptional<z.ZodObject<{
|
|
239
|
+
amount: z.ZodNumber;
|
|
240
|
+
type: z.ZodEnum<{
|
|
241
|
+
price: "price";
|
|
242
|
+
fixed_amount: "fixed_amount";
|
|
243
|
+
percentage: "percentage";
|
|
244
|
+
}>;
|
|
245
|
+
}, z.core.$strip>>;
|
|
246
|
+
initialShippingPrice: z.ZodNumber;
|
|
247
|
+
intervalLabel: z.ZodString;
|
|
248
|
+
name: z.ZodString;
|
|
249
|
+
recurringShippingPrice: z.ZodNumber;
|
|
250
|
+
shippingOption: z.ZodObject<{
|
|
251
|
+
presentmentTitle: z.ZodString;
|
|
252
|
+
title: z.ZodString;
|
|
253
|
+
}, z.core.$strip>;
|
|
254
|
+
}, z.core.$strip>>;
|
|
255
|
+
}, z.core.$strip>;
|
|
256
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
257
|
+
reason: z.ZodString;
|
|
258
|
+
status: z.ZodLiteral<"unsupported">;
|
|
259
|
+
}, z.core.$strip>], "status">;
|
|
260
|
+
export type PostPurchasePreparation = z.infer<typeof PostPurchasePreparation>;
|
|
@@ -95,8 +95,8 @@ export declare const PostPurchaseProductSettings: z.ZodObject<{
|
|
|
95
95
|
shouldShowSavingText: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
96
96
|
type: z.ZodDefault<z.ZodEnum<{
|
|
97
97
|
none: "none";
|
|
98
|
-
percentage: "percentage";
|
|
99
98
|
fixed_amount: "fixed_amount";
|
|
99
|
+
percentage: "percentage";
|
|
100
100
|
}>>;
|
|
101
101
|
amount: z.ZodDefault<z.ZodUnion<readonly [z.ZodNumber, z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>]>>;
|
|
102
102
|
}, z.core.$strip>;
|
|
@@ -35,11 +35,11 @@ export declare const PostPurchaseProductSource: z.ZodObject<{
|
|
|
35
35
|
options: z.ZodOptional<z.ZodUnknown>;
|
|
36
36
|
productGroupVariants: z.ZodDefault<z.ZodArray<z.ZodUnknown>>;
|
|
37
37
|
selectedVariant: z.ZodOptional<z.ZodUnknown>;
|
|
38
|
-
sellingPlanGroups: z.
|
|
39
|
-
requiresSellingPlan: z.ZodOptional<z.ZodBoolean>;
|
|
38
|
+
sellingPlanGroups: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
40
39
|
discountAmount: z.ZodOptional<z.ZodUnknown>;
|
|
41
40
|
discountType: z.ZodOptional<z.ZodUnknown>;
|
|
42
41
|
id: z.ZodOptional<z.ZodUnknown>;
|
|
42
|
+
requiresSellingPlan: z.ZodDefault<z.ZodBoolean>;
|
|
43
43
|
sellingPlans: z.ZodOptional<z.ZodUnknown>;
|
|
44
44
|
}, z.core.$strip>>>;
|
|
45
45
|
variants: z.ZodArray<z.ZodObject<{
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/** Display and shipping facts for the selected plan; no inferred renewal date or tax quote. */
|
|
3
|
+
export declare const PostPurchaseSubscriptionTerms: z.ZodObject<{
|
|
4
|
+
adjustment: z.ZodOptional<z.ZodObject<{
|
|
5
|
+
amount: z.ZodNumber;
|
|
6
|
+
type: z.ZodEnum<{
|
|
7
|
+
price: "price";
|
|
8
|
+
fixed_amount: "fixed_amount";
|
|
9
|
+
percentage: "percentage";
|
|
10
|
+
}>;
|
|
11
|
+
}, z.core.$strip>>;
|
|
12
|
+
initialShippingPrice: z.ZodNumber;
|
|
13
|
+
intervalLabel: z.ZodString;
|
|
14
|
+
name: z.ZodString;
|
|
15
|
+
recurringShippingPrice: z.ZodNumber;
|
|
16
|
+
shippingOption: z.ZodObject<{
|
|
17
|
+
presentmentTitle: z.ZodString;
|
|
18
|
+
title: z.ZodString;
|
|
19
|
+
}, z.core.$strip>;
|
|
20
|
+
}, z.core.$strip>;
|
|
21
|
+
export type PostPurchaseSubscriptionTerms = z.infer<typeof PostPurchaseSubscriptionTerms>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/** Unit-price display estimate from configured facts, separate from Shopify's calculated charge. */
|
|
3
|
+
export declare const PostPurchaseSubscriptionDisplay: z.ZodObject<{
|
|
4
|
+
comparisonMinor: z.ZodNumber;
|
|
5
|
+
currencyCode: z.ZodString;
|
|
6
|
+
priceMinor: z.ZodNumber;
|
|
7
|
+
savingMinor: z.ZodNumber;
|
|
8
|
+
savingPercent: z.ZodNumber;
|
|
9
|
+
}, z.core.$strip>;
|
|
10
|
+
export type PostPurchaseSubscriptionDisplay = z.infer<typeof PostPurchaseSubscriptionDisplay>;
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { PreparedPostPurchaseProduct } from './postPurchaseProduct';
|
|
3
|
+
export declare const PreparedPostPurchaseSubscription: z.ZodObject<{
|
|
4
|
+
display: z.ZodObject<{
|
|
5
|
+
discountedFrom: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
6
|
+
price: "price";
|
|
7
|
+
compare_at_price: "compare_at_price";
|
|
8
|
+
}>>>;
|
|
9
|
+
gallery: z.ZodOptional<z.ZodObject<{
|
|
10
|
+
images: z.ZodArray<z.ZodObject<{
|
|
11
|
+
description: z.ZodString;
|
|
12
|
+
id: z.ZodNumber;
|
|
13
|
+
source: z.ZodString;
|
|
14
|
+
thumbnail: z.ZodString;
|
|
15
|
+
}, z.core.$strip>>;
|
|
16
|
+
selectedImageId: z.ZodOptional<z.ZodNumber>;
|
|
17
|
+
}, z.core.$strip>>;
|
|
18
|
+
language: z.ZodObject<{
|
|
19
|
+
description: z.ZodDefault<z.ZodUnion<readonly [z.ZodString, z.ZodPipe<z.ZodUnknown, z.ZodTransform<string, unknown>>]>>;
|
|
20
|
+
descriptionEnabled: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
21
|
+
descriptionRte: z.ZodOptional<z.ZodObject<{
|
|
22
|
+
content: z.ZodArray<z.ZodUnknown>;
|
|
23
|
+
type: z.ZodString;
|
|
24
|
+
}, z.core.$strip>>;
|
|
25
|
+
descriptionSpacing: z.ZodOptional<z.ZodEnum<{
|
|
26
|
+
default: "default";
|
|
27
|
+
none: "none";
|
|
28
|
+
tight: "tight";
|
|
29
|
+
loose: "loose";
|
|
30
|
+
xtight: "xtight";
|
|
31
|
+
xloose: "xloose";
|
|
32
|
+
}>>;
|
|
33
|
+
}, z.core.$strip>;
|
|
34
|
+
primaryImage: z.ZodObject<{
|
|
35
|
+
description: z.ZodString;
|
|
36
|
+
source: z.ZodString;
|
|
37
|
+
}, z.core.$strip>;
|
|
38
|
+
productOptions: z.ZodObject<{
|
|
39
|
+
showDeclineAll: z.ZodOptional<z.ZodEnum<{
|
|
40
|
+
none: "none";
|
|
41
|
+
both: "both";
|
|
42
|
+
above: "above";
|
|
43
|
+
below: "below";
|
|
44
|
+
}>>;
|
|
45
|
+
showShipping: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
46
|
+
showSubtotal: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
47
|
+
showTaxes: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
48
|
+
showTotal: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
49
|
+
showVariantSelectors: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
50
|
+
}, z.core.$strip>;
|
|
51
|
+
responseDescription: z.ZodDefault<z.ZodUnion<readonly [z.ZodString, z.ZodPipe<z.ZodUnknown, z.ZodTransform<string, unknown>>]>>;
|
|
52
|
+
shouldShowSavingText: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
53
|
+
}, z.core.$strip>;
|
|
54
|
+
labels: z.ZodObject<{
|
|
55
|
+
declineAll: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
56
|
+
free: z.ZodString;
|
|
57
|
+
payNow: z.ZodString;
|
|
58
|
+
quantity: z.ZodString;
|
|
59
|
+
recurringShipping: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
60
|
+
recurringSubtotal: z.ZodDefault<z.ZodString>;
|
|
61
|
+
save: z.ZodString;
|
|
62
|
+
shipping: z.ZodString;
|
|
63
|
+
subtotal: z.ZodString;
|
|
64
|
+
taxes: z.ZodString;
|
|
65
|
+
total: z.ZodString;
|
|
66
|
+
}, z.core.$strip>;
|
|
67
|
+
product: z.ZodObject<{
|
|
68
|
+
title: z.ZodString;
|
|
69
|
+
image: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
70
|
+
src: z.ZodString;
|
|
71
|
+
}, z.core.$strip>>>;
|
|
72
|
+
description: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
73
|
+
id: z.ZodNumber;
|
|
74
|
+
variant: z.ZodObject<{
|
|
75
|
+
title: z.ZodString;
|
|
76
|
+
compareAtPrice: z.ZodNullable<z.ZodString>;
|
|
77
|
+
id: z.ZodNumber;
|
|
78
|
+
price: z.ZodString;
|
|
79
|
+
}, z.core.$strip>;
|
|
80
|
+
}, z.core.$strip>;
|
|
81
|
+
status: z.ZodLiteral<"prepared">;
|
|
82
|
+
selection: z.ZodObject<{
|
|
83
|
+
productId: z.ZodNumber;
|
|
84
|
+
quantity: z.ZodNumber;
|
|
85
|
+
variantId: z.ZodNumber;
|
|
86
|
+
sellingPlanId: z.ZodNumber;
|
|
87
|
+
}, z.core.$strip>;
|
|
88
|
+
terms: z.ZodObject<{
|
|
89
|
+
discount: z.ZodObject<{
|
|
90
|
+
amount: z.ZodNumber;
|
|
91
|
+
title: z.ZodString;
|
|
92
|
+
type: z.ZodEnum<{
|
|
93
|
+
none: "none";
|
|
94
|
+
fixed_amount: "fixed_amount";
|
|
95
|
+
percentage: "percentage";
|
|
96
|
+
}>;
|
|
97
|
+
}, z.core.$strip>;
|
|
98
|
+
shipping: z.ZodObject<{
|
|
99
|
+
amount: z.ZodNumber;
|
|
100
|
+
title: z.ZodString;
|
|
101
|
+
type: z.ZodEnum<{
|
|
102
|
+
fixed_amount: "fixed_amount";
|
|
103
|
+
free: "free";
|
|
104
|
+
}>;
|
|
105
|
+
}, z.core.$strip>;
|
|
106
|
+
subscription: z.ZodObject<{
|
|
107
|
+
adjustment: z.ZodOptional<z.ZodObject<{
|
|
108
|
+
amount: z.ZodNumber;
|
|
109
|
+
type: z.ZodEnum<{
|
|
110
|
+
price: "price";
|
|
111
|
+
fixed_amount: "fixed_amount";
|
|
112
|
+
percentage: "percentage";
|
|
113
|
+
}>;
|
|
114
|
+
}, z.core.$strip>>;
|
|
115
|
+
initialShippingPrice: z.ZodNumber;
|
|
116
|
+
intervalLabel: z.ZodString;
|
|
117
|
+
name: z.ZodString;
|
|
118
|
+
recurringShippingPrice: z.ZodNumber;
|
|
119
|
+
shippingOption: z.ZodObject<{
|
|
120
|
+
presentmentTitle: z.ZodString;
|
|
121
|
+
title: z.ZodString;
|
|
122
|
+
}, z.core.$strip>;
|
|
123
|
+
}, z.core.$strip>;
|
|
124
|
+
}, z.core.$strip>;
|
|
125
|
+
}, z.core.$strip>;
|
|
126
|
+
export type PreparedPostPurchaseSubscription = z.infer<typeof PreparedPostPurchaseSubscription>;
|
|
127
|
+
/** Keep the composable base schema unrefined; enforce paired facts at executable boundaries. */
|
|
128
|
+
export declare const readPostPurchaseSubscription: (prepared: z.infer<typeof PreparedPostPurchaseProduct>) => {
|
|
129
|
+
display: {
|
|
130
|
+
discountedFrom: "price" | "compare_at_price";
|
|
131
|
+
language: {
|
|
132
|
+
description: string;
|
|
133
|
+
descriptionEnabled: boolean;
|
|
134
|
+
descriptionRte?: {
|
|
135
|
+
content: unknown[];
|
|
136
|
+
type: string;
|
|
137
|
+
} | undefined;
|
|
138
|
+
descriptionSpacing?: "default" | "none" | "tight" | "loose" | "xtight" | "xloose" | undefined;
|
|
139
|
+
};
|
|
140
|
+
primaryImage: {
|
|
141
|
+
description: string;
|
|
142
|
+
source: string;
|
|
143
|
+
};
|
|
144
|
+
productOptions: {
|
|
145
|
+
showShipping: boolean;
|
|
146
|
+
showSubtotal: boolean;
|
|
147
|
+
showTaxes: boolean;
|
|
148
|
+
showTotal: boolean;
|
|
149
|
+
showVariantSelectors: boolean;
|
|
150
|
+
showDeclineAll?: "none" | "both" | "above" | "below" | undefined;
|
|
151
|
+
};
|
|
152
|
+
responseDescription: string;
|
|
153
|
+
shouldShowSavingText: boolean;
|
|
154
|
+
gallery?: {
|
|
155
|
+
images: {
|
|
156
|
+
description: string;
|
|
157
|
+
id: number;
|
|
158
|
+
source: string;
|
|
159
|
+
thumbnail: string;
|
|
160
|
+
}[];
|
|
161
|
+
selectedImageId?: number | undefined;
|
|
162
|
+
} | undefined;
|
|
163
|
+
};
|
|
164
|
+
labels: {
|
|
165
|
+
declineAll: string;
|
|
166
|
+
free: string;
|
|
167
|
+
payNow: string;
|
|
168
|
+
quantity: string;
|
|
169
|
+
recurringShipping: string;
|
|
170
|
+
recurringSubtotal: string;
|
|
171
|
+
save: string;
|
|
172
|
+
shipping: string;
|
|
173
|
+
subtotal: string;
|
|
174
|
+
taxes: string;
|
|
175
|
+
total: string;
|
|
176
|
+
};
|
|
177
|
+
product: {
|
|
178
|
+
title: string;
|
|
179
|
+
id: number;
|
|
180
|
+
variant: {
|
|
181
|
+
title: string;
|
|
182
|
+
compareAtPrice: string | null;
|
|
183
|
+
id: number;
|
|
184
|
+
price: string;
|
|
185
|
+
};
|
|
186
|
+
image?: {
|
|
187
|
+
src: string;
|
|
188
|
+
} | null | undefined;
|
|
189
|
+
description?: string | null | undefined;
|
|
190
|
+
};
|
|
191
|
+
status: "prepared";
|
|
192
|
+
selection: {
|
|
193
|
+
productId: number;
|
|
194
|
+
quantity: number;
|
|
195
|
+
variantId: number;
|
|
196
|
+
sellingPlanId: number;
|
|
197
|
+
};
|
|
198
|
+
terms: {
|
|
199
|
+
discount: {
|
|
200
|
+
amount: number;
|
|
201
|
+
title: string;
|
|
202
|
+
type: "none" | "fixed_amount" | "percentage";
|
|
203
|
+
};
|
|
204
|
+
shipping: {
|
|
205
|
+
amount: number;
|
|
206
|
+
title: string;
|
|
207
|
+
type: "fixed_amount" | "free";
|
|
208
|
+
};
|
|
209
|
+
subscription: {
|
|
210
|
+
initialShippingPrice: number;
|
|
211
|
+
intervalLabel: string;
|
|
212
|
+
name: string;
|
|
213
|
+
recurringShippingPrice: number;
|
|
214
|
+
shippingOption: {
|
|
215
|
+
presentmentTitle: string;
|
|
216
|
+
title: string;
|
|
217
|
+
};
|
|
218
|
+
adjustment?: {
|
|
219
|
+
amount: number;
|
|
220
|
+
type: "price" | "fixed_amount" | "percentage";
|
|
221
|
+
} | undefined;
|
|
222
|
+
};
|
|
223
|
+
};
|
|
224
|
+
} | undefined;
|