ce-storefront 0.3.5 → 0.3.7
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/bundleproduct.d.ts +236 -0
- package/esm/models/components/bundleproduct.d.ts.map +1 -0
- package/esm/models/components/bundleproduct.js +262 -0
- package/esm/models/components/bundleproduct.js.map +1 -0
- package/esm/models/components/bundleproductdetail.d.ts +265 -0
- package/esm/models/components/bundleproductdetail.d.ts.map +1 -0
- package/esm/models/components/bundleproductdetail.js +288 -0
- package/esm/models/components/bundleproductdetail.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 +8 -6
- package/esm/models/components/index.d.ts.map +1 -1
- package/esm/models/components/index.js +8 -6
- package/esm/models/components/index.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 +16 -188
- package/esm/models/components/productdetail.d.ts.map +1 -1
- package/esm/models/components/productdetail.js +26 -228
- package/esm/models/components/productdetail.js.map +1 -1
- package/esm/models/components/productlistresponse.d.ts +49 -3
- package/esm/models/components/productlistresponse.d.ts.map +1 -1
- package/esm/models/components/productlistresponse.js +65 -3
- package/esm/models/components/productlistresponse.js.map +1 -1
- package/esm/models/components/productshipping.d.ts +13 -15
- package/esm/models/components/productshipping.d.ts.map +1 -1
- package/esm/models/components/productshipping.js +14 -18
- 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/{product.d.ts → singleproduct.d.ts} +52 -75
- package/esm/models/components/singleproduct.d.ts.map +1 -0
- package/esm/models/components/{product.js → singleproduct.js} +37 -95
- package/esm/models/components/singleproduct.js.map +1 -0
- package/esm/models/components/singleproductdetail.d.ts +159 -0
- package/esm/models/components/singleproductdetail.d.ts.map +1 -0
- package/esm/models/components/singleproductdetail.js +156 -0
- package/esm/models/components/singleproductdetail.js.map +1 -0
- package/esm/models/components/{skuinfo.d.ts → sku.d.ts} +59 -48
- package/esm/models/components/sku.d.ts.map +1 -0
- package/esm/models/components/{skuinfo.js → sku.js} +67 -57
- package/esm/models/components/sku.js.map +1 -0
- package/esm/models/components/variant.d.ts +42 -72
- package/esm/models/components/variant.d.ts.map +1 -1
- package/esm/models/components/variant.js +39 -82
- package/esm/models/components/variant.js.map +1 -1
- package/esm/models/components/variantdetail.d.ts +101 -68
- package/esm/models/components/variantdetail.d.ts.map +1 -1
- package/esm/models/components/variantdetail.js +99 -71
- 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/bundleproduct.ts +501 -0
- package/src/models/components/bundleproductdetail.ts +567 -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 +8 -6
- package/src/models/components/productattribute.ts +162 -188
- package/src/models/components/productcategory.ts +4 -4
- package/src/models/components/productdetail.ts +52 -475
- package/src/models/components/productlistresponse.ts +147 -9
- package/src/models/components/productshipping.ts +27 -33
- package/src/models/components/{promotion.ts → promotiondetail.ts} +47 -45
- package/src/models/components/seo.ts +12 -25
- package/src/models/components/singleproduct.ts +269 -0
- package/src/models/components/singleproductdetail.ts +339 -0
- package/src/models/components/sku.ts +252 -0
- package/src/models/components/variant.ts +81 -170
- package/src/models/components/variantdetail.ts +189 -168
- 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/product.d.ts.map +0 -1
- package/esm/models/components/product.js.map +0 -1
- 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/product.ts +0 -363
- 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,501 +3,78 @@
|
|
|
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
9
|
import {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
} from "./
|
|
10
|
+
BundleProductDetail,
|
|
11
|
+
BundleProductDetail$inboundSchema,
|
|
12
|
+
BundleProductDetail$Outbound,
|
|
13
|
+
BundleProductDetail$outboundSchema,
|
|
14
|
+
} from "./bundleproductdetail.js";
|
|
17
15
|
import {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
} from "./
|
|
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
|
-
};
|
|
161
|
-
|
|
162
|
-
/** @internal */
|
|
163
|
-
export const ProductDetailProductType$inboundSchema: z.ZodNativeEnum<
|
|
164
|
-
typeof ProductDetailProductType
|
|
165
|
-
> = z.nativeEnum(ProductDetailProductType);
|
|
166
|
-
|
|
167
|
-
/** @internal */
|
|
168
|
-
export const ProductDetailProductType$outboundSchema: z.ZodNativeEnum<
|
|
169
|
-
typeof ProductDetailProductType
|
|
170
|
-
> = ProductDetailProductType$inboundSchema;
|
|
171
|
-
|
|
172
|
-
/**
|
|
173
|
-
* @internal
|
|
174
|
-
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
175
|
-
*/
|
|
176
|
-
export namespace ProductDetailProductType$ {
|
|
177
|
-
/** @deprecated use `ProductDetailProductType$inboundSchema` instead. */
|
|
178
|
-
export const inboundSchema = ProductDetailProductType$inboundSchema;
|
|
179
|
-
/** @deprecated use `ProductDetailProductType$outboundSchema` instead. */
|
|
180
|
-
export const outboundSchema = ProductDetailProductType$outboundSchema;
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
/** @internal */
|
|
184
|
-
export const ProductDetailVariantOptions$inboundSchema: z.ZodType<
|
|
185
|
-
ProductDetailVariantOptions,
|
|
186
|
-
z.ZodTypeDef,
|
|
187
|
-
unknown
|
|
188
|
-
> = z.object({
|
|
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
|
-
});
|
|
197
|
-
|
|
198
|
-
/** @internal */
|
|
199
|
-
export type ProductDetailVariantOptions$Outbound = {
|
|
200
|
-
option_name?: string | undefined;
|
|
201
|
-
option_value?: Array<string> | undefined;
|
|
202
|
-
};
|
|
203
|
-
|
|
204
|
-
/** @internal */
|
|
205
|
-
export const ProductDetailVariantOptions$outboundSchema: z.ZodType<
|
|
206
|
-
ProductDetailVariantOptions$Outbound,
|
|
207
|
-
z.ZodTypeDef,
|
|
208
|
-
ProductDetailVariantOptions
|
|
209
|
-
> = z.object({
|
|
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
|
-
});
|
|
218
|
-
|
|
219
|
-
/**
|
|
220
|
-
* @internal
|
|
221
|
-
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
222
|
-
*/
|
|
223
|
-
export namespace ProductDetailVariantOptions$ {
|
|
224
|
-
/** @deprecated use `ProductDetailVariantOptions$inboundSchema` instead. */
|
|
225
|
-
export const inboundSchema = ProductDetailVariantOptions$inboundSchema;
|
|
226
|
-
/** @deprecated use `ProductDetailVariantOptions$outboundSchema` instead. */
|
|
227
|
-
export const outboundSchema = ProductDetailVariantOptions$outboundSchema;
|
|
228
|
-
/** @deprecated use `ProductDetailVariantOptions$Outbound` instead. */
|
|
229
|
-
export type Outbound = ProductDetailVariantOptions$Outbound;
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
export function productDetailVariantOptionsToJSON(
|
|
233
|
-
productDetailVariantOptions: ProductDetailVariantOptions,
|
|
234
|
-
): string {
|
|
235
|
-
return JSON.stringify(
|
|
236
|
-
ProductDetailVariantOptions$outboundSchema.parse(
|
|
237
|
-
productDetailVariantOptions,
|
|
238
|
-
),
|
|
239
|
-
);
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
export function productDetailVariantOptionsFromJSON(
|
|
243
|
-
jsonString: string,
|
|
244
|
-
): SafeParseResult<ProductDetailVariantOptions, SDKValidationError> {
|
|
245
|
-
return safeParse(
|
|
246
|
-
jsonString,
|
|
247
|
-
(x) => ProductDetailVariantOptions$inboundSchema.parse(JSON.parse(x)),
|
|
248
|
-
`Failed to parse 'ProductDetailVariantOptions' from JSON`,
|
|
249
|
-
);
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
/** @internal */
|
|
253
|
-
export const ProductDetailMetadata$inboundSchema: z.ZodType<
|
|
254
|
-
ProductDetailMetadata,
|
|
255
|
-
z.ZodTypeDef,
|
|
256
|
-
unknown
|
|
257
|
-
> = z.object({
|
|
258
|
-
name: z.string().optional(),
|
|
259
|
-
value: z.string().optional(),
|
|
260
|
-
});
|
|
261
|
-
|
|
262
|
-
/** @internal */
|
|
263
|
-
export type ProductDetailMetadata$Outbound = {
|
|
264
|
-
name?: string | undefined;
|
|
265
|
-
value?: string | undefined;
|
|
266
|
-
};
|
|
267
|
-
|
|
268
|
-
/** @internal */
|
|
269
|
-
export const ProductDetailMetadata$outboundSchema: z.ZodType<
|
|
270
|
-
ProductDetailMetadata$Outbound,
|
|
271
|
-
z.ZodTypeDef,
|
|
272
|
-
ProductDetailMetadata
|
|
273
|
-
> = z.object({
|
|
274
|
-
name: z.string().optional(),
|
|
275
|
-
value: z.string().optional(),
|
|
276
|
-
});
|
|
277
|
-
|
|
278
|
-
/**
|
|
279
|
-
* @internal
|
|
280
|
-
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
281
|
-
*/
|
|
282
|
-
export namespace ProductDetailMetadata$ {
|
|
283
|
-
/** @deprecated use `ProductDetailMetadata$inboundSchema` instead. */
|
|
284
|
-
export const inboundSchema = ProductDetailMetadata$inboundSchema;
|
|
285
|
-
/** @deprecated use `ProductDetailMetadata$outboundSchema` instead. */
|
|
286
|
-
export const outboundSchema = ProductDetailMetadata$outboundSchema;
|
|
287
|
-
/** @deprecated use `ProductDetailMetadata$Outbound` instead. */
|
|
288
|
-
export type Outbound = ProductDetailMetadata$Outbound;
|
|
289
|
-
}
|
|
16
|
+
SingleProductDetail,
|
|
17
|
+
SingleProductDetail$inboundSchema,
|
|
18
|
+
SingleProductDetail$Outbound,
|
|
19
|
+
SingleProductDetail$outboundSchema,
|
|
20
|
+
} from "./singleproductdetail.js";
|
|
290
21
|
|
|
291
|
-
export
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
ProductDetailMetadata$outboundSchema.parse(productDetailMetadata),
|
|
296
|
-
);
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
export function productDetailMetadataFromJSON(
|
|
300
|
-
jsonString: string,
|
|
301
|
-
): SafeParseResult<ProductDetailMetadata, SDKValidationError> {
|
|
302
|
-
return safeParse(
|
|
303
|
-
jsonString,
|
|
304
|
-
(x) => ProductDetailMetadata$inboundSchema.parse(JSON.parse(x)),
|
|
305
|
-
`Failed to parse 'ProductDetailMetadata' from JSON`,
|
|
306
|
-
);
|
|
307
|
-
}
|
|
22
|
+
export type ProductDetail =
|
|
23
|
+
| (SingleProductDetail & { productType: "physical" })
|
|
24
|
+
| (SingleProductDetail & { productType: "digital" })
|
|
25
|
+
| (BundleProductDetail & { productType: "bundle" });
|
|
308
26
|
|
|
309
27
|
/** @internal */
|
|
310
28
|
export const ProductDetail$inboundSchema: z.ZodType<
|
|
311
29
|
ProductDetail,
|
|
312
30
|
z.ZodTypeDef,
|
|
313
31
|
unknown
|
|
314
|
-
> = z.
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
)
|
|
330
|
-
|
|
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
|
-
});
|
|
32
|
+
> = z.union([
|
|
33
|
+
SingleProductDetail$inboundSchema.and(
|
|
34
|
+
z.object({ product_type: z.literal("physical") }).transform((v) => ({
|
|
35
|
+
productType: v.product_type,
|
|
36
|
+
})),
|
|
37
|
+
),
|
|
38
|
+
SingleProductDetail$inboundSchema.and(
|
|
39
|
+
z.object({ product_type: z.literal("digital") }).transform((v) => ({
|
|
40
|
+
productType: v.product_type,
|
|
41
|
+
})),
|
|
42
|
+
),
|
|
43
|
+
BundleProductDetail$inboundSchema.and(
|
|
44
|
+
z.object({ product_type: z.literal("bundle") }).transform((v) => ({
|
|
45
|
+
productType: v.product_type,
|
|
46
|
+
})),
|
|
47
|
+
),
|
|
48
|
+
]);
|
|
383
49
|
|
|
384
50
|
/** @internal */
|
|
385
|
-
export type ProductDetail$Outbound =
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
product_type?: string | undefined;
|
|
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
|
-
};
|
|
51
|
+
export type ProductDetail$Outbound =
|
|
52
|
+
| (SingleProductDetail$Outbound & { product_type: "physical" })
|
|
53
|
+
| (SingleProductDetail$Outbound & { product_type: "digital" })
|
|
54
|
+
| (BundleProductDetail$Outbound & { product_type: "bundle" });
|
|
428
55
|
|
|
429
56
|
/** @internal */
|
|
430
57
|
export const ProductDetail$outboundSchema: z.ZodType<
|
|
431
58
|
ProductDetail$Outbound,
|
|
432
59
|
z.ZodTypeDef,
|
|
433
60
|
ProductDetail
|
|
434
|
-
> = z.
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
)
|
|
450
|
-
|
|
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
|
-
});
|
|
61
|
+
> = z.union([
|
|
62
|
+
SingleProductDetail$outboundSchema.and(
|
|
63
|
+
z.object({ productType: z.literal("physical") }).transform((v) => ({
|
|
64
|
+
product_type: v.productType,
|
|
65
|
+
})),
|
|
66
|
+
),
|
|
67
|
+
SingleProductDetail$outboundSchema.and(
|
|
68
|
+
z.object({ productType: z.literal("digital") }).transform((v) => ({
|
|
69
|
+
product_type: v.productType,
|
|
70
|
+
})),
|
|
71
|
+
),
|
|
72
|
+
BundleProductDetail$outboundSchema.and(
|
|
73
|
+
z.object({ productType: z.literal("bundle") }).transform((v) => ({
|
|
74
|
+
product_type: v.productType,
|
|
75
|
+
})),
|
|
76
|
+
),
|
|
77
|
+
]);
|
|
501
78
|
|
|
502
79
|
/**
|
|
503
80
|
* @internal
|