@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.
- package/dist/index.cjs +799 -648
- package/dist/index.mjs +799 -648
- package/dist/schema/index.d.ts +4 -0
- package/dist/schema/postPurchaseGroup.d.ts +15 -0
- package/dist/schema/postPurchaseProduct.d.ts +102 -24
- package/dist/schema/postPurchaseProductCalculation.d.ts +87 -0
- package/dist/schema/postPurchaseProductCollectionView.d.ts +738 -3
- package/dist/schema/postPurchaseProductDisplay.d.ts +57 -16
- package/dist/schema/postPurchaseProductReviews.d.ts +36 -0
- package/dist/schema/postPurchaseProductView.d.ts +722 -0
- package/dist/schema/postPurchaseQuantity.d.ts +16 -3
- package/dist/schema/postPurchaseSubscriptionProduct.d.ts +98 -17
- package/dist/server/__fixtures__/postPurchaseGroup.d.ts +3 -0
- package/dist/server/__fixtures__/postPurchaseReviewProviders.d.ts +30 -0
- package/dist/server/__fixtures__/postPurchaseReviews.d.ts +67 -0
- package/dist/server/index.cjs +1014 -348
- package/dist/server/index.d.ts +13 -2
- package/dist/server/index.mjs +1014 -348
- package/dist/server/postPurchaseJudgeMeReviews.d.ts +6 -0
- package/dist/server/postPurchaseOkendoReviews.d.ts +6 -0
- package/dist/server/postPurchaseProductDisplay.d.ts +49 -7
- package/dist/server/postPurchaseReviewData.d.ts +7 -0
- package/dist/server/postPurchaseReviewFields.d.ts +7 -0
- package/dist/server/postPurchaseReviewProvider.d.ts +2 -0
- package/dist/server/postPurchaseReviews.d.ts +5 -0
- package/dist/server/postPurchaseScalarReviews.d.ts +6 -0
- package/dist/server/prepareNormalizedSubscription.d.ts +2 -2
- package/dist/server/preparePostPurchaseAdmissionView.d.ts +428 -0
- package/dist/server/preparePostPurchaseCollectionGroup.d.ts +468 -0
- package/dist/server/preparePostPurchaseCollectionView.d.ts +452 -0
- package/dist/server/preparePostPurchaseGroupAdmissionView.d.ts +469 -0
- package/dist/server/preparePostPurchaseGroupDefault.d.ts +469 -0
- package/dist/server/preparePostPurchaseGroupView.d.ts +468 -0
- package/dist/server/preparePostPurchaseMemberView.d.ts +1496 -0
- package/dist/server/preparePostPurchaseProduct.d.ts +8 -0
- package/dist/server/preparePostPurchaseQuantityAdmissionView.d.ts +450 -0
- package/dist/server/preparePostPurchaseQuantityView.d.ts +437 -0
- package/dist/server/preparePostPurchaseSubscription.d.ts +47 -5
- package/dist/server/preparePostPurchaseView.d.ts +8 -0
- package/dist/server/projectPostPurchaseProduct.d.ts +49 -6
- package/dist/transforms/postPurchase/convertDescriptionRte.d.ts +11 -0
- package/package.json +1 -1
|
@@ -1,8 +1,21 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
/** One member's buyer choice plus an optional explicit quantity. */
|
|
3
|
+
export declare const PostPurchaseQuantityChoice: 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
|
+
}, z.core.$strict>;
|
|
14
|
+
export type PostPurchaseQuantityChoice = z.infer<typeof PostPurchaseQuantityChoice>;
|
|
2
15
|
/**
|
|
3
|
-
* Today's picker bounds plus the trusted initial quantity
|
|
4
|
-
*
|
|
5
|
-
*
|
|
16
|
+
* Today's picker bounds plus the trusted initial quantity. A minimum of 0, which the settings schema accepts and
|
|
17
|
+
* maps unreadable values to, floors at 1: nothing can be bought at 0, and legacy still rendered that picker, so
|
|
18
|
+
* it must not refuse the Offer.
|
|
6
19
|
*/
|
|
7
20
|
export declare const PostPurchaseQuantityPolicy: z.ZodObject<{
|
|
8
21
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
@@ -2,6 +2,43 @@ import { z } from 'zod';
|
|
|
2
2
|
import { PreparedPostPurchaseProduct } from './postPurchaseProduct';
|
|
3
3
|
export declare const PreparedPostPurchaseSubscription: z.ZodObject<{
|
|
4
4
|
display: z.ZodObject<{
|
|
5
|
+
descriptionDocument: z.ZodOptional<z.ZodObject<{
|
|
6
|
+
attrs: z.ZodDefault<z.ZodObject<{
|
|
7
|
+
blockSpacing: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<"none" | "base" | "extraTight" | "tight" | "loose" | "extraLoose" | undefined, string>>>;
|
|
8
|
+
}, z.core.$strip>>;
|
|
9
|
+
content: z.ZodDefault<z.ZodUnion<readonly [z.ZodArray<z.ZodObject<{
|
|
10
|
+
attrs: z.ZodDefault<z.ZodObject<{
|
|
11
|
+
textAlign: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<"start" | "center" | "end" | undefined, string>>>;
|
|
12
|
+
}, z.core.$strip>>;
|
|
13
|
+
content: z.ZodDefault<z.ZodUnion<readonly [z.ZodArray<z.ZodObject<{
|
|
14
|
+
marks: z.ZodOptional<z.ZodUnion<readonly [z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
15
|
+
type: z.ZodLiteral<"bold">;
|
|
16
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
17
|
+
type: z.ZodLiteral<"italic">;
|
|
18
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
19
|
+
attrs: z.ZodObject<{
|
|
20
|
+
class: z.ZodNullable<z.ZodString>;
|
|
21
|
+
href: z.ZodUnion<readonly [z.ZodURL, z.ZodLiteral<"#">, z.ZodString, z.ZodString]>;
|
|
22
|
+
rel: z.ZodDefault<z.ZodString>;
|
|
23
|
+
target: z.ZodDefault<z.ZodString>;
|
|
24
|
+
}, z.core.$strip>;
|
|
25
|
+
type: z.ZodLiteral<"link">;
|
|
26
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
27
|
+
type: z.ZodLiteral<"strike">;
|
|
28
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
29
|
+
attrs: z.ZodObject<{
|
|
30
|
+
color: z.ZodDefault<z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<"success" | "warning" | "critical" | "base" | "decorative" | "subdued" | "accent" | undefined, string>>>>;
|
|
31
|
+
fontSize: z.ZodDefault<z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<"small" | "base" | "large" | "medium" | "extraSmall" | "extraLarge" | "heading" | undefined, string>>>>;
|
|
32
|
+
}, z.core.$strip>;
|
|
33
|
+
type: z.ZodLiteral<"textStyle">;
|
|
34
|
+
}, z.core.$strip>], "type">>, z.ZodPipe<z.ZodObject<{}, z.core.$strict>, z.ZodTransform<never[], Record<string, never>>>]>>;
|
|
35
|
+
text: z.ZodDefault<z.ZodString>;
|
|
36
|
+
type: z.ZodDefault<z.ZodLiteral<"text">>;
|
|
37
|
+
}, z.core.$strip>>, z.ZodPipe<z.ZodObject<{}, z.core.$strict>, z.ZodTransform<never[], Record<string, never>>>]>>;
|
|
38
|
+
type: z.ZodDefault<z.ZodLiteral<"paragraph">>;
|
|
39
|
+
}, z.core.$strip>>, z.ZodPipe<z.ZodObject<{}, z.core.$strict>, z.ZodTransform<never[], Record<string, never>>>]>>;
|
|
40
|
+
type: z.ZodDefault<z.ZodLiteral<"doc">>;
|
|
41
|
+
}, z.core.$strip>>;
|
|
5
42
|
discountedFrom: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
6
43
|
price: "price";
|
|
7
44
|
compare_at_price: "compare_at_price";
|
|
@@ -18,18 +55,6 @@ export declare const PreparedPostPurchaseSubscription: z.ZodObject<{
|
|
|
18
55
|
language: z.ZodObject<{
|
|
19
56
|
description: z.ZodDefault<z.ZodUnion<readonly [z.ZodString, z.ZodPipe<z.ZodUnknown, z.ZodTransform<string, unknown>>]>>;
|
|
20
57
|
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
58
|
}, z.core.$strip>;
|
|
34
59
|
primaryImage: z.ZodObject<{
|
|
35
60
|
description: z.ZodString;
|
|
@@ -49,6 +74,20 @@ export declare const PreparedPostPurchaseSubscription: z.ZodObject<{
|
|
|
49
74
|
showVariantSelectors: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
50
75
|
}, z.core.$strip>;
|
|
51
76
|
responseDescription: z.ZodDefault<z.ZodUnion<readonly [z.ZodString, z.ZodPipe<z.ZodUnknown, z.ZodTransform<string, unknown>>]>>;
|
|
77
|
+
reviews: z.ZodDefault<z.ZodNullable<z.ZodObject<{
|
|
78
|
+
color: z.ZodString;
|
|
79
|
+
rating: z.ZodNumber;
|
|
80
|
+
reviewCount: z.ZodNumber;
|
|
81
|
+
reviewsPlural: z.ZodString;
|
|
82
|
+
reviewsSingular: z.ZodString;
|
|
83
|
+
size: z.ZodEnum<{
|
|
84
|
+
small: "small";
|
|
85
|
+
large: "large";
|
|
86
|
+
medium: "medium";
|
|
87
|
+
}>;
|
|
88
|
+
strokeColor: z.ZodString;
|
|
89
|
+
strokeWidth: z.ZodNumber;
|
|
90
|
+
}, z.core.$strip>>>;
|
|
52
91
|
shouldShowSavingText: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
53
92
|
}, z.core.$strip>;
|
|
54
93
|
labels: z.ZodObject<{
|
|
@@ -131,11 +170,6 @@ export declare const readPostPurchaseSubscription: (prepared: z.infer<typeof Pre
|
|
|
131
170
|
language: {
|
|
132
171
|
description: string;
|
|
133
172
|
descriptionEnabled: boolean;
|
|
134
|
-
descriptionRte?: {
|
|
135
|
-
content: unknown[];
|
|
136
|
-
type: string;
|
|
137
|
-
} | undefined;
|
|
138
|
-
descriptionSpacing?: "default" | "none" | "tight" | "loose" | "xtight" | "xloose" | undefined;
|
|
139
173
|
};
|
|
140
174
|
primaryImage: {
|
|
141
175
|
description: string;
|
|
@@ -150,7 +184,54 @@ export declare const readPostPurchaseSubscription: (prepared: z.infer<typeof Pre
|
|
|
150
184
|
showDeclineAll?: "none" | "both" | "above" | "below" | undefined;
|
|
151
185
|
};
|
|
152
186
|
responseDescription: string;
|
|
187
|
+
reviews: {
|
|
188
|
+
color: string;
|
|
189
|
+
rating: number;
|
|
190
|
+
reviewCount: number;
|
|
191
|
+
reviewsPlural: string;
|
|
192
|
+
reviewsSingular: string;
|
|
193
|
+
size: "small" | "large" | "medium";
|
|
194
|
+
strokeColor: string;
|
|
195
|
+
strokeWidth: number;
|
|
196
|
+
} | null;
|
|
153
197
|
shouldShowSavingText: boolean;
|
|
198
|
+
descriptionDocument?: {
|
|
199
|
+
attrs: {
|
|
200
|
+
blockSpacing?: "none" | "base" | "extraTight" | "tight" | "loose" | "extraLoose" | undefined;
|
|
201
|
+
};
|
|
202
|
+
content: never[] | {
|
|
203
|
+
attrs: {
|
|
204
|
+
textAlign?: "start" | "center" | "end" | undefined;
|
|
205
|
+
};
|
|
206
|
+
content: never[] | {
|
|
207
|
+
text: string;
|
|
208
|
+
type: "text";
|
|
209
|
+
marks?: never[] | ({
|
|
210
|
+
type: "bold";
|
|
211
|
+
} | {
|
|
212
|
+
type: "italic";
|
|
213
|
+
} | {
|
|
214
|
+
attrs: {
|
|
215
|
+
class: string | null;
|
|
216
|
+
href: string;
|
|
217
|
+
rel: string;
|
|
218
|
+
target: string;
|
|
219
|
+
};
|
|
220
|
+
type: "link";
|
|
221
|
+
} | {
|
|
222
|
+
type: "strike";
|
|
223
|
+
} | {
|
|
224
|
+
attrs: {
|
|
225
|
+
color: "success" | "warning" | "critical" | "base" | "decorative" | "subdued" | "accent";
|
|
226
|
+
fontSize: "small" | "base" | "large" | "medium" | "extraSmall" | "extraLarge" | "heading";
|
|
227
|
+
};
|
|
228
|
+
type: "textStyle";
|
|
229
|
+
})[] | undefined;
|
|
230
|
+
}[];
|
|
231
|
+
type: "paragraph";
|
|
232
|
+
}[];
|
|
233
|
+
type: "doc";
|
|
234
|
+
} | undefined;
|
|
154
235
|
gallery?: {
|
|
155
236
|
images: {
|
|
156
237
|
description: string;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/** One sanitized legacy metafield payload per provider (doc R7), in the legacy precedence order. */
|
|
2
|
+
export declare const providerCases: ({
|
|
3
|
+
metafields: {
|
|
4
|
+
key: string;
|
|
5
|
+
namespace: string;
|
|
6
|
+
type: string;
|
|
7
|
+
value: string;
|
|
8
|
+
}[];
|
|
9
|
+
provider: string;
|
|
10
|
+
rating: number;
|
|
11
|
+
reviewCount: number;
|
|
12
|
+
} | {
|
|
13
|
+
metafields: {
|
|
14
|
+
key: string;
|
|
15
|
+
namespace: string;
|
|
16
|
+
value: string;
|
|
17
|
+
}[];
|
|
18
|
+
provider: string;
|
|
19
|
+
rating: number;
|
|
20
|
+
reviewCount: number;
|
|
21
|
+
})[];
|
|
22
|
+
export declare const allReviewFields: {
|
|
23
|
+
key: string;
|
|
24
|
+
namespace: string;
|
|
25
|
+
value: string;
|
|
26
|
+
}[];
|
|
27
|
+
/** Providers before `index` off, `index` on, the rest set to `rest` (an unconsumed value when malformed). */
|
|
28
|
+
export declare const integrationsFrom: (index: number, selected?: unknown, rest?: unknown) => {
|
|
29
|
+
[k: string]: unknown;
|
|
30
|
+
};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/** Common Shopify aggregate fields, as the Klaviyo integration writes them. */
|
|
2
|
+
export declare const reviewMetafields: {
|
|
3
|
+
key: string;
|
|
4
|
+
namespace: string;
|
|
5
|
+
type: string;
|
|
6
|
+
value: string;
|
|
7
|
+
}[];
|
|
8
|
+
export declare const reviewSettings: {
|
|
9
|
+
integrations: {
|
|
10
|
+
klaviyo: boolean;
|
|
11
|
+
};
|
|
12
|
+
language: {
|
|
13
|
+
global: {
|
|
14
|
+
reviews_plural: string;
|
|
15
|
+
reviews_singular: string;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
styles: {
|
|
19
|
+
star_color: string;
|
|
20
|
+
star_size: string;
|
|
21
|
+
star_stroke_color: string;
|
|
22
|
+
stroke_width: string;
|
|
23
|
+
};
|
|
24
|
+
blocks: {
|
|
25
|
+
type: string;
|
|
26
|
+
}[];
|
|
27
|
+
discount: {
|
|
28
|
+
amount: string;
|
|
29
|
+
type: string;
|
|
30
|
+
};
|
|
31
|
+
endpoint: string;
|
|
32
|
+
key: string;
|
|
33
|
+
product_limit: number;
|
|
34
|
+
product_options: {};
|
|
35
|
+
product_type: string;
|
|
36
|
+
quantity_inputs: {
|
|
37
|
+
default_quantity: number;
|
|
38
|
+
enabled: boolean;
|
|
39
|
+
};
|
|
40
|
+
shipping: {
|
|
41
|
+
amount: string;
|
|
42
|
+
title: string;
|
|
43
|
+
type: string;
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
export declare const reviewResponse: (metafields?: unknown) => {
|
|
47
|
+
data: {
|
|
48
|
+
metafields: unknown;
|
|
49
|
+
description: string;
|
|
50
|
+
id: number;
|
|
51
|
+
image: {
|
|
52
|
+
src: string;
|
|
53
|
+
};
|
|
54
|
+
title: string;
|
|
55
|
+
variants: {
|
|
56
|
+
compare_at_price: string;
|
|
57
|
+
id: number;
|
|
58
|
+
inventory_management: string;
|
|
59
|
+
inventory_policy: string;
|
|
60
|
+
inventory_quantity: number;
|
|
61
|
+
price: string;
|
|
62
|
+
product_id: number;
|
|
63
|
+
title: string;
|
|
64
|
+
}[];
|
|
65
|
+
}[];
|
|
66
|
+
metadata: {};
|
|
67
|
+
};
|