ce-storefront 0.3.5 → 0.3.6
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/esm/lib/config.d.ts +3 -3
- package/esm/lib/config.js +3 -3
- package/esm/models/components/analyticsevent.d.ts +8 -8
- package/esm/models/components/analyticsevent.d.ts.map +1 -1
- package/esm/models/components/analyticsevent.js +12 -12
- package/esm/models/components/analyticsevent.js.map +1 -1
- package/esm/models/components/associatedoption.d.ts +125 -0
- package/esm/models/components/associatedoption.d.ts.map +1 -0
- package/esm/models/components/associatedoption.js +107 -0
- package/esm/models/components/associatedoption.js.map +1 -0
- package/esm/models/components/cart.d.ts +15 -15
- package/esm/models/components/cart.d.ts.map +1 -1
- package/esm/models/components/cart.js +15 -15
- package/esm/models/components/cart.js.map +1 -1
- package/esm/models/components/discountbasedpromotion.d.ts +0 -2
- package/esm/models/components/discountbasedpromotion.d.ts.map +1 -1
- package/esm/models/components/discountbasedpromotion.js +0 -4
- package/esm/models/components/discountbasedpromotion.js.map +1 -1
- package/esm/models/components/fixedpricepromotion.d.ts +0 -2
- package/esm/models/components/fixedpricepromotion.d.ts.map +1 -1
- package/esm/models/components/fixedpricepromotion.js +0 -4
- package/esm/models/components/fixedpricepromotion.js.map +1 -1
- package/esm/models/components/freegoodspromotion.d.ts +0 -5
- package/esm/models/components/freegoodspromotion.d.ts.map +1 -1
- package/esm/models/components/freegoodspromotion.js +0 -4
- package/esm/models/components/freegoodspromotion.js.map +1 -1
- package/esm/models/components/index.d.ts +4 -5
- package/esm/models/components/index.d.ts.map +1 -1
- package/esm/models/components/index.js +4 -5
- package/esm/models/components/index.js.map +1 -1
- package/esm/models/components/product.d.ts +24 -62
- package/esm/models/components/product.d.ts.map +1 -1
- package/esm/models/components/product.js +24 -81
- package/esm/models/components/product.js.map +1 -1
- package/esm/models/components/productattribute.d.ts +97 -64
- package/esm/models/components/productattribute.d.ts.map +1 -1
- package/esm/models/components/productattribute.js +67 -128
- package/esm/models/components/productattribute.js.map +1 -1
- package/esm/models/components/productcategory.d.ts +2 -2
- package/esm/models/components/productcategory.d.ts.map +1 -1
- package/esm/models/components/productcategory.js +2 -2
- package/esm/models/components/productcategory.js.map +1 -1
- package/esm/models/components/productdetail.d.ts +63 -165
- package/esm/models/components/productdetail.d.ts.map +1 -1
- package/esm/models/components/productdetail.js +70 -204
- package/esm/models/components/productdetail.js.map +1 -1
- package/esm/models/components/productlistresponse.d.ts +21 -0
- package/esm/models/components/productlistresponse.d.ts.map +1 -1
- package/esm/models/components/productlistresponse.js +21 -0
- package/esm/models/components/productlistresponse.js.map +1 -1
- package/esm/models/components/productshipping.d.ts +0 -2
- package/esm/models/components/productshipping.d.ts.map +1 -1
- package/esm/models/components/productshipping.js +0 -4
- package/esm/models/components/productshipping.js.map +1 -1
- package/esm/models/components/{promotion.d.ts → promotiondetail.d.ts} +29 -29
- package/esm/models/components/promotiondetail.d.ts.map +1 -0
- package/esm/models/components/{promotion.js → promotiondetail.js} +29 -29
- package/esm/models/components/promotiondetail.js.map +1 -0
- package/esm/models/components/seo.d.ts +6 -6
- package/esm/models/components/seo.d.ts.map +1 -1
- package/esm/models/components/seo.js +6 -19
- package/esm/models/components/seo.js.map +1 -1
- package/esm/models/components/{skuinfo.d.ts → sku.d.ts} +56 -48
- package/esm/models/components/sku.d.ts.map +1 -0
- package/esm/models/components/{skuinfo.js → sku.js} +65 -57
- package/esm/models/components/sku.js.map +1 -0
- package/esm/models/components/variant.d.ts +13 -52
- package/esm/models/components/variant.d.ts.map +1 -1
- package/esm/models/components/variant.js +5 -55
- package/esm/models/components/variant.js.map +1 -1
- package/esm/models/components/variantdetail.d.ts +31 -60
- package/esm/models/components/variantdetail.d.ts.map +1 -1
- package/esm/models/components/variantdetail.js +20 -57
- package/esm/models/components/variantdetail.js.map +1 -1
- package/esm/models/components/variantoption.d.ts +118 -0
- package/esm/models/components/variantoption.d.ts.map +1 -0
- package/esm/models/components/variantoption.js +114 -0
- package/esm/models/components/variantoption.js.map +1 -0
- package/esm/models/components/volumebasedpromotion.d.ts +0 -5
- package/esm/models/components/volumebasedpromotion.d.ts.map +1 -1
- package/esm/models/components/volumebasedpromotion.js +0 -4
- package/esm/models/components/volumebasedpromotion.js.map +1 -1
- package/esm/models/operations/getpromotions.d.ts +2 -2
- package/esm/models/operations/getpromotions.d.ts.map +1 -1
- package/esm/models/operations/getpromotions.js +2 -2
- package/esm/models/operations/getpromotions.js.map +1 -1
- package/esm/models/operations/getskus.d.ts +2 -2
- package/esm/models/operations/getskus.d.ts.map +1 -1
- package/esm/models/operations/getskus.js +2 -2
- package/esm/models/operations/getskus.js.map +1 -1
- package/esm/models/operations/getwishtlist.d.ts +2 -2
- package/esm/models/operations/getwishtlist.d.ts.map +1 -1
- package/esm/models/operations/getwishtlist.js +2 -2
- package/esm/models/operations/getwishtlist.js.map +1 -1
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/lib/config.ts +3 -3
- package/src/models/components/analyticsevent.ts +16 -15
- package/src/models/components/associatedoption.ts +217 -0
- package/src/models/components/cart.ts +24 -24
- package/src/models/components/discountbasedpromotion.ts +0 -6
- package/src/models/components/fixedpricepromotion.ts +0 -6
- package/src/models/components/freegoodspromotion.ts +0 -9
- package/src/models/components/index.ts +4 -5
- package/src/models/components/product.ts +52 -163
- package/src/models/components/productattribute.ts +162 -188
- package/src/models/components/productcategory.ts +4 -4
- package/src/models/components/productdetail.ts +143 -418
- package/src/models/components/productlistresponse.ts +46 -0
- package/src/models/components/productshipping.ts +0 -6
- package/src/models/components/{promotion.ts → promotiondetail.ts} +47 -45
- package/src/models/components/seo.ts +12 -25
- package/src/models/components/sku.ts +244 -0
- package/src/models/components/variant.ts +14 -119
- package/src/models/components/variantdetail.ts +51 -143
- package/src/models/components/variantoption.ts +214 -0
- package/src/models/components/volumebasedpromotion.ts +0 -9
- package/src/models/operations/getpromotions.ts +4 -4
- package/src/models/operations/getskus.ts +4 -4
- package/src/models/operations/getwishtlist.ts +4 -4
- package/esm/models/components/productbundleitem.d.ts +0 -47
- package/esm/models/components/productbundleitem.d.ts.map +0 -1
- package/esm/models/components/productbundleitem.js +0 -66
- package/esm/models/components/productbundleitem.js.map +0 -1
- package/esm/models/components/productpackaging.d.ts +0 -68
- package/esm/models/components/productpackaging.d.ts.map +0 -1
- package/esm/models/components/productpackaging.js +0 -88
- package/esm/models/components/productpackaging.js.map +0 -1
- package/esm/models/components/promotion.d.ts.map +0 -1
- package/esm/models/components/promotion.js.map +0 -1
- package/esm/models/components/saleschannel.d.ts +0 -39
- package/esm/models/components/saleschannel.d.ts.map +0 -1
- package/esm/models/components/saleschannel.js +0 -53
- package/esm/models/components/saleschannel.js.map +0 -1
- package/esm/models/components/skuinfo.d.ts.map +0 -1
- package/esm/models/components/skuinfo.js.map +0 -1
- package/src/models/components/productbundleitem.ts +0 -127
- package/src/models/components/productpackaging.ts +0 -162
- package/src/models/components/saleschannel.ts +0 -96
- package/src/models/components/skuinfo.ts +0 -237
|
@@ -26,7 +26,6 @@ export type DiscountBasedPromotion = {
|
|
|
26
26
|
* '> 0' if discount_type = fixed-amount, otherwise set 0.
|
|
27
27
|
*/
|
|
28
28
|
discountFixedAmount?: number | undefined;
|
|
29
|
-
customerGroupId?: string | null | undefined;
|
|
30
29
|
};
|
|
31
30
|
|
|
32
31
|
/** @internal */
|
|
@@ -58,14 +57,12 @@ export const DiscountBasedPromotion$inboundSchema: z.ZodType<
|
|
|
58
57
|
discount_type: DiscountType$inboundSchema,
|
|
59
58
|
discount_percent: z.number().optional(),
|
|
60
59
|
discount_fixed_amount: z.number().int().optional(),
|
|
61
|
-
customer_group_id: z.nullable(z.string()).optional(),
|
|
62
60
|
}).transform((v) => {
|
|
63
61
|
return remap$(v, {
|
|
64
62
|
"promotion_type": "promotionType",
|
|
65
63
|
"discount_type": "discountType",
|
|
66
64
|
"discount_percent": "discountPercent",
|
|
67
65
|
"discount_fixed_amount": "discountFixedAmount",
|
|
68
|
-
"customer_group_id": "customerGroupId",
|
|
69
66
|
});
|
|
70
67
|
});
|
|
71
68
|
|
|
@@ -75,7 +72,6 @@ export type DiscountBasedPromotion$Outbound = {
|
|
|
75
72
|
discount_type: string;
|
|
76
73
|
discount_percent?: number | undefined;
|
|
77
74
|
discount_fixed_amount?: number | undefined;
|
|
78
|
-
customer_group_id?: string | null | undefined;
|
|
79
75
|
};
|
|
80
76
|
|
|
81
77
|
/** @internal */
|
|
@@ -88,14 +84,12 @@ export const DiscountBasedPromotion$outboundSchema: z.ZodType<
|
|
|
88
84
|
discountType: DiscountType$outboundSchema,
|
|
89
85
|
discountPercent: z.number().optional(),
|
|
90
86
|
discountFixedAmount: z.number().int().optional(),
|
|
91
|
-
customerGroupId: z.nullable(z.string()).optional(),
|
|
92
87
|
}).transform((v) => {
|
|
93
88
|
return remap$(v, {
|
|
94
89
|
promotionType: "promotion_type",
|
|
95
90
|
discountType: "discount_type",
|
|
96
91
|
discountPercent: "discount_percent",
|
|
97
92
|
discountFixedAmount: "discount_fixed_amount",
|
|
98
|
-
customerGroupId: "customer_group_id",
|
|
99
93
|
});
|
|
100
94
|
});
|
|
101
95
|
|
|
@@ -11,7 +11,6 @@ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
|
11
11
|
export type FixedPricePromotion = {
|
|
12
12
|
promotionType?: "discount" | undefined;
|
|
13
13
|
offerPrice: number;
|
|
14
|
-
customerGroupId?: string | null | undefined;
|
|
15
14
|
};
|
|
16
15
|
|
|
17
16
|
/** @internal */
|
|
@@ -22,12 +21,10 @@ export const FixedPricePromotion$inboundSchema: z.ZodType<
|
|
|
22
21
|
> = z.object({
|
|
23
22
|
promotion_type: z.literal("discount").optional(),
|
|
24
23
|
offer_price: z.number(),
|
|
25
|
-
customer_group_id: z.nullable(z.string()).optional(),
|
|
26
24
|
}).transform((v) => {
|
|
27
25
|
return remap$(v, {
|
|
28
26
|
"promotion_type": "promotionType",
|
|
29
27
|
"offer_price": "offerPrice",
|
|
30
|
-
"customer_group_id": "customerGroupId",
|
|
31
28
|
});
|
|
32
29
|
});
|
|
33
30
|
|
|
@@ -35,7 +32,6 @@ export const FixedPricePromotion$inboundSchema: z.ZodType<
|
|
|
35
32
|
export type FixedPricePromotion$Outbound = {
|
|
36
33
|
promotion_type: "discount";
|
|
37
34
|
offer_price: number;
|
|
38
|
-
customer_group_id?: string | null | undefined;
|
|
39
35
|
};
|
|
40
36
|
|
|
41
37
|
/** @internal */
|
|
@@ -46,12 +42,10 @@ export const FixedPricePromotion$outboundSchema: z.ZodType<
|
|
|
46
42
|
> = z.object({
|
|
47
43
|
promotionType: z.literal("discount").default("discount" as const),
|
|
48
44
|
offerPrice: z.number(),
|
|
49
|
-
customerGroupId: z.nullable(z.string()).optional(),
|
|
50
45
|
}).transform((v) => {
|
|
51
46
|
return remap$(v, {
|
|
52
47
|
promotionType: "promotion_type",
|
|
53
48
|
offerPrice: "offer_price",
|
|
54
|
-
customerGroupId: "customer_group_id",
|
|
55
49
|
});
|
|
56
50
|
});
|
|
57
51
|
|
|
@@ -18,10 +18,6 @@ export type FreeGoodsPromotion = {
|
|
|
18
18
|
* The quantity of free goods the customer receives.
|
|
19
19
|
*/
|
|
20
20
|
getQuantity: number;
|
|
21
|
-
/**
|
|
22
|
-
* Optional ID for a specific customer group.
|
|
23
|
-
*/
|
|
24
|
-
customerGroupId?: string | null | undefined;
|
|
25
21
|
};
|
|
26
22
|
|
|
27
23
|
/** @internal */
|
|
@@ -33,13 +29,11 @@ export const FreeGoodsPromotion$inboundSchema: z.ZodType<
|
|
|
33
29
|
promotion_type: z.literal("free-goods").optional(),
|
|
34
30
|
buy_quantity: z.number().int(),
|
|
35
31
|
get_quantity: z.number().int(),
|
|
36
|
-
customer_group_id: z.nullable(z.string()).optional(),
|
|
37
32
|
}).transform((v) => {
|
|
38
33
|
return remap$(v, {
|
|
39
34
|
"promotion_type": "promotionType",
|
|
40
35
|
"buy_quantity": "buyQuantity",
|
|
41
36
|
"get_quantity": "getQuantity",
|
|
42
|
-
"customer_group_id": "customerGroupId",
|
|
43
37
|
});
|
|
44
38
|
});
|
|
45
39
|
|
|
@@ -48,7 +42,6 @@ export type FreeGoodsPromotion$Outbound = {
|
|
|
48
42
|
promotion_type: "free-goods";
|
|
49
43
|
buy_quantity: number;
|
|
50
44
|
get_quantity: number;
|
|
51
|
-
customer_group_id?: string | null | undefined;
|
|
52
45
|
};
|
|
53
46
|
|
|
54
47
|
/** @internal */
|
|
@@ -60,13 +53,11 @@ export const FreeGoodsPromotion$outboundSchema: z.ZodType<
|
|
|
60
53
|
promotionType: z.literal("free-goods").default("free-goods" as const),
|
|
61
54
|
buyQuantity: z.number().int(),
|
|
62
55
|
getQuantity: z.number().int(),
|
|
63
|
-
customerGroupId: z.nullable(z.string()).optional(),
|
|
64
56
|
}).transform((v) => {
|
|
65
57
|
return remap$(v, {
|
|
66
58
|
promotionType: "promotion_type",
|
|
67
59
|
buyQuantity: "buy_quantity",
|
|
68
60
|
getQuantity: "get_quantity",
|
|
69
|
-
customerGroupId: "customer_group_id",
|
|
70
61
|
});
|
|
71
62
|
});
|
|
72
63
|
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
export * from "./analyticsevent.js";
|
|
6
6
|
export * from "./anonymoususer.js";
|
|
7
|
+
export * from "./associatedoption.js";
|
|
7
8
|
export * from "./banktransfer.js";
|
|
8
9
|
export * from "./business.js";
|
|
9
10
|
export * from "./cardpayment.js";
|
|
@@ -53,29 +54,27 @@ export * from "./payusavedcard.js";
|
|
|
53
54
|
export * from "./pincode.js";
|
|
54
55
|
export * from "./product.js";
|
|
55
56
|
export * from "./productattribute.js";
|
|
56
|
-
export * from "./productbundleitem.js";
|
|
57
57
|
export * from "./productcategory.js";
|
|
58
58
|
export * from "./productdetail.js";
|
|
59
59
|
export * from "./productimage.js";
|
|
60
60
|
export * from "./productlistresponse.js";
|
|
61
|
-
export * from "./productpackaging.js";
|
|
62
61
|
export * from "./productpricing.js";
|
|
63
62
|
export * from "./productpromotion.js";
|
|
64
63
|
export * from "./productreview.js";
|
|
65
64
|
export * from "./productshipping.js";
|
|
66
65
|
export * from "./productsubscription.js";
|
|
67
66
|
export * from "./productvideo.js";
|
|
68
|
-
export * from "./
|
|
69
|
-
export * from "./saleschannel.js";
|
|
67
|
+
export * from "./promotiondetail.js";
|
|
70
68
|
export * from "./security.js";
|
|
71
69
|
export * from "./seo.js";
|
|
72
70
|
export * from "./shipmentitem.js";
|
|
73
|
-
export * from "./
|
|
71
|
+
export * from "./sku.js";
|
|
74
72
|
export * from "./updatecustomer.js";
|
|
75
73
|
export * from "./upipayment.js";
|
|
76
74
|
export * from "./user.js";
|
|
77
75
|
export * from "./userinput.js";
|
|
78
76
|
export * from "./variant.js";
|
|
79
77
|
export * from "./variantdetail.js";
|
|
78
|
+
export * from "./variantoption.js";
|
|
80
79
|
export * from "./volumebasedpromotion.js";
|
|
81
80
|
export * from "./walletpayment.js";
|
|
@@ -14,12 +14,6 @@ import {
|
|
|
14
14
|
ProductAttribute$Outbound,
|
|
15
15
|
ProductAttribute$outboundSchema,
|
|
16
16
|
} from "./productattribute.js";
|
|
17
|
-
import {
|
|
18
|
-
ProductBundleItem,
|
|
19
|
-
ProductBundleItem$inboundSchema,
|
|
20
|
-
ProductBundleItem$Outbound,
|
|
21
|
-
ProductBundleItem$outboundSchema,
|
|
22
|
-
} from "./productbundleitem.js";
|
|
23
17
|
import {
|
|
24
18
|
ProductImage,
|
|
25
19
|
ProductImage$inboundSchema,
|
|
@@ -38,12 +32,6 @@ import {
|
|
|
38
32
|
ProductPromotion$Outbound,
|
|
39
33
|
ProductPromotion$outboundSchema,
|
|
40
34
|
} from "./productpromotion.js";
|
|
41
|
-
import {
|
|
42
|
-
ProductShipping,
|
|
43
|
-
ProductShipping$inboundSchema,
|
|
44
|
-
ProductShipping$Outbound,
|
|
45
|
-
ProductShipping$outboundSchema,
|
|
46
|
-
} from "./productshipping.js";
|
|
47
35
|
import {
|
|
48
36
|
ProductSubscription,
|
|
49
37
|
ProductSubscription$inboundSchema,
|
|
@@ -56,6 +44,12 @@ import {
|
|
|
56
44
|
Variant$Outbound,
|
|
57
45
|
Variant$outboundSchema,
|
|
58
46
|
} from "./variant.js";
|
|
47
|
+
import {
|
|
48
|
+
VariantOption,
|
|
49
|
+
VariantOption$inboundSchema,
|
|
50
|
+
VariantOption$Outbound,
|
|
51
|
+
VariantOption$outboundSchema,
|
|
52
|
+
} from "./variantoption.js";
|
|
59
53
|
|
|
60
54
|
export const ProductType = {
|
|
61
55
|
Physical: "physical",
|
|
@@ -64,45 +58,35 @@ export const ProductType = {
|
|
|
64
58
|
} as const;
|
|
65
59
|
export type ProductType = ClosedEnum<typeof ProductType>;
|
|
66
60
|
|
|
67
|
-
export type VariantOptions = {
|
|
68
|
-
optionName?: string | undefined;
|
|
69
|
-
optionValue?: Array<string> | undefined;
|
|
70
|
-
};
|
|
71
|
-
|
|
72
61
|
export type Product = {
|
|
73
62
|
/**
|
|
74
63
|
* The ULID of the product
|
|
75
64
|
*/
|
|
76
|
-
id
|
|
77
|
-
|
|
65
|
+
id: string;
|
|
66
|
+
sku?: string | undefined;
|
|
67
|
+
name: string;
|
|
68
|
+
slug: string;
|
|
78
69
|
shortDescription?: string | undefined;
|
|
79
|
-
productType
|
|
70
|
+
productType: ProductType;
|
|
80
71
|
active?: boolean | undefined;
|
|
81
|
-
sku?: string | undefined;
|
|
82
72
|
stockAvailable?: boolean | undefined;
|
|
83
|
-
isFeatured?: boolean | undefined;
|
|
84
73
|
onOffer?: boolean | undefined;
|
|
85
74
|
onSubscription?: boolean | undefined;
|
|
86
75
|
onPromotion?: boolean | undefined;
|
|
87
76
|
hasVariant?: boolean | undefined;
|
|
88
|
-
/**
|
|
89
|
-
* this will be used if has_variant is true, to auto set default values.
|
|
90
|
-
*/
|
|
91
|
-
variantOptions?: Array<VariantOptions> | null | undefined;
|
|
92
|
-
attributes?: Array<ProductAttribute> | undefined;
|
|
93
|
-
images?: Array<ProductImage> | undefined;
|
|
94
|
-
pricing?: ProductPricing | undefined;
|
|
95
|
-
shipping?: ProductShipping | undefined;
|
|
96
77
|
tags?: Array<string> | null | undefined;
|
|
97
78
|
categoryIds?: Array<string> | undefined;
|
|
98
79
|
reviewsRatingSum?: number | undefined;
|
|
99
80
|
reviewsCount?: number | undefined;
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
81
|
+
attributes?: Array<ProductAttribute> | undefined;
|
|
82
|
+
pricing?: ProductPricing | undefined;
|
|
83
|
+
/**
|
|
84
|
+
* this will be used if has_variant is true, to auto set default values.
|
|
85
|
+
*/
|
|
86
|
+
variantOptions?: Array<VariantOption> | null | undefined;
|
|
87
|
+
promotion?: ProductPromotion | null | undefined;
|
|
88
|
+
images?: Array<ProductImage> | undefined;
|
|
104
89
|
subscription?: Array<ProductSubscription> | undefined;
|
|
105
|
-
bundleItems?: Array<ProductBundleItem> | undefined;
|
|
106
90
|
variants?: Array<Variant> | undefined;
|
|
107
91
|
};
|
|
108
92
|
|
|
@@ -125,156 +109,73 @@ export namespace ProductType$ {
|
|
|
125
109
|
export const outboundSchema = ProductType$outboundSchema;
|
|
126
110
|
}
|
|
127
111
|
|
|
128
|
-
/** @internal */
|
|
129
|
-
export const VariantOptions$inboundSchema: z.ZodType<
|
|
130
|
-
VariantOptions,
|
|
131
|
-
z.ZodTypeDef,
|
|
132
|
-
unknown
|
|
133
|
-
> = z.object({
|
|
134
|
-
option_name: z.string().optional(),
|
|
135
|
-
option_value: z.array(z.string()).optional(),
|
|
136
|
-
}).transform((v) => {
|
|
137
|
-
return remap$(v, {
|
|
138
|
-
"option_name": "optionName",
|
|
139
|
-
"option_value": "optionValue",
|
|
140
|
-
});
|
|
141
|
-
});
|
|
142
|
-
|
|
143
|
-
/** @internal */
|
|
144
|
-
export type VariantOptions$Outbound = {
|
|
145
|
-
option_name?: string | undefined;
|
|
146
|
-
option_value?: Array<string> | undefined;
|
|
147
|
-
};
|
|
148
|
-
|
|
149
|
-
/** @internal */
|
|
150
|
-
export const VariantOptions$outboundSchema: z.ZodType<
|
|
151
|
-
VariantOptions$Outbound,
|
|
152
|
-
z.ZodTypeDef,
|
|
153
|
-
VariantOptions
|
|
154
|
-
> = z.object({
|
|
155
|
-
optionName: z.string().optional(),
|
|
156
|
-
optionValue: z.array(z.string()).optional(),
|
|
157
|
-
}).transform((v) => {
|
|
158
|
-
return remap$(v, {
|
|
159
|
-
optionName: "option_name",
|
|
160
|
-
optionValue: "option_value",
|
|
161
|
-
});
|
|
162
|
-
});
|
|
163
|
-
|
|
164
|
-
/**
|
|
165
|
-
* @internal
|
|
166
|
-
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
167
|
-
*/
|
|
168
|
-
export namespace VariantOptions$ {
|
|
169
|
-
/** @deprecated use `VariantOptions$inboundSchema` instead. */
|
|
170
|
-
export const inboundSchema = VariantOptions$inboundSchema;
|
|
171
|
-
/** @deprecated use `VariantOptions$outboundSchema` instead. */
|
|
172
|
-
export const outboundSchema = VariantOptions$outboundSchema;
|
|
173
|
-
/** @deprecated use `VariantOptions$Outbound` instead. */
|
|
174
|
-
export type Outbound = VariantOptions$Outbound;
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
export function variantOptionsToJSON(variantOptions: VariantOptions): string {
|
|
178
|
-
return JSON.stringify(VariantOptions$outboundSchema.parse(variantOptions));
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
export function variantOptionsFromJSON(
|
|
182
|
-
jsonString: string,
|
|
183
|
-
): SafeParseResult<VariantOptions, SDKValidationError> {
|
|
184
|
-
return safeParse(
|
|
185
|
-
jsonString,
|
|
186
|
-
(x) => VariantOptions$inboundSchema.parse(JSON.parse(x)),
|
|
187
|
-
`Failed to parse 'VariantOptions' from JSON`,
|
|
188
|
-
);
|
|
189
|
-
}
|
|
190
|
-
|
|
191
112
|
/** @internal */
|
|
192
113
|
export const Product$inboundSchema: z.ZodType<Product, z.ZodTypeDef, unknown> =
|
|
193
114
|
z.object({
|
|
194
|
-
id: z.string()
|
|
195
|
-
|
|
115
|
+
id: z.string(),
|
|
116
|
+
sku: z.string().optional(),
|
|
117
|
+
name: z.string(),
|
|
118
|
+
slug: z.string(),
|
|
196
119
|
short_description: z.string().optional(),
|
|
197
|
-
product_type: ProductType$inboundSchema
|
|
120
|
+
product_type: ProductType$inboundSchema,
|
|
198
121
|
active: z.boolean().default(true),
|
|
199
|
-
sku: z.string().optional(),
|
|
200
122
|
stock_available: z.boolean().default(true),
|
|
201
|
-
is_featured: z.boolean().default(false),
|
|
202
123
|
on_offer: z.boolean().default(false),
|
|
203
124
|
on_subscription: z.boolean().default(false),
|
|
204
125
|
on_promotion: z.boolean().default(false),
|
|
205
126
|
has_variant: z.boolean().default(false),
|
|
206
|
-
variant_options: z.nullable(
|
|
207
|
-
z.array(z.lazy(() => VariantOptions$inboundSchema)),
|
|
208
|
-
).optional(),
|
|
209
|
-
attributes: z.array(ProductAttribute$inboundSchema).optional(),
|
|
210
|
-
images: z.array(ProductImage$inboundSchema).optional(),
|
|
211
|
-
pricing: ProductPricing$inboundSchema.optional(),
|
|
212
|
-
shipping: ProductShipping$inboundSchema.optional(),
|
|
213
127
|
tags: z.nullable(z.array(z.string())).optional(),
|
|
214
128
|
category_ids: z.array(z.string()).optional(),
|
|
215
129
|
reviews_rating_sum: z.number().optional(),
|
|
216
130
|
reviews_count: z.number().int().optional(),
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
).optional(),
|
|
224
|
-
promotion: z.array(ProductPromotion$inboundSchema).optional(),
|
|
131
|
+
attributes: z.array(ProductAttribute$inboundSchema).optional(),
|
|
132
|
+
pricing: ProductPricing$inboundSchema.optional(),
|
|
133
|
+
variant_options: z.nullable(z.array(VariantOption$inboundSchema))
|
|
134
|
+
.optional(),
|
|
135
|
+
promotion: z.nullable(ProductPromotion$inboundSchema).optional(),
|
|
136
|
+
images: z.array(ProductImage$inboundSchema).optional(),
|
|
225
137
|
subscription: z.array(ProductSubscription$inboundSchema).optional(),
|
|
226
|
-
bundle_items: z.array(ProductBundleItem$inboundSchema).optional(),
|
|
227
138
|
variants: z.array(Variant$inboundSchema).optional(),
|
|
228
139
|
}).transform((v) => {
|
|
229
140
|
return remap$(v, {
|
|
230
141
|
"short_description": "shortDescription",
|
|
231
142
|
"product_type": "productType",
|
|
232
143
|
"stock_available": "stockAvailable",
|
|
233
|
-
"is_featured": "isFeatured",
|
|
234
144
|
"on_offer": "onOffer",
|
|
235
145
|
"on_subscription": "onSubscription",
|
|
236
146
|
"on_promotion": "onPromotion",
|
|
237
147
|
"has_variant": "hasVariant",
|
|
238
|
-
"variant_options": "variantOptions",
|
|
239
148
|
"category_ids": "categoryIds",
|
|
240
149
|
"reviews_rating_sum": "reviewsRatingSum",
|
|
241
150
|
"reviews_count": "reviewsCount",
|
|
242
|
-
"
|
|
243
|
-
"created_at": "createdAt",
|
|
244
|
-
"modified_at": "modifiedAt",
|
|
245
|
-
"bundle_items": "bundleItems",
|
|
151
|
+
"variant_options": "variantOptions",
|
|
246
152
|
});
|
|
247
153
|
});
|
|
248
154
|
|
|
249
155
|
/** @internal */
|
|
250
156
|
export type Product$Outbound = {
|
|
251
|
-
id
|
|
252
|
-
|
|
157
|
+
id: string;
|
|
158
|
+
sku?: string | undefined;
|
|
159
|
+
name: string;
|
|
160
|
+
slug: string;
|
|
253
161
|
short_description?: string | undefined;
|
|
254
|
-
product_type
|
|
162
|
+
product_type: string;
|
|
255
163
|
active: boolean;
|
|
256
|
-
sku?: string | undefined;
|
|
257
164
|
stock_available: boolean;
|
|
258
|
-
is_featured: boolean;
|
|
259
165
|
on_offer: boolean;
|
|
260
166
|
on_subscription: boolean;
|
|
261
167
|
on_promotion: boolean;
|
|
262
168
|
has_variant: boolean;
|
|
263
|
-
variant_options?: Array<VariantOptions$Outbound> | null | undefined;
|
|
264
|
-
attributes?: Array<ProductAttribute$Outbound> | undefined;
|
|
265
|
-
images?: Array<ProductImage$Outbound> | undefined;
|
|
266
|
-
pricing?: ProductPricing$Outbound | undefined;
|
|
267
|
-
shipping?: ProductShipping$Outbound | undefined;
|
|
268
169
|
tags?: Array<string> | null | undefined;
|
|
269
170
|
category_ids?: Array<string> | undefined;
|
|
270
171
|
reviews_rating_sum?: number | undefined;
|
|
271
172
|
reviews_count?: number | undefined;
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
promotion?:
|
|
173
|
+
attributes?: Array<ProductAttribute$Outbound> | undefined;
|
|
174
|
+
pricing?: ProductPricing$Outbound | undefined;
|
|
175
|
+
variant_options?: Array<VariantOption$Outbound> | null | undefined;
|
|
176
|
+
promotion?: ProductPromotion$Outbound | null | undefined;
|
|
177
|
+
images?: Array<ProductImage$Outbound> | undefined;
|
|
276
178
|
subscription?: Array<ProductSubscription$Outbound> | undefined;
|
|
277
|
-
bundle_items?: Array<ProductBundleItem$Outbound> | undefined;
|
|
278
179
|
variants?: Array<Variant$Outbound> | undefined;
|
|
279
180
|
};
|
|
280
181
|
|
|
@@ -284,54 +185,42 @@ export const Product$outboundSchema: z.ZodType<
|
|
|
284
185
|
z.ZodTypeDef,
|
|
285
186
|
Product
|
|
286
187
|
> = z.object({
|
|
287
|
-
id: z.string()
|
|
288
|
-
|
|
188
|
+
id: z.string(),
|
|
189
|
+
sku: z.string().optional(),
|
|
190
|
+
name: z.string(),
|
|
191
|
+
slug: z.string(),
|
|
289
192
|
shortDescription: z.string().optional(),
|
|
290
|
-
productType: ProductType$outboundSchema
|
|
193
|
+
productType: ProductType$outboundSchema,
|
|
291
194
|
active: z.boolean().default(true),
|
|
292
|
-
sku: z.string().optional(),
|
|
293
195
|
stockAvailable: z.boolean().default(true),
|
|
294
|
-
isFeatured: z.boolean().default(false),
|
|
295
196
|
onOffer: z.boolean().default(false),
|
|
296
197
|
onSubscription: z.boolean().default(false),
|
|
297
198
|
onPromotion: z.boolean().default(false),
|
|
298
199
|
hasVariant: z.boolean().default(false),
|
|
299
|
-
variantOptions: z.nullable(
|
|
300
|
-
z.array(z.lazy(() => VariantOptions$outboundSchema)),
|
|
301
|
-
).optional(),
|
|
302
|
-
attributes: z.array(ProductAttribute$outboundSchema).optional(),
|
|
303
|
-
images: z.array(ProductImage$outboundSchema).optional(),
|
|
304
|
-
pricing: ProductPricing$outboundSchema.optional(),
|
|
305
|
-
shipping: ProductShipping$outboundSchema.optional(),
|
|
306
200
|
tags: z.nullable(z.array(z.string())).optional(),
|
|
307
201
|
categoryIds: z.array(z.string()).optional(),
|
|
308
202
|
reviewsRatingSum: z.number().optional(),
|
|
309
203
|
reviewsCount: z.number().int().optional(),
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
promotion: z.
|
|
204
|
+
attributes: z.array(ProductAttribute$outboundSchema).optional(),
|
|
205
|
+
pricing: ProductPricing$outboundSchema.optional(),
|
|
206
|
+
variantOptions: z.nullable(z.array(VariantOption$outboundSchema)).optional(),
|
|
207
|
+
promotion: z.nullable(ProductPromotion$outboundSchema).optional(),
|
|
208
|
+
images: z.array(ProductImage$outboundSchema).optional(),
|
|
314
209
|
subscription: z.array(ProductSubscription$outboundSchema).optional(),
|
|
315
|
-
bundleItems: z.array(ProductBundleItem$outboundSchema).optional(),
|
|
316
210
|
variants: z.array(Variant$outboundSchema).optional(),
|
|
317
211
|
}).transform((v) => {
|
|
318
212
|
return remap$(v, {
|
|
319
213
|
shortDescription: "short_description",
|
|
320
214
|
productType: "product_type",
|
|
321
215
|
stockAvailable: "stock_available",
|
|
322
|
-
isFeatured: "is_featured",
|
|
323
216
|
onOffer: "on_offer",
|
|
324
217
|
onSubscription: "on_subscription",
|
|
325
218
|
onPromotion: "on_promotion",
|
|
326
219
|
hasVariant: "has_variant",
|
|
327
|
-
variantOptions: "variant_options",
|
|
328
220
|
categoryIds: "category_ids",
|
|
329
221
|
reviewsRatingSum: "reviews_rating_sum",
|
|
330
222
|
reviewsCount: "reviews_count",
|
|
331
|
-
|
|
332
|
-
createdAt: "created_at",
|
|
333
|
-
modifiedAt: "modified_at",
|
|
334
|
-
bundleItems: "bundle_items",
|
|
223
|
+
variantOptions: "variant_options",
|
|
335
224
|
});
|
|
336
225
|
});
|
|
337
226
|
|