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
|
@@ -3,306 +3,197 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import * as z from "zod";
|
|
6
|
-
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
6
|
import { safeParse } from "../../lib/schemas.js";
|
|
8
|
-
import { ClosedEnum } from "../../types/enums.js";
|
|
9
7
|
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
10
8
|
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
ProductBundleItem$outboundSchema,
|
|
22
|
-
} from "./productbundleitem.js";
|
|
23
|
-
import {
|
|
24
|
-
ProductImage,
|
|
25
|
-
ProductImage$inboundSchema,
|
|
26
|
-
ProductImage$Outbound,
|
|
27
|
-
ProductImage$outboundSchema,
|
|
28
|
-
} from "./productimage.js";
|
|
29
|
-
import {
|
|
30
|
-
ProductPackaging,
|
|
31
|
-
ProductPackaging$inboundSchema,
|
|
32
|
-
ProductPackaging$Outbound,
|
|
33
|
-
ProductPackaging$outboundSchema,
|
|
34
|
-
} from "./productpackaging.js";
|
|
35
|
-
import {
|
|
36
|
-
ProductPricing,
|
|
37
|
-
ProductPricing$inboundSchema,
|
|
38
|
-
ProductPricing$Outbound,
|
|
39
|
-
ProductPricing$outboundSchema,
|
|
40
|
-
} from "./productpricing.js";
|
|
41
|
-
import {
|
|
42
|
-
ProductPromotion,
|
|
43
|
-
ProductPromotion$inboundSchema,
|
|
44
|
-
ProductPromotion$Outbound,
|
|
45
|
-
ProductPromotion$outboundSchema,
|
|
46
|
-
} from "./productpromotion.js";
|
|
47
|
-
import {
|
|
48
|
-
ProductReview,
|
|
49
|
-
ProductReview$inboundSchema,
|
|
50
|
-
ProductReview$Outbound,
|
|
51
|
-
ProductReview$outboundSchema,
|
|
52
|
-
} from "./productreview.js";
|
|
53
|
-
import {
|
|
54
|
-
ProductShipping,
|
|
55
|
-
ProductShipping$inboundSchema,
|
|
56
|
-
ProductShipping$Outbound,
|
|
57
|
-
ProductShipping$outboundSchema,
|
|
58
|
-
} from "./productshipping.js";
|
|
59
|
-
import {
|
|
60
|
-
ProductSubscription,
|
|
61
|
-
ProductSubscription$inboundSchema,
|
|
62
|
-
ProductSubscription$Outbound,
|
|
63
|
-
ProductSubscription$outboundSchema,
|
|
64
|
-
} from "./productsubscription.js";
|
|
65
|
-
import {
|
|
66
|
-
ProductVideo,
|
|
67
|
-
ProductVideo$inboundSchema,
|
|
68
|
-
ProductVideo$Outbound,
|
|
69
|
-
ProductVideo$outboundSchema,
|
|
70
|
-
} from "./productvideo.js";
|
|
71
|
-
import {
|
|
72
|
-
SalesChannel,
|
|
73
|
-
SalesChannel$inboundSchema,
|
|
74
|
-
SalesChannel$Outbound,
|
|
75
|
-
SalesChannel$outboundSchema,
|
|
76
|
-
} from "./saleschannel.js";
|
|
77
|
-
import {
|
|
78
|
-
Seo,
|
|
79
|
-
Seo$inboundSchema,
|
|
80
|
-
Seo$Outbound,
|
|
81
|
-
Seo$outboundSchema,
|
|
82
|
-
} from "./seo.js";
|
|
83
|
-
import {
|
|
84
|
-
Variant,
|
|
85
|
-
Variant$inboundSchema,
|
|
86
|
-
Variant$Outbound,
|
|
87
|
-
Variant$outboundSchema,
|
|
88
|
-
} from "./variant.js";
|
|
89
|
-
|
|
90
|
-
export const ProductDetailProductType = {
|
|
91
|
-
Physical: "physical",
|
|
92
|
-
Digital: "digital",
|
|
93
|
-
Bundle: "bundle",
|
|
94
|
-
} as const;
|
|
95
|
-
export type ProductDetailProductType = ClosedEnum<
|
|
96
|
-
typeof ProductDetailProductType
|
|
97
|
-
>;
|
|
98
|
-
|
|
99
|
-
export type ProductDetailVariantOptions = {
|
|
100
|
-
optionName?: string | undefined;
|
|
101
|
-
optionValue?: Array<string> | undefined;
|
|
102
|
-
};
|
|
103
|
-
|
|
104
|
-
export type ProductDetailMetadata = {
|
|
105
|
-
name?: string | undefined;
|
|
106
|
-
value?: string | undefined;
|
|
107
|
-
};
|
|
108
|
-
|
|
109
|
-
export type ProductDetail = {
|
|
110
|
-
/**
|
|
111
|
-
* The ULID of the product
|
|
112
|
-
*/
|
|
113
|
-
id?: string | undefined;
|
|
114
|
-
name?: string | undefined;
|
|
115
|
-
shortDescription?: string | undefined;
|
|
116
|
-
productType?: ProductDetailProductType | undefined;
|
|
117
|
-
active?: boolean | undefined;
|
|
118
|
-
sku?: string | undefined;
|
|
119
|
-
stockAvailable?: boolean | undefined;
|
|
120
|
-
isFeatured?: boolean | undefined;
|
|
121
|
-
onOffer?: boolean | undefined;
|
|
122
|
-
onSubscription?: boolean | undefined;
|
|
123
|
-
onPromotion?: boolean | undefined;
|
|
124
|
-
hasVariant?: boolean | undefined;
|
|
125
|
-
/**
|
|
126
|
-
* this will be used if has_variant is true, to auto set default values.
|
|
127
|
-
*/
|
|
128
|
-
variantOptions?: Array<ProductDetailVariantOptions> | null | undefined;
|
|
129
|
-
attributes?: Array<ProductAttribute> | undefined;
|
|
130
|
-
images?: Array<ProductImage> | undefined;
|
|
131
|
-
pricing?: ProductPricing | undefined;
|
|
132
|
-
shipping?: ProductShipping | undefined;
|
|
133
|
-
tags?: Array<string> | null | undefined;
|
|
134
|
-
categoryIds?: Array<string> | undefined;
|
|
135
|
-
reviewsRatingSum?: number | undefined;
|
|
136
|
-
reviewsCount?: number | undefined;
|
|
137
|
-
hsnCode?: string | undefined;
|
|
138
|
-
createdAt?: Date | undefined;
|
|
139
|
-
modifiedAt?: Date | undefined;
|
|
140
|
-
description?: string | undefined;
|
|
141
|
-
videos?: Array<ProductVideo> | undefined;
|
|
142
|
-
promotion?: Array<ProductPromotion> | undefined;
|
|
143
|
-
subscription?: Array<ProductSubscription> | undefined;
|
|
144
|
-
packaging?: ProductPackaging | undefined;
|
|
145
|
-
variants?: Array<Variant> | undefined;
|
|
146
|
-
/**
|
|
147
|
-
* An array of product ULIDs
|
|
148
|
-
*/
|
|
149
|
-
upsellingProductIds?: Array<string> | undefined;
|
|
150
|
-
/**
|
|
151
|
-
* An array of product ULIDs
|
|
152
|
-
*/
|
|
153
|
-
crosssellingProductIds?: Array<string> | undefined;
|
|
154
|
-
reviews?: Array<ProductReview> | undefined;
|
|
155
|
-
bundleItems?: Array<ProductBundleItem> | undefined;
|
|
156
|
-
salesChannels?: Array<SalesChannel> | undefined;
|
|
157
|
-
metadata?: Array<ProductDetailMetadata> | null | undefined;
|
|
158
|
-
seo?: Seo | undefined;
|
|
159
|
-
reviewsTags?: Array<string> | null | undefined;
|
|
160
|
-
};
|
|
9
|
+
|
|
10
|
+
export type BundleProduct2 = {};
|
|
11
|
+
|
|
12
|
+
export type BundleProduct = BundleProduct2 | Array<any>;
|
|
13
|
+
|
|
14
|
+
export type Product2 = {};
|
|
15
|
+
|
|
16
|
+
export type ProductDetailProduct = Product2 | Array<any>;
|
|
17
|
+
|
|
18
|
+
export type ProductDetail = Product2 | Array<any> | BundleProduct2 | Array<any>;
|
|
161
19
|
|
|
162
20
|
/** @internal */
|
|
163
|
-
export const
|
|
164
|
-
|
|
165
|
-
|
|
21
|
+
export const BundleProduct2$inboundSchema: z.ZodType<
|
|
22
|
+
BundleProduct2,
|
|
23
|
+
z.ZodTypeDef,
|
|
24
|
+
unknown
|
|
25
|
+
> = z.object({});
|
|
166
26
|
|
|
167
27
|
/** @internal */
|
|
168
|
-
export
|
|
169
|
-
|
|
170
|
-
|
|
28
|
+
export type BundleProduct2$Outbound = {};
|
|
29
|
+
|
|
30
|
+
/** @internal */
|
|
31
|
+
export const BundleProduct2$outboundSchema: z.ZodType<
|
|
32
|
+
BundleProduct2$Outbound,
|
|
33
|
+
z.ZodTypeDef,
|
|
34
|
+
BundleProduct2
|
|
35
|
+
> = z.object({});
|
|
171
36
|
|
|
172
37
|
/**
|
|
173
38
|
* @internal
|
|
174
39
|
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
175
40
|
*/
|
|
176
|
-
export namespace
|
|
177
|
-
/** @deprecated use `
|
|
178
|
-
export const inboundSchema =
|
|
179
|
-
/** @deprecated use `
|
|
180
|
-
export const outboundSchema =
|
|
41
|
+
export namespace BundleProduct2$ {
|
|
42
|
+
/** @deprecated use `BundleProduct2$inboundSchema` instead. */
|
|
43
|
+
export const inboundSchema = BundleProduct2$inboundSchema;
|
|
44
|
+
/** @deprecated use `BundleProduct2$outboundSchema` instead. */
|
|
45
|
+
export const outboundSchema = BundleProduct2$outboundSchema;
|
|
46
|
+
/** @deprecated use `BundleProduct2$Outbound` instead. */
|
|
47
|
+
export type Outbound = BundleProduct2$Outbound;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export function bundleProduct2ToJSON(bundleProduct2: BundleProduct2): string {
|
|
51
|
+
return JSON.stringify(BundleProduct2$outboundSchema.parse(bundleProduct2));
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export function bundleProduct2FromJSON(
|
|
55
|
+
jsonString: string,
|
|
56
|
+
): SafeParseResult<BundleProduct2, SDKValidationError> {
|
|
57
|
+
return safeParse(
|
|
58
|
+
jsonString,
|
|
59
|
+
(x) => BundleProduct2$inboundSchema.parse(JSON.parse(x)),
|
|
60
|
+
`Failed to parse 'BundleProduct2' from JSON`,
|
|
61
|
+
);
|
|
181
62
|
}
|
|
182
63
|
|
|
183
64
|
/** @internal */
|
|
184
|
-
export const
|
|
185
|
-
|
|
65
|
+
export const BundleProduct$inboundSchema: z.ZodType<
|
|
66
|
+
BundleProduct,
|
|
186
67
|
z.ZodTypeDef,
|
|
187
68
|
unknown
|
|
188
|
-
> = z.
|
|
189
|
-
option_name: z.string().optional(),
|
|
190
|
-
option_value: z.array(z.string()).optional(),
|
|
191
|
-
}).transform((v) => {
|
|
192
|
-
return remap$(v, {
|
|
193
|
-
"option_name": "optionName",
|
|
194
|
-
"option_value": "optionValue",
|
|
195
|
-
});
|
|
196
|
-
});
|
|
69
|
+
> = z.union([z.lazy(() => BundleProduct2$inboundSchema), z.array(z.any())]);
|
|
197
70
|
|
|
198
71
|
/** @internal */
|
|
199
|
-
export type
|
|
200
|
-
option_name?: string | undefined;
|
|
201
|
-
option_value?: Array<string> | undefined;
|
|
202
|
-
};
|
|
72
|
+
export type BundleProduct$Outbound = BundleProduct2$Outbound | Array<any>;
|
|
203
73
|
|
|
204
74
|
/** @internal */
|
|
205
|
-
export const
|
|
206
|
-
|
|
75
|
+
export const BundleProduct$outboundSchema: z.ZodType<
|
|
76
|
+
BundleProduct$Outbound,
|
|
207
77
|
z.ZodTypeDef,
|
|
208
|
-
|
|
209
|
-
> = z.
|
|
210
|
-
optionName: z.string().optional(),
|
|
211
|
-
optionValue: z.array(z.string()).optional(),
|
|
212
|
-
}).transform((v) => {
|
|
213
|
-
return remap$(v, {
|
|
214
|
-
optionName: "option_name",
|
|
215
|
-
optionValue: "option_value",
|
|
216
|
-
});
|
|
217
|
-
});
|
|
78
|
+
BundleProduct
|
|
79
|
+
> = z.union([z.lazy(() => BundleProduct2$outboundSchema), z.array(z.any())]);
|
|
218
80
|
|
|
219
81
|
/**
|
|
220
82
|
* @internal
|
|
221
83
|
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
222
84
|
*/
|
|
223
|
-
export namespace
|
|
224
|
-
/** @deprecated use `
|
|
225
|
-
export const inboundSchema =
|
|
226
|
-
/** @deprecated use `
|
|
227
|
-
export const outboundSchema =
|
|
228
|
-
/** @deprecated use `
|
|
229
|
-
export type Outbound =
|
|
85
|
+
export namespace BundleProduct$ {
|
|
86
|
+
/** @deprecated use `BundleProduct$inboundSchema` instead. */
|
|
87
|
+
export const inboundSchema = BundleProduct$inboundSchema;
|
|
88
|
+
/** @deprecated use `BundleProduct$outboundSchema` instead. */
|
|
89
|
+
export const outboundSchema = BundleProduct$outboundSchema;
|
|
90
|
+
/** @deprecated use `BundleProduct$Outbound` instead. */
|
|
91
|
+
export type Outbound = BundleProduct$Outbound;
|
|
230
92
|
}
|
|
231
93
|
|
|
232
|
-
export function
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
94
|
+
export function bundleProductToJSON(bundleProduct: BundleProduct): string {
|
|
95
|
+
return JSON.stringify(BundleProduct$outboundSchema.parse(bundleProduct));
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export function bundleProductFromJSON(
|
|
99
|
+
jsonString: string,
|
|
100
|
+
): SafeParseResult<BundleProduct, SDKValidationError> {
|
|
101
|
+
return safeParse(
|
|
102
|
+
jsonString,
|
|
103
|
+
(x) => BundleProduct$inboundSchema.parse(JSON.parse(x)),
|
|
104
|
+
`Failed to parse 'BundleProduct' from JSON`,
|
|
239
105
|
);
|
|
240
106
|
}
|
|
241
107
|
|
|
242
|
-
|
|
108
|
+
/** @internal */
|
|
109
|
+
export const Product2$inboundSchema: z.ZodType<
|
|
110
|
+
Product2,
|
|
111
|
+
z.ZodTypeDef,
|
|
112
|
+
unknown
|
|
113
|
+
> = z.object({});
|
|
114
|
+
|
|
115
|
+
/** @internal */
|
|
116
|
+
export type Product2$Outbound = {};
|
|
117
|
+
|
|
118
|
+
/** @internal */
|
|
119
|
+
export const Product2$outboundSchema: z.ZodType<
|
|
120
|
+
Product2$Outbound,
|
|
121
|
+
z.ZodTypeDef,
|
|
122
|
+
Product2
|
|
123
|
+
> = z.object({});
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* @internal
|
|
127
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
128
|
+
*/
|
|
129
|
+
export namespace Product2$ {
|
|
130
|
+
/** @deprecated use `Product2$inboundSchema` instead. */
|
|
131
|
+
export const inboundSchema = Product2$inboundSchema;
|
|
132
|
+
/** @deprecated use `Product2$outboundSchema` instead. */
|
|
133
|
+
export const outboundSchema = Product2$outboundSchema;
|
|
134
|
+
/** @deprecated use `Product2$Outbound` instead. */
|
|
135
|
+
export type Outbound = Product2$Outbound;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
export function product2ToJSON(product2: Product2): string {
|
|
139
|
+
return JSON.stringify(Product2$outboundSchema.parse(product2));
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
export function product2FromJSON(
|
|
243
143
|
jsonString: string,
|
|
244
|
-
): SafeParseResult<
|
|
144
|
+
): SafeParseResult<Product2, SDKValidationError> {
|
|
245
145
|
return safeParse(
|
|
246
146
|
jsonString,
|
|
247
|
-
(x) =>
|
|
248
|
-
`Failed to parse '
|
|
147
|
+
(x) => Product2$inboundSchema.parse(JSON.parse(x)),
|
|
148
|
+
`Failed to parse 'Product2' from JSON`,
|
|
249
149
|
);
|
|
250
150
|
}
|
|
251
151
|
|
|
252
152
|
/** @internal */
|
|
253
|
-
export const
|
|
254
|
-
|
|
153
|
+
export const ProductDetailProduct$inboundSchema: z.ZodType<
|
|
154
|
+
ProductDetailProduct,
|
|
255
155
|
z.ZodTypeDef,
|
|
256
156
|
unknown
|
|
257
|
-
> = z.
|
|
258
|
-
name: z.string().optional(),
|
|
259
|
-
value: z.string().optional(),
|
|
260
|
-
});
|
|
157
|
+
> = z.union([z.lazy(() => Product2$inboundSchema), z.array(z.any())]);
|
|
261
158
|
|
|
262
159
|
/** @internal */
|
|
263
|
-
export type
|
|
264
|
-
name?: string | undefined;
|
|
265
|
-
value?: string | undefined;
|
|
266
|
-
};
|
|
160
|
+
export type ProductDetailProduct$Outbound = Product2$Outbound | Array<any>;
|
|
267
161
|
|
|
268
162
|
/** @internal */
|
|
269
|
-
export const
|
|
270
|
-
|
|
163
|
+
export const ProductDetailProduct$outboundSchema: z.ZodType<
|
|
164
|
+
ProductDetailProduct$Outbound,
|
|
271
165
|
z.ZodTypeDef,
|
|
272
|
-
|
|
273
|
-
> = z.
|
|
274
|
-
name: z.string().optional(),
|
|
275
|
-
value: z.string().optional(),
|
|
276
|
-
});
|
|
166
|
+
ProductDetailProduct
|
|
167
|
+
> = z.union([z.lazy(() => Product2$outboundSchema), z.array(z.any())]);
|
|
277
168
|
|
|
278
169
|
/**
|
|
279
170
|
* @internal
|
|
280
171
|
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
281
172
|
*/
|
|
282
|
-
export namespace
|
|
283
|
-
/** @deprecated use `
|
|
284
|
-
export const inboundSchema =
|
|
285
|
-
/** @deprecated use `
|
|
286
|
-
export const outboundSchema =
|
|
287
|
-
/** @deprecated use `
|
|
288
|
-
export type Outbound =
|
|
173
|
+
export namespace ProductDetailProduct$ {
|
|
174
|
+
/** @deprecated use `ProductDetailProduct$inboundSchema` instead. */
|
|
175
|
+
export const inboundSchema = ProductDetailProduct$inboundSchema;
|
|
176
|
+
/** @deprecated use `ProductDetailProduct$outboundSchema` instead. */
|
|
177
|
+
export const outboundSchema = ProductDetailProduct$outboundSchema;
|
|
178
|
+
/** @deprecated use `ProductDetailProduct$Outbound` instead. */
|
|
179
|
+
export type Outbound = ProductDetailProduct$Outbound;
|
|
289
180
|
}
|
|
290
181
|
|
|
291
|
-
export function
|
|
292
|
-
|
|
182
|
+
export function productDetailProductToJSON(
|
|
183
|
+
productDetailProduct: ProductDetailProduct,
|
|
293
184
|
): string {
|
|
294
185
|
return JSON.stringify(
|
|
295
|
-
|
|
186
|
+
ProductDetailProduct$outboundSchema.parse(productDetailProduct),
|
|
296
187
|
);
|
|
297
188
|
}
|
|
298
189
|
|
|
299
|
-
export function
|
|
190
|
+
export function productDetailProductFromJSON(
|
|
300
191
|
jsonString: string,
|
|
301
|
-
): SafeParseResult<
|
|
192
|
+
): SafeParseResult<ProductDetailProduct, SDKValidationError> {
|
|
302
193
|
return safeParse(
|
|
303
194
|
jsonString,
|
|
304
|
-
(x) =>
|
|
305
|
-
`Failed to parse '
|
|
195
|
+
(x) => ProductDetailProduct$inboundSchema.parse(JSON.parse(x)),
|
|
196
|
+
`Failed to parse 'ProductDetailProduct' from JSON`,
|
|
306
197
|
);
|
|
307
198
|
}
|
|
308
199
|
|
|
@@ -311,193 +202,27 @@ export const ProductDetail$inboundSchema: z.ZodType<
|
|
|
311
202
|
ProductDetail,
|
|
312
203
|
z.ZodTypeDef,
|
|
313
204
|
unknown
|
|
314
|
-
> = z.
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
product_type: ProductDetailProductType$inboundSchema.optional(),
|
|
319
|
-
active: z.boolean().default(true),
|
|
320
|
-
sku: z.string().optional(),
|
|
321
|
-
stock_available: z.boolean().default(true),
|
|
322
|
-
is_featured: z.boolean().default(false),
|
|
323
|
-
on_offer: z.boolean().default(false),
|
|
324
|
-
on_subscription: z.boolean().default(false),
|
|
325
|
-
on_promotion: z.boolean().default(false),
|
|
326
|
-
has_variant: z.boolean().default(false),
|
|
327
|
-
variant_options: z.nullable(
|
|
328
|
-
z.array(z.lazy(() => ProductDetailVariantOptions$inboundSchema)),
|
|
329
|
-
).optional(),
|
|
330
|
-
attributes: z.array(ProductAttribute$inboundSchema).optional(),
|
|
331
|
-
images: z.array(ProductImage$inboundSchema).optional(),
|
|
332
|
-
pricing: ProductPricing$inboundSchema.optional(),
|
|
333
|
-
shipping: ProductShipping$inboundSchema.optional(),
|
|
334
|
-
tags: z.nullable(z.array(z.string())).optional(),
|
|
335
|
-
category_ids: z.array(z.string()).optional(),
|
|
336
|
-
reviews_rating_sum: z.number().optional(),
|
|
337
|
-
reviews_count: z.number().int().optional(),
|
|
338
|
-
hsn_code: z.string().optional(),
|
|
339
|
-
created_at: z.string().datetime({ offset: true }).transform(v => new Date(v))
|
|
340
|
-
.optional(),
|
|
341
|
-
modified_at: z.string().datetime({ offset: true }).transform(v => new Date(v))
|
|
342
|
-
.optional(),
|
|
343
|
-
description: z.string().optional(),
|
|
344
|
-
videos: z.array(ProductVideo$inboundSchema).optional(),
|
|
345
|
-
promotion: z.array(ProductPromotion$inboundSchema).optional(),
|
|
346
|
-
subscription: z.array(ProductSubscription$inboundSchema).optional(),
|
|
347
|
-
packaging: ProductPackaging$inboundSchema.optional(),
|
|
348
|
-
variants: z.array(Variant$inboundSchema).optional(),
|
|
349
|
-
upselling_product_ids: z.array(z.string()).optional(),
|
|
350
|
-
crossselling_product_ids: z.array(z.string()).optional(),
|
|
351
|
-
reviews: z.array(ProductReview$inboundSchema).optional(),
|
|
352
|
-
bundle_items: z.array(ProductBundleItem$inboundSchema).optional(),
|
|
353
|
-
sales_channels: z.array(SalesChannel$inboundSchema).optional(),
|
|
354
|
-
metadata: z.nullable(
|
|
355
|
-
z.array(z.lazy(() => ProductDetailMetadata$inboundSchema)),
|
|
356
|
-
).optional(),
|
|
357
|
-
seo: Seo$inboundSchema.optional(),
|
|
358
|
-
reviews_tags: z.nullable(z.array(z.string())).optional(),
|
|
359
|
-
}).transform((v) => {
|
|
360
|
-
return remap$(v, {
|
|
361
|
-
"short_description": "shortDescription",
|
|
362
|
-
"product_type": "productType",
|
|
363
|
-
"stock_available": "stockAvailable",
|
|
364
|
-
"is_featured": "isFeatured",
|
|
365
|
-
"on_offer": "onOffer",
|
|
366
|
-
"on_subscription": "onSubscription",
|
|
367
|
-
"on_promotion": "onPromotion",
|
|
368
|
-
"has_variant": "hasVariant",
|
|
369
|
-
"variant_options": "variantOptions",
|
|
370
|
-
"category_ids": "categoryIds",
|
|
371
|
-
"reviews_rating_sum": "reviewsRatingSum",
|
|
372
|
-
"reviews_count": "reviewsCount",
|
|
373
|
-
"hsn_code": "hsnCode",
|
|
374
|
-
"created_at": "createdAt",
|
|
375
|
-
"modified_at": "modifiedAt",
|
|
376
|
-
"upselling_product_ids": "upsellingProductIds",
|
|
377
|
-
"crossselling_product_ids": "crosssellingProductIds",
|
|
378
|
-
"bundle_items": "bundleItems",
|
|
379
|
-
"sales_channels": "salesChannels",
|
|
380
|
-
"reviews_tags": "reviewsTags",
|
|
381
|
-
});
|
|
382
|
-
});
|
|
205
|
+
> = z.union([
|
|
206
|
+
z.union([z.lazy(() => Product2$inboundSchema), z.array(z.any())]),
|
|
207
|
+
z.union([z.lazy(() => BundleProduct2$inboundSchema), z.array(z.any())]),
|
|
208
|
+
]);
|
|
383
209
|
|
|
384
210
|
/** @internal */
|
|
385
|
-
export type ProductDetail$Outbound =
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
active: boolean;
|
|
391
|
-
sku?: string | undefined;
|
|
392
|
-
stock_available: boolean;
|
|
393
|
-
is_featured: boolean;
|
|
394
|
-
on_offer: boolean;
|
|
395
|
-
on_subscription: boolean;
|
|
396
|
-
on_promotion: boolean;
|
|
397
|
-
has_variant: boolean;
|
|
398
|
-
variant_options?:
|
|
399
|
-
| Array<ProductDetailVariantOptions$Outbound>
|
|
400
|
-
| null
|
|
401
|
-
| undefined;
|
|
402
|
-
attributes?: Array<ProductAttribute$Outbound> | undefined;
|
|
403
|
-
images?: Array<ProductImage$Outbound> | undefined;
|
|
404
|
-
pricing?: ProductPricing$Outbound | undefined;
|
|
405
|
-
shipping?: ProductShipping$Outbound | undefined;
|
|
406
|
-
tags?: Array<string> | null | undefined;
|
|
407
|
-
category_ids?: Array<string> | undefined;
|
|
408
|
-
reviews_rating_sum?: number | undefined;
|
|
409
|
-
reviews_count?: number | undefined;
|
|
410
|
-
hsn_code?: string | undefined;
|
|
411
|
-
created_at?: string | undefined;
|
|
412
|
-
modified_at?: string | undefined;
|
|
413
|
-
description?: string | undefined;
|
|
414
|
-
videos?: Array<ProductVideo$Outbound> | undefined;
|
|
415
|
-
promotion?: Array<ProductPromotion$Outbound> | undefined;
|
|
416
|
-
subscription?: Array<ProductSubscription$Outbound> | undefined;
|
|
417
|
-
packaging?: ProductPackaging$Outbound | undefined;
|
|
418
|
-
variants?: Array<Variant$Outbound> | undefined;
|
|
419
|
-
upselling_product_ids?: Array<string> | undefined;
|
|
420
|
-
crossselling_product_ids?: Array<string> | undefined;
|
|
421
|
-
reviews?: Array<ProductReview$Outbound> | undefined;
|
|
422
|
-
bundle_items?: Array<ProductBundleItem$Outbound> | undefined;
|
|
423
|
-
sales_channels?: Array<SalesChannel$Outbound> | undefined;
|
|
424
|
-
metadata?: Array<ProductDetailMetadata$Outbound> | null | undefined;
|
|
425
|
-
seo?: Seo$Outbound | undefined;
|
|
426
|
-
reviews_tags?: Array<string> | null | undefined;
|
|
427
|
-
};
|
|
211
|
+
export type ProductDetail$Outbound =
|
|
212
|
+
| Product2$Outbound
|
|
213
|
+
| Array<any>
|
|
214
|
+
| BundleProduct2$Outbound
|
|
215
|
+
| Array<any>;
|
|
428
216
|
|
|
429
217
|
/** @internal */
|
|
430
218
|
export const ProductDetail$outboundSchema: z.ZodType<
|
|
431
219
|
ProductDetail$Outbound,
|
|
432
220
|
z.ZodTypeDef,
|
|
433
221
|
ProductDetail
|
|
434
|
-
> = z.
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
productType: ProductDetailProductType$outboundSchema.optional(),
|
|
439
|
-
active: z.boolean().default(true),
|
|
440
|
-
sku: z.string().optional(),
|
|
441
|
-
stockAvailable: z.boolean().default(true),
|
|
442
|
-
isFeatured: z.boolean().default(false),
|
|
443
|
-
onOffer: z.boolean().default(false),
|
|
444
|
-
onSubscription: z.boolean().default(false),
|
|
445
|
-
onPromotion: z.boolean().default(false),
|
|
446
|
-
hasVariant: z.boolean().default(false),
|
|
447
|
-
variantOptions: z.nullable(
|
|
448
|
-
z.array(z.lazy(() => ProductDetailVariantOptions$outboundSchema)),
|
|
449
|
-
).optional(),
|
|
450
|
-
attributes: z.array(ProductAttribute$outboundSchema).optional(),
|
|
451
|
-
images: z.array(ProductImage$outboundSchema).optional(),
|
|
452
|
-
pricing: ProductPricing$outboundSchema.optional(),
|
|
453
|
-
shipping: ProductShipping$outboundSchema.optional(),
|
|
454
|
-
tags: z.nullable(z.array(z.string())).optional(),
|
|
455
|
-
categoryIds: z.array(z.string()).optional(),
|
|
456
|
-
reviewsRatingSum: z.number().optional(),
|
|
457
|
-
reviewsCount: z.number().int().optional(),
|
|
458
|
-
hsnCode: z.string().optional(),
|
|
459
|
-
createdAt: z.date().transform(v => v.toISOString()).optional(),
|
|
460
|
-
modifiedAt: z.date().transform(v => v.toISOString()).optional(),
|
|
461
|
-
description: z.string().optional(),
|
|
462
|
-
videos: z.array(ProductVideo$outboundSchema).optional(),
|
|
463
|
-
promotion: z.array(ProductPromotion$outboundSchema).optional(),
|
|
464
|
-
subscription: z.array(ProductSubscription$outboundSchema).optional(),
|
|
465
|
-
packaging: ProductPackaging$outboundSchema.optional(),
|
|
466
|
-
variants: z.array(Variant$outboundSchema).optional(),
|
|
467
|
-
upsellingProductIds: z.array(z.string()).optional(),
|
|
468
|
-
crosssellingProductIds: z.array(z.string()).optional(),
|
|
469
|
-
reviews: z.array(ProductReview$outboundSchema).optional(),
|
|
470
|
-
bundleItems: z.array(ProductBundleItem$outboundSchema).optional(),
|
|
471
|
-
salesChannels: z.array(SalesChannel$outboundSchema).optional(),
|
|
472
|
-
metadata: z.nullable(
|
|
473
|
-
z.array(z.lazy(() => ProductDetailMetadata$outboundSchema)),
|
|
474
|
-
).optional(),
|
|
475
|
-
seo: Seo$outboundSchema.optional(),
|
|
476
|
-
reviewsTags: z.nullable(z.array(z.string())).optional(),
|
|
477
|
-
}).transform((v) => {
|
|
478
|
-
return remap$(v, {
|
|
479
|
-
shortDescription: "short_description",
|
|
480
|
-
productType: "product_type",
|
|
481
|
-
stockAvailable: "stock_available",
|
|
482
|
-
isFeatured: "is_featured",
|
|
483
|
-
onOffer: "on_offer",
|
|
484
|
-
onSubscription: "on_subscription",
|
|
485
|
-
onPromotion: "on_promotion",
|
|
486
|
-
hasVariant: "has_variant",
|
|
487
|
-
variantOptions: "variant_options",
|
|
488
|
-
categoryIds: "category_ids",
|
|
489
|
-
reviewsRatingSum: "reviews_rating_sum",
|
|
490
|
-
reviewsCount: "reviews_count",
|
|
491
|
-
hsnCode: "hsn_code",
|
|
492
|
-
createdAt: "created_at",
|
|
493
|
-
modifiedAt: "modified_at",
|
|
494
|
-
upsellingProductIds: "upselling_product_ids",
|
|
495
|
-
crosssellingProductIds: "crossselling_product_ids",
|
|
496
|
-
bundleItems: "bundle_items",
|
|
497
|
-
salesChannels: "sales_channels",
|
|
498
|
-
reviewsTags: "reviews_tags",
|
|
499
|
-
});
|
|
500
|
-
});
|
|
222
|
+
> = z.union([
|
|
223
|
+
z.union([z.lazy(() => Product2$outboundSchema), z.array(z.any())]),
|
|
224
|
+
z.union([z.lazy(() => BundleProduct2$outboundSchema), z.array(z.any())]),
|
|
225
|
+
]);
|
|
501
226
|
|
|
502
227
|
/**
|
|
503
228
|
* @internal
|