ce-storefront 0.3.9 → 0.3.11
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/docs/sdks/auth/README.md +2 -0
- package/docs/sdks/carts/README.md +22 -12
- package/docs/sdks/cestorefrontuser/README.md +30 -2
- package/docs/sdks/checkout/README.md +4 -0
- package/esm/funcs/cartsAddItem.js +1 -1
- package/esm/funcs/cartsAddItem.js.map +1 -1
- package/esm/lib/config.d.ts +2 -2
- package/esm/lib/config.js +2 -2
- package/esm/lib/config.js.map +1 -1
- package/esm/models/components/anonymoususer.d.ts +14 -14
- package/esm/models/components/anonymoususer.d.ts.map +1 -1
- package/esm/models/components/anonymoususer.js +14 -14
- package/esm/models/components/anonymoususer.js.map +1 -1
- package/esm/models/components/associatedoption.d.ts +4 -102
- package/esm/models/components/associatedoption.d.ts.map +1 -1
- package/esm/models/components/associatedoption.js +4 -82
- package/esm/models/components/associatedoption.js.map +1 -1
- package/esm/models/components/bundleproduct.d.ts +48 -48
- package/esm/models/components/bundleproduct.d.ts.map +1 -1
- package/esm/models/components/bundleproduct.js +46 -50
- package/esm/models/components/bundleproduct.js.map +1 -1
- package/esm/models/components/bundleproductdetail.d.ts +66 -66
- package/esm/models/components/bundleproductdetail.d.ts.map +1 -1
- package/esm/models/components/bundleproductdetail.js +62 -66
- package/esm/models/components/bundleproductdetail.js.map +1 -1
- package/esm/models/components/coloroption.d.ts +72 -0
- package/esm/models/components/coloroption.d.ts.map +1 -0
- package/esm/models/components/coloroption.js +62 -0
- package/esm/models/components/coloroption.js.map +1 -0
- package/esm/models/components/currency.d.ts +6 -6
- package/esm/models/components/currency.d.ts.map +1 -1
- package/esm/models/components/currency.js +6 -6
- package/esm/models/components/currency.js.map +1 -1
- package/esm/models/components/index.d.ts +3 -1
- package/esm/models/components/index.d.ts.map +1 -1
- package/esm/models/components/index.js +3 -1
- package/esm/models/components/index.js.map +1 -1
- package/esm/models/components/notificationpreferences.d.ts +6 -6
- package/esm/models/components/notificationpreferences.d.ts.map +1 -1
- package/esm/models/components/notificationpreferences.js +6 -6
- package/esm/models/components/notificationpreferences.js.map +1 -1
- package/esm/models/components/pagination.d.ts +8 -8
- package/esm/models/components/pagination.d.ts.map +1 -1
- package/esm/models/components/pagination.js +8 -8
- package/esm/models/components/pagination.js.map +1 -1
- package/esm/models/components/productattribute.d.ts +2 -2
- package/esm/models/components/productattribute.d.ts.map +1 -1
- package/esm/models/components/productattribute.js +2 -2
- package/esm/models/components/productattribute.js.map +1 -1
- package/esm/models/components/productcategory.d.ts +20 -20
- package/esm/models/components/productcategory.d.ts.map +1 -1
- package/esm/models/components/productcategory.js +20 -20
- package/esm/models/components/productcategory.js.map +1 -1
- package/esm/models/components/productdetail.d.ts +2 -14
- package/esm/models/components/productdetail.d.ts.map +1 -1
- package/esm/models/components/productdetail.js +4 -18
- package/esm/models/components/productdetail.js.map +1 -1
- package/esm/models/components/productimage.d.ts +14 -14
- package/esm/models/components/productimage.d.ts.map +1 -1
- package/esm/models/components/productimage.js +14 -14
- package/esm/models/components/productimage.js.map +1 -1
- package/esm/models/components/productpricing.d.ts +4 -4
- package/esm/models/components/productpricing.d.ts.map +1 -1
- package/esm/models/components/productpricing.js +4 -4
- package/esm/models/components/productpricing.js.map +1 -1
- package/esm/models/components/productshipping.d.ts +12 -12
- package/esm/models/components/productshipping.d.ts.map +1 -1
- package/esm/models/components/productshipping.js +12 -12
- package/esm/models/components/productshipping.js.map +1 -1
- package/esm/models/components/productvideo.d.ts +16 -16
- package/esm/models/components/productvideo.d.ts.map +1 -1
- package/esm/models/components/productvideo.js +16 -16
- package/esm/models/components/productvideo.js.map +1 -1
- package/esm/models/components/seo.d.ts +8 -8
- package/esm/models/components/seo.d.ts.map +1 -1
- package/esm/models/components/seo.js +8 -8
- package/esm/models/components/seo.js.map +1 -1
- package/esm/models/components/singleproduct.d.ts +18 -18
- package/esm/models/components/singleproduct.d.ts.map +1 -1
- package/esm/models/components/singleproduct.js +18 -18
- package/esm/models/components/singleproduct.js.map +1 -1
- package/esm/models/components/singleproductdetail.d.ts +36 -36
- package/esm/models/components/singleproductdetail.d.ts.map +1 -1
- package/esm/models/components/singleproductdetail.js +34 -34
- package/esm/models/components/singleproductdetail.js.map +1 -1
- package/esm/models/components/singleselectoption.d.ts +42 -0
- package/esm/models/components/singleselectoption.d.ts.map +1 -0
- package/esm/models/components/singleselectoption.js +35 -0
- package/esm/models/components/singleselectoption.js.map +1 -0
- package/esm/models/components/sku.d.ts +30 -30
- package/esm/models/components/sku.d.ts.map +1 -1
- package/esm/models/components/sku.js +28 -30
- package/esm/models/components/sku.js.map +1 -1
- package/esm/models/components/updatecartitem.d.ts +45 -0
- package/esm/models/components/updatecartitem.d.ts.map +1 -0
- package/esm/models/components/updatecartitem.js +46 -0
- package/esm/models/components/updatecartitem.js.map +1 -0
- package/esm/models/components/user.d.ts +116 -26
- package/esm/models/components/user.d.ts.map +1 -1
- package/esm/models/components/user.js +104 -30
- package/esm/models/components/user.js.map +1 -1
- package/esm/models/components/variant.d.ts +15 -12
- package/esm/models/components/variant.d.ts.map +1 -1
- package/esm/models/components/variant.js +12 -12
- package/esm/models/components/variant.js.map +1 -1
- package/esm/models/components/variantdetail.d.ts +41 -38
- package/esm/models/components/variantdetail.d.ts.map +1 -1
- package/esm/models/components/variantdetail.js +36 -36
- package/esm/models/components/variantdetail.js.map +1 -1
- package/esm/models/components/variantoption.d.ts +34 -26
- package/esm/models/components/variantoption.d.ts.map +1 -1
- package/esm/models/components/variantoption.js +32 -45
- package/esm/models/components/variantoption.js.map +1 -1
- package/esm/models/operations/getcrosssell.d.ts +6 -6
- package/esm/models/operations/getcrosssell.d.ts.map +1 -1
- package/esm/models/operations/getcrosssell.js +6 -6
- package/esm/models/operations/getcrosssell.js.map +1 -1
- package/esm/models/operations/getproductscategories.d.ts +4 -4
- package/esm/models/operations/getproductscategories.d.ts.map +1 -1
- package/esm/models/operations/getproductscategories.js +4 -4
- package/esm/models/operations/getproductscategories.js.map +1 -1
- package/esm/models/operations/getproductsidreviews.d.ts +4 -4
- package/esm/models/operations/getproductsidreviews.d.ts.map +1 -1
- package/esm/models/operations/getproductsidreviews.js +4 -4
- package/esm/models/operations/getproductsidreviews.js.map +1 -1
- package/esm/models/operations/getsimilar.d.ts +6 -6
- package/esm/models/operations/getsimilar.d.ts.map +1 -1
- package/esm/models/operations/getsimilar.js +6 -6
- package/esm/models/operations/getsimilar.js.map +1 -1
- package/esm/models/operations/getskus.d.ts +4 -4
- package/esm/models/operations/getskus.d.ts.map +1 -1
- package/esm/models/operations/getskus.js +4 -4
- package/esm/models/operations/getskus.js.map +1 -1
- package/esm/models/operations/getupsell.d.ts +6 -6
- package/esm/models/operations/getupsell.d.ts.map +1 -1
- package/esm/models/operations/getupsell.js +6 -6
- package/esm/models/operations/getupsell.js.map +1 -1
- package/esm/models/operations/postauthanonymous.d.ts +12 -12
- package/esm/models/operations/postauthanonymous.d.ts.map +1 -1
- package/esm/models/operations/postauthanonymous.js +12 -12
- package/esm/models/operations/postauthanonymous.js.map +1 -1
- package/esm/models/operations/postauthgenerateotp.d.ts +2 -2
- package/esm/models/operations/postauthgenerateotp.d.ts.map +1 -1
- package/esm/models/operations/postauthgenerateotp.js +2 -2
- package/esm/models/operations/postauthgenerateotp.js.map +1 -1
- package/esm/models/operations/postcartaddress.d.ts +8 -8
- package/esm/models/operations/postcartaddress.d.ts.map +1 -1
- package/esm/models/operations/postcartaddress.js +8 -12
- package/esm/models/operations/postcartaddress.js.map +1 -1
- package/esm/models/operations/postcartitemid.d.ts +2 -35
- package/esm/models/operations/postcartitemid.d.ts.map +1 -1
- package/esm/models/operations/postcartitemid.js +4 -49
- package/esm/models/operations/postcartitemid.js.map +1 -1
- package/esm/models/operations/postcartsid.d.ts +5 -31
- package/esm/models/operations/postcartsid.d.ts.map +1 -1
- package/esm/models/operations/postcartsid.js +2 -41
- package/esm/models/operations/postcartsid.js.map +1 -1
- package/esm/models/operations/postproductsidreviews.d.ts +4 -4
- package/esm/models/operations/postproductsidreviews.d.ts.map +1 -1
- package/esm/models/operations/postproductsidreviews.js +4 -4
- package/esm/models/operations/postproductsidreviews.js.map +1 -1
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/funcs/cartsAddItem.ts +1 -1
- package/src/lib/config.ts +2 -2
- package/src/models/components/anonymoususer.ts +28 -28
- package/src/models/components/associatedoption.ts +19 -164
- package/src/models/components/bundleproduct.ts +92 -99
- package/src/models/components/bundleproductdetail.ts +124 -131
- package/src/models/components/coloroption.ts +144 -0
- package/src/models/components/currency.ts +12 -12
- package/src/models/components/index.ts +3 -1
- package/src/models/components/notificationpreferences.ts +12 -12
- package/src/models/components/pagination.ts +16 -16
- package/src/models/components/productattribute.ts +4 -4
- package/src/models/components/productcategory.ts +40 -40
- package/src/models/components/productdetail.ts +7 -37
- package/src/models/components/productimage.ts +28 -28
- package/src/models/components/productpricing.ts +8 -8
- package/src/models/components/productshipping.ts +24 -24
- package/src/models/components/productvideo.ts +32 -32
- package/src/models/components/seo.ts +16 -16
- package/src/models/components/singleproduct.ts +36 -36
- package/src/models/components/singleproductdetail.ts +68 -68
- package/src/models/components/singleselectoption.ts +83 -0
- package/src/models/components/sku.ts +56 -61
- package/src/models/components/updatecartitem.ts +93 -0
- package/src/models/components/user.ts +199 -56
- package/src/models/components/variant.ts +27 -24
- package/src/models/components/variantdetail.ts +75 -72
- package/src/models/components/variantoption.ts +54 -61
- package/src/models/operations/getcrosssell.ts +12 -12
- package/src/models/operations/getproductscategories.ts +8 -8
- package/src/models/operations/getproductsidreviews.ts +8 -8
- package/src/models/operations/getsimilar.ts +12 -12
- package/src/models/operations/getskus.ts +8 -8
- package/src/models/operations/getupsell.ts +12 -12
- package/src/models/operations/postauthanonymous.ts +24 -24
- package/src/models/operations/postauthgenerateotp.ts +4 -4
- package/src/models/operations/postcartaddress.ts +16 -23
- package/src/models/operations/postcartitemid.ts +6 -94
- package/src/models/operations/postcartsid.ts +7 -72
- package/src/models/operations/postproductsidreviews.ts +8 -8
- package/esm/models/components/userinput.d.ts +0 -63
- package/esm/models/components/userinput.d.ts.map +0 -1
- package/esm/models/components/userinput.js +0 -61
- package/esm/models/components/userinput.js.map +0 -1
- package/src/models/components/userinput.ts +0 -130
|
@@ -90,8 +90,8 @@ export type VariantDetail = {
|
|
|
90
90
|
/**
|
|
91
91
|
* variant sku
|
|
92
92
|
*/
|
|
93
|
-
sku
|
|
94
|
-
slug
|
|
93
|
+
sku: string | null;
|
|
94
|
+
slug: string | null;
|
|
95
95
|
/**
|
|
96
96
|
* variant name
|
|
97
97
|
*/
|
|
@@ -100,7 +100,7 @@ export type VariantDetail = {
|
|
|
100
100
|
* variant name
|
|
101
101
|
*/
|
|
102
102
|
productName: string;
|
|
103
|
-
shortDescription: string;
|
|
103
|
+
shortDescription: string | null;
|
|
104
104
|
active: boolean;
|
|
105
105
|
stockAvailable: boolean;
|
|
106
106
|
/**
|
|
@@ -113,25 +113,28 @@ export type VariantDetail = {
|
|
|
113
113
|
* Indicates whether a variant is marked as the default variant for a product
|
|
114
114
|
*/
|
|
115
115
|
isDefault: boolean;
|
|
116
|
+
/**
|
|
117
|
+
* An object where each key is an option name, and the value describes the option details.
|
|
118
|
+
*/
|
|
116
119
|
associatedOptions: { [k: string]: AssociatedOption };
|
|
117
|
-
images
|
|
120
|
+
images: Array<ProductImage>;
|
|
118
121
|
pricing: ProductPricing;
|
|
119
|
-
subscription
|
|
120
|
-
promotion
|
|
122
|
+
subscription: Array<ProductSubscription>;
|
|
123
|
+
promotion: Array<ProductPromotion>;
|
|
121
124
|
productType: VariantDetailProductType;
|
|
122
|
-
description
|
|
123
|
-
categoryIds
|
|
124
|
-
tags
|
|
125
|
-
reviewRatingSum
|
|
126
|
-
reviewsCount
|
|
127
|
-
hsnCode
|
|
125
|
+
description: string | null;
|
|
126
|
+
categoryIds: Array<string>;
|
|
127
|
+
tags: Array<string> | null;
|
|
128
|
+
reviewRatingSum: number | null;
|
|
129
|
+
reviewsCount: number;
|
|
130
|
+
hsnCode: string | null;
|
|
128
131
|
variantOptions: Array<VariantOption>;
|
|
129
|
-
productAttributes
|
|
130
|
-
variantAttributes
|
|
131
|
-
videos
|
|
132
|
-
shipping
|
|
133
|
-
seo
|
|
134
|
-
metadata
|
|
132
|
+
productAttributes: Array<ProductAttribute>;
|
|
133
|
+
variantAttributes: Array<ProductAttribute>;
|
|
134
|
+
videos: Array<ProductVideo>;
|
|
135
|
+
shipping: ProductShipping | null;
|
|
136
|
+
seo: Seo;
|
|
137
|
+
metadata: { [k: string]: string };
|
|
135
138
|
};
|
|
136
139
|
|
|
137
140
|
/** @internal */
|
|
@@ -163,11 +166,11 @@ export const VariantDetail$inboundSchema: z.ZodType<
|
|
|
163
166
|
> = z.object({
|
|
164
167
|
id: z.string(),
|
|
165
168
|
product_id: z.string(),
|
|
166
|
-
sku: z.
|
|
167
|
-
slug: z.
|
|
169
|
+
sku: z.nullable(z.string()),
|
|
170
|
+
slug: z.nullable(z.string()),
|
|
168
171
|
name: z.string(),
|
|
169
172
|
product_name: z.string(),
|
|
170
|
-
short_description: z.string(),
|
|
173
|
+
short_description: z.nullable(z.string()),
|
|
171
174
|
active: z.boolean(),
|
|
172
175
|
stock_available: z.boolean(),
|
|
173
176
|
on_offer: z.boolean().default(false),
|
|
@@ -175,24 +178,24 @@ export const VariantDetail$inboundSchema: z.ZodType<
|
|
|
175
178
|
on_subscription: z.boolean().default(false),
|
|
176
179
|
is_default: z.boolean(),
|
|
177
180
|
associated_options: z.record(AssociatedOption$inboundSchema),
|
|
178
|
-
images: z.array(ProductImage$inboundSchema)
|
|
181
|
+
images: z.array(ProductImage$inboundSchema),
|
|
179
182
|
pricing: ProductPricing$inboundSchema,
|
|
180
|
-
subscription: z.array(ProductSubscription$inboundSchema)
|
|
181
|
-
promotion: z.array(ProductPromotion$inboundSchema)
|
|
183
|
+
subscription: z.array(ProductSubscription$inboundSchema),
|
|
184
|
+
promotion: z.array(ProductPromotion$inboundSchema),
|
|
182
185
|
product_type: VariantDetailProductType$inboundSchema,
|
|
183
|
-
description: z.
|
|
184
|
-
category_ids: z.array(z.string())
|
|
185
|
-
tags: z.nullable(z.array(z.string()))
|
|
186
|
-
review_rating_sum: z.
|
|
187
|
-
reviews_count: z.number().int()
|
|
188
|
-
hsn_code: z.
|
|
186
|
+
description: z.nullable(z.string()),
|
|
187
|
+
category_ids: z.array(z.string()),
|
|
188
|
+
tags: z.nullable(z.array(z.string())),
|
|
189
|
+
review_rating_sum: z.nullable(z.number()),
|
|
190
|
+
reviews_count: z.number().int(),
|
|
191
|
+
hsn_code: z.nullable(z.string()),
|
|
189
192
|
variant_options: z.array(VariantOption$inboundSchema),
|
|
190
|
-
product_attributes: z.array(ProductAttribute$inboundSchema)
|
|
191
|
-
variant_attributes: z.array(ProductAttribute$inboundSchema)
|
|
192
|
-
videos: z.array(ProductVideo$inboundSchema)
|
|
193
|
-
shipping: z.nullable(ProductShipping$inboundSchema)
|
|
194
|
-
seo: Seo$inboundSchema
|
|
195
|
-
metadata: z.record(z.string())
|
|
193
|
+
product_attributes: z.array(ProductAttribute$inboundSchema),
|
|
194
|
+
variant_attributes: z.array(ProductAttribute$inboundSchema),
|
|
195
|
+
videos: z.array(ProductVideo$inboundSchema),
|
|
196
|
+
shipping: z.nullable(ProductShipping$inboundSchema),
|
|
197
|
+
seo: Seo$inboundSchema,
|
|
198
|
+
metadata: z.record(z.string()),
|
|
196
199
|
}).transform((v) => {
|
|
197
200
|
return remap$(v, {
|
|
198
201
|
"product_id": "productId",
|
|
@@ -219,11 +222,11 @@ export const VariantDetail$inboundSchema: z.ZodType<
|
|
|
219
222
|
export type VariantDetail$Outbound = {
|
|
220
223
|
id: string;
|
|
221
224
|
product_id: string;
|
|
222
|
-
sku
|
|
223
|
-
slug
|
|
225
|
+
sku: string | null;
|
|
226
|
+
slug: string | null;
|
|
224
227
|
name: string;
|
|
225
228
|
product_name: string;
|
|
226
|
-
short_description: string;
|
|
229
|
+
short_description: string | null;
|
|
227
230
|
active: boolean;
|
|
228
231
|
stock_available: boolean;
|
|
229
232
|
on_offer: boolean;
|
|
@@ -231,24 +234,24 @@ export type VariantDetail$Outbound = {
|
|
|
231
234
|
on_subscription: boolean;
|
|
232
235
|
is_default: boolean;
|
|
233
236
|
associated_options: { [k: string]: AssociatedOption$Outbound };
|
|
234
|
-
images
|
|
237
|
+
images: Array<ProductImage$Outbound>;
|
|
235
238
|
pricing: ProductPricing$Outbound;
|
|
236
|
-
subscription
|
|
237
|
-
promotion
|
|
239
|
+
subscription: Array<ProductSubscription$Outbound>;
|
|
240
|
+
promotion: Array<ProductPromotion$Outbound>;
|
|
238
241
|
product_type: string;
|
|
239
|
-
description
|
|
240
|
-
category_ids
|
|
241
|
-
tags
|
|
242
|
-
review_rating_sum
|
|
243
|
-
reviews_count
|
|
244
|
-
hsn_code
|
|
242
|
+
description: string | null;
|
|
243
|
+
category_ids: Array<string>;
|
|
244
|
+
tags: Array<string> | null;
|
|
245
|
+
review_rating_sum: number | null;
|
|
246
|
+
reviews_count: number;
|
|
247
|
+
hsn_code: string | null;
|
|
245
248
|
variant_options: Array<VariantOption$Outbound>;
|
|
246
|
-
product_attributes
|
|
247
|
-
variant_attributes
|
|
248
|
-
videos
|
|
249
|
-
shipping
|
|
250
|
-
seo
|
|
251
|
-
metadata
|
|
249
|
+
product_attributes: Array<ProductAttribute$Outbound>;
|
|
250
|
+
variant_attributes: Array<ProductAttribute$Outbound>;
|
|
251
|
+
videos: Array<ProductVideo$Outbound>;
|
|
252
|
+
shipping: ProductShipping$Outbound | null;
|
|
253
|
+
seo: Seo$Outbound;
|
|
254
|
+
metadata: { [k: string]: string };
|
|
252
255
|
};
|
|
253
256
|
|
|
254
257
|
/** @internal */
|
|
@@ -259,11 +262,11 @@ export const VariantDetail$outboundSchema: z.ZodType<
|
|
|
259
262
|
> = z.object({
|
|
260
263
|
id: z.string(),
|
|
261
264
|
productId: z.string(),
|
|
262
|
-
sku: z.
|
|
263
|
-
slug: z.
|
|
265
|
+
sku: z.nullable(z.string()),
|
|
266
|
+
slug: z.nullable(z.string()),
|
|
264
267
|
name: z.string(),
|
|
265
268
|
productName: z.string(),
|
|
266
|
-
shortDescription: z.string(),
|
|
269
|
+
shortDescription: z.nullable(z.string()),
|
|
267
270
|
active: z.boolean(),
|
|
268
271
|
stockAvailable: z.boolean(),
|
|
269
272
|
onOffer: z.boolean().default(false),
|
|
@@ -271,24 +274,24 @@ export const VariantDetail$outboundSchema: z.ZodType<
|
|
|
271
274
|
onSubscription: z.boolean().default(false),
|
|
272
275
|
isDefault: z.boolean(),
|
|
273
276
|
associatedOptions: z.record(AssociatedOption$outboundSchema),
|
|
274
|
-
images: z.array(ProductImage$outboundSchema)
|
|
277
|
+
images: z.array(ProductImage$outboundSchema),
|
|
275
278
|
pricing: ProductPricing$outboundSchema,
|
|
276
|
-
subscription: z.array(ProductSubscription$outboundSchema)
|
|
277
|
-
promotion: z.array(ProductPromotion$outboundSchema)
|
|
279
|
+
subscription: z.array(ProductSubscription$outboundSchema),
|
|
280
|
+
promotion: z.array(ProductPromotion$outboundSchema),
|
|
278
281
|
productType: VariantDetailProductType$outboundSchema,
|
|
279
|
-
description: z.
|
|
280
|
-
categoryIds: z.array(z.string())
|
|
281
|
-
tags: z.nullable(z.array(z.string()))
|
|
282
|
-
reviewRatingSum: z.
|
|
283
|
-
reviewsCount: z.number().int()
|
|
284
|
-
hsnCode: z.
|
|
282
|
+
description: z.nullable(z.string()),
|
|
283
|
+
categoryIds: z.array(z.string()),
|
|
284
|
+
tags: z.nullable(z.array(z.string())),
|
|
285
|
+
reviewRatingSum: z.nullable(z.number()),
|
|
286
|
+
reviewsCount: z.number().int(),
|
|
287
|
+
hsnCode: z.nullable(z.string()),
|
|
285
288
|
variantOptions: z.array(VariantOption$outboundSchema),
|
|
286
|
-
productAttributes: z.array(ProductAttribute$outboundSchema)
|
|
287
|
-
variantAttributes: z.array(ProductAttribute$outboundSchema)
|
|
288
|
-
videos: z.array(ProductVideo$outboundSchema)
|
|
289
|
-
shipping: z.nullable(ProductShipping$outboundSchema)
|
|
290
|
-
seo: Seo$outboundSchema
|
|
291
|
-
metadata: z.record(z.string())
|
|
289
|
+
productAttributes: z.array(ProductAttribute$outboundSchema),
|
|
290
|
+
variantAttributes: z.array(ProductAttribute$outboundSchema),
|
|
291
|
+
videos: z.array(ProductVideo$outboundSchema),
|
|
292
|
+
shipping: z.nullable(ProductShipping$outboundSchema),
|
|
293
|
+
seo: Seo$outboundSchema,
|
|
294
|
+
metadata: z.record(z.string()),
|
|
292
295
|
}).transform((v) => {
|
|
293
296
|
return remap$(v, {
|
|
294
297
|
productId: "product_id",
|
|
@@ -3,25 +3,31 @@
|
|
|
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
7
|
import { ClosedEnum } from "../../types/enums.js";
|
|
9
8
|
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
10
9
|
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
11
10
|
|
|
12
|
-
export const
|
|
11
|
+
export const Type = {
|
|
13
12
|
SingleSelect: "single-select",
|
|
14
13
|
Color: "color",
|
|
15
14
|
} as const;
|
|
16
|
-
export type
|
|
15
|
+
export type Type = ClosedEnum<typeof Type>;
|
|
17
16
|
|
|
18
17
|
export type Two = {};
|
|
19
18
|
|
|
20
|
-
export type
|
|
19
|
+
export type Value = Two | string;
|
|
21
20
|
|
|
22
21
|
export type VariantOption = {
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
/**
|
|
23
|
+
* The name of the associated option.
|
|
24
|
+
*/
|
|
25
|
+
name: string;
|
|
26
|
+
/**
|
|
27
|
+
* A lookup safe version of the name that is lowercased and spaces are replaced with underscores. For instance, if name is `Product Type`, key will be `product_type`
|
|
28
|
+
*/
|
|
29
|
+
key: string;
|
|
30
|
+
type: Type;
|
|
25
31
|
/**
|
|
26
32
|
* When option_type is color, value will contain an array of objects like:
|
|
27
33
|
*
|
|
@@ -39,26 +45,27 @@ export type VariantOption = {
|
|
|
39
45
|
* ]
|
|
40
46
|
* ```
|
|
41
47
|
*/
|
|
42
|
-
|
|
48
|
+
value: Array<Two | string>;
|
|
43
49
|
};
|
|
44
50
|
|
|
45
51
|
/** @internal */
|
|
46
|
-
export const
|
|
47
|
-
|
|
52
|
+
export const Type$inboundSchema: z.ZodNativeEnum<typeof Type> = z.nativeEnum(
|
|
53
|
+
Type,
|
|
54
|
+
);
|
|
48
55
|
|
|
49
56
|
/** @internal */
|
|
50
|
-
export const
|
|
51
|
-
|
|
57
|
+
export const Type$outboundSchema: z.ZodNativeEnum<typeof Type> =
|
|
58
|
+
Type$inboundSchema;
|
|
52
59
|
|
|
53
60
|
/**
|
|
54
61
|
* @internal
|
|
55
62
|
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
56
63
|
*/
|
|
57
|
-
export namespace
|
|
58
|
-
/** @deprecated use `
|
|
59
|
-
export const inboundSchema =
|
|
60
|
-
/** @deprecated use `
|
|
61
|
-
export const outboundSchema =
|
|
64
|
+
export namespace Type$ {
|
|
65
|
+
/** @deprecated use `Type$inboundSchema` instead. */
|
|
66
|
+
export const inboundSchema = Type$inboundSchema;
|
|
67
|
+
/** @deprecated use `Type$outboundSchema` instead. */
|
|
68
|
+
export const outboundSchema = Type$outboundSchema;
|
|
62
69
|
}
|
|
63
70
|
|
|
64
71
|
/** @internal */
|
|
@@ -100,46 +107,43 @@ export function twoFromJSON(
|
|
|
100
107
|
}
|
|
101
108
|
|
|
102
109
|
/** @internal */
|
|
103
|
-
export const
|
|
104
|
-
|
|
105
|
-
z.ZodTypeDef,
|
|
106
|
-
unknown
|
|
107
|
-
> = z.union([z.lazy(() => Two$inboundSchema), z.string()]);
|
|
110
|
+
export const Value$inboundSchema: z.ZodType<Value, z.ZodTypeDef, unknown> = z
|
|
111
|
+
.union([z.lazy(() => Two$inboundSchema), z.string()]);
|
|
108
112
|
|
|
109
113
|
/** @internal */
|
|
110
|
-
export type
|
|
114
|
+
export type Value$Outbound = Two$Outbound | string;
|
|
111
115
|
|
|
112
116
|
/** @internal */
|
|
113
|
-
export const
|
|
114
|
-
|
|
117
|
+
export const Value$outboundSchema: z.ZodType<
|
|
118
|
+
Value$Outbound,
|
|
115
119
|
z.ZodTypeDef,
|
|
116
|
-
|
|
120
|
+
Value
|
|
117
121
|
> = z.union([z.lazy(() => Two$outboundSchema), z.string()]);
|
|
118
122
|
|
|
119
123
|
/**
|
|
120
124
|
* @internal
|
|
121
125
|
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
122
126
|
*/
|
|
123
|
-
export namespace
|
|
124
|
-
/** @deprecated use `
|
|
125
|
-
export const inboundSchema =
|
|
126
|
-
/** @deprecated use `
|
|
127
|
-
export const outboundSchema =
|
|
128
|
-
/** @deprecated use `
|
|
129
|
-
export type Outbound =
|
|
127
|
+
export namespace Value$ {
|
|
128
|
+
/** @deprecated use `Value$inboundSchema` instead. */
|
|
129
|
+
export const inboundSchema = Value$inboundSchema;
|
|
130
|
+
/** @deprecated use `Value$outboundSchema` instead. */
|
|
131
|
+
export const outboundSchema = Value$outboundSchema;
|
|
132
|
+
/** @deprecated use `Value$Outbound` instead. */
|
|
133
|
+
export type Outbound = Value$Outbound;
|
|
130
134
|
}
|
|
131
135
|
|
|
132
|
-
export function
|
|
133
|
-
return JSON.stringify(
|
|
136
|
+
export function valueToJSON(value: Value): string {
|
|
137
|
+
return JSON.stringify(Value$outboundSchema.parse(value));
|
|
134
138
|
}
|
|
135
139
|
|
|
136
|
-
export function
|
|
140
|
+
export function valueFromJSON(
|
|
137
141
|
jsonString: string,
|
|
138
|
-
): SafeParseResult<
|
|
142
|
+
): SafeParseResult<Value, SDKValidationError> {
|
|
139
143
|
return safeParse(
|
|
140
144
|
jsonString,
|
|
141
|
-
(x) =>
|
|
142
|
-
`Failed to parse '
|
|
145
|
+
(x) => Value$inboundSchema.parse(JSON.parse(x)),
|
|
146
|
+
`Failed to parse 'Value' from JSON`,
|
|
143
147
|
);
|
|
144
148
|
}
|
|
145
149
|
|
|
@@ -149,23 +153,18 @@ export const VariantOption$inboundSchema: z.ZodType<
|
|
|
149
153
|
z.ZodTypeDef,
|
|
150
154
|
unknown
|
|
151
155
|
> = z.object({
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
}).transform((v) => {
|
|
157
|
-
return remap$(v, {
|
|
158
|
-
"option_name": "optionName",
|
|
159
|
-
"option_type": "optionType",
|
|
160
|
-
"option_value": "optionValue",
|
|
161
|
-
});
|
|
156
|
+
name: z.string(),
|
|
157
|
+
key: z.string(),
|
|
158
|
+
type: Type$inboundSchema,
|
|
159
|
+
value: z.array(z.union([z.lazy(() => Two$inboundSchema), z.string()])),
|
|
162
160
|
});
|
|
163
161
|
|
|
164
162
|
/** @internal */
|
|
165
163
|
export type VariantOption$Outbound = {
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
164
|
+
name: string;
|
|
165
|
+
key: string;
|
|
166
|
+
type: string;
|
|
167
|
+
value: Array<Two$Outbound | string>;
|
|
169
168
|
};
|
|
170
169
|
|
|
171
170
|
/** @internal */
|
|
@@ -174,16 +173,10 @@ export const VariantOption$outboundSchema: z.ZodType<
|
|
|
174
173
|
z.ZodTypeDef,
|
|
175
174
|
VariantOption
|
|
176
175
|
> = z.object({
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
}).transform((v) => {
|
|
182
|
-
return remap$(v, {
|
|
183
|
-
optionName: "option_name",
|
|
184
|
-
optionType: "option_type",
|
|
185
|
-
optionValue: "option_value",
|
|
186
|
-
});
|
|
176
|
+
name: z.string(),
|
|
177
|
+
key: z.string(),
|
|
178
|
+
type: Type$outboundSchema,
|
|
179
|
+
value: z.array(z.union([z.lazy(() => Two$outboundSchema), z.string()])),
|
|
187
180
|
});
|
|
188
181
|
|
|
189
182
|
/**
|
|
@@ -32,9 +32,9 @@ export type GetCrossSellRequest = {
|
|
|
32
32
|
* Success response
|
|
33
33
|
*/
|
|
34
34
|
export type GetCrossSellResponseBody = {
|
|
35
|
-
message
|
|
36
|
-
success
|
|
37
|
-
content
|
|
35
|
+
message: string;
|
|
36
|
+
success: boolean;
|
|
37
|
+
content: components.ProductListResponse;
|
|
38
38
|
};
|
|
39
39
|
|
|
40
40
|
/** @internal */
|
|
@@ -116,16 +116,16 @@ export const GetCrossSellResponseBody$inboundSchema: z.ZodType<
|
|
|
116
116
|
z.ZodTypeDef,
|
|
117
117
|
unknown
|
|
118
118
|
> = z.object({
|
|
119
|
-
message: z.string()
|
|
120
|
-
success: z.boolean()
|
|
121
|
-
content: components.ProductListResponse$inboundSchema
|
|
119
|
+
message: z.string(),
|
|
120
|
+
success: z.boolean(),
|
|
121
|
+
content: components.ProductListResponse$inboundSchema,
|
|
122
122
|
});
|
|
123
123
|
|
|
124
124
|
/** @internal */
|
|
125
125
|
export type GetCrossSellResponseBody$Outbound = {
|
|
126
|
-
message
|
|
127
|
-
success
|
|
128
|
-
content
|
|
126
|
+
message: string;
|
|
127
|
+
success: boolean;
|
|
128
|
+
content: components.ProductListResponse$Outbound;
|
|
129
129
|
};
|
|
130
130
|
|
|
131
131
|
/** @internal */
|
|
@@ -134,9 +134,9 @@ export const GetCrossSellResponseBody$outboundSchema: z.ZodType<
|
|
|
134
134
|
z.ZodTypeDef,
|
|
135
135
|
GetCrossSellResponseBody
|
|
136
136
|
> = z.object({
|
|
137
|
-
message: z.string()
|
|
138
|
-
success: z.boolean()
|
|
139
|
-
content: components.ProductListResponse$outboundSchema
|
|
137
|
+
message: z.string(),
|
|
138
|
+
success: z.boolean(),
|
|
139
|
+
content: components.ProductListResponse$outboundSchema,
|
|
140
140
|
});
|
|
141
141
|
|
|
142
142
|
/**
|
|
@@ -36,9 +36,9 @@ export type GetProductsCategoriesContent = {
|
|
|
36
36
|
* OK
|
|
37
37
|
*/
|
|
38
38
|
export type GetProductsCategoriesResponseBody = {
|
|
39
|
-
message
|
|
39
|
+
message: string;
|
|
40
40
|
success?: boolean | undefined;
|
|
41
|
-
content
|
|
41
|
+
content: GetProductsCategoriesContent;
|
|
42
42
|
};
|
|
43
43
|
|
|
44
44
|
/** @internal */
|
|
@@ -180,16 +180,16 @@ export const GetProductsCategoriesResponseBody$inboundSchema: z.ZodType<
|
|
|
180
180
|
z.ZodTypeDef,
|
|
181
181
|
unknown
|
|
182
182
|
> = z.object({
|
|
183
|
-
message: z.string()
|
|
183
|
+
message: z.string(),
|
|
184
184
|
success: z.boolean().default(true),
|
|
185
|
-
content: z.lazy(() => GetProductsCategoriesContent$inboundSchema)
|
|
185
|
+
content: z.lazy(() => GetProductsCategoriesContent$inboundSchema),
|
|
186
186
|
});
|
|
187
187
|
|
|
188
188
|
/** @internal */
|
|
189
189
|
export type GetProductsCategoriesResponseBody$Outbound = {
|
|
190
|
-
message
|
|
190
|
+
message: string;
|
|
191
191
|
success: boolean;
|
|
192
|
-
content
|
|
192
|
+
content: GetProductsCategoriesContent$Outbound;
|
|
193
193
|
};
|
|
194
194
|
|
|
195
195
|
/** @internal */
|
|
@@ -198,9 +198,9 @@ export const GetProductsCategoriesResponseBody$outboundSchema: z.ZodType<
|
|
|
198
198
|
z.ZodTypeDef,
|
|
199
199
|
GetProductsCategoriesResponseBody
|
|
200
200
|
> = z.object({
|
|
201
|
-
message: z.string()
|
|
201
|
+
message: z.string(),
|
|
202
202
|
success: z.boolean().default(true),
|
|
203
|
-
content: z.lazy(() => GetProductsCategoriesContent$outboundSchema)
|
|
203
|
+
content: z.lazy(() => GetProductsCategoriesContent$outboundSchema),
|
|
204
204
|
});
|
|
205
205
|
|
|
206
206
|
/**
|
|
@@ -37,8 +37,8 @@ export type GetProductsIdReviewsRequest = {
|
|
|
37
37
|
};
|
|
38
38
|
|
|
39
39
|
export type GetProductsIdReviewsContent = {
|
|
40
|
-
reviews
|
|
41
|
-
reviewTags?: Array<string> | undefined;
|
|
40
|
+
reviews: Array<components.ProductReview>;
|
|
41
|
+
reviewTags?: Array<string> | null | undefined;
|
|
42
42
|
/**
|
|
43
43
|
* pagination metadata structure
|
|
44
44
|
*/
|
|
@@ -143,8 +143,8 @@ export const GetProductsIdReviewsContent$inboundSchema: z.ZodType<
|
|
|
143
143
|
z.ZodTypeDef,
|
|
144
144
|
unknown
|
|
145
145
|
> = z.object({
|
|
146
|
-
reviews: z.array(components.ProductReview$inboundSchema)
|
|
147
|
-
review_tags: z.array(z.string()).optional(),
|
|
146
|
+
reviews: z.array(components.ProductReview$inboundSchema),
|
|
147
|
+
review_tags: z.nullable(z.array(z.string())).optional(),
|
|
148
148
|
pagination: components.Pagination$inboundSchema.optional(),
|
|
149
149
|
}).transform((v) => {
|
|
150
150
|
return remap$(v, {
|
|
@@ -154,8 +154,8 @@ export const GetProductsIdReviewsContent$inboundSchema: z.ZodType<
|
|
|
154
154
|
|
|
155
155
|
/** @internal */
|
|
156
156
|
export type GetProductsIdReviewsContent$Outbound = {
|
|
157
|
-
reviews
|
|
158
|
-
review_tags?: Array<string> | undefined;
|
|
157
|
+
reviews: Array<components.ProductReview$Outbound>;
|
|
158
|
+
review_tags?: Array<string> | null | undefined;
|
|
159
159
|
pagination?: components.Pagination$Outbound | undefined;
|
|
160
160
|
};
|
|
161
161
|
|
|
@@ -165,8 +165,8 @@ export const GetProductsIdReviewsContent$outboundSchema: z.ZodType<
|
|
|
165
165
|
z.ZodTypeDef,
|
|
166
166
|
GetProductsIdReviewsContent
|
|
167
167
|
> = z.object({
|
|
168
|
-
reviews: z.array(components.ProductReview$outboundSchema)
|
|
169
|
-
reviewTags: z.array(z.string()).optional(),
|
|
168
|
+
reviews: z.array(components.ProductReview$outboundSchema),
|
|
169
|
+
reviewTags: z.nullable(z.array(z.string())).optional(),
|
|
170
170
|
pagination: components.Pagination$outboundSchema.optional(),
|
|
171
171
|
}).transform((v) => {
|
|
172
172
|
return remap$(v, {
|
|
@@ -32,9 +32,9 @@ export type GetSimilarRequest = {
|
|
|
32
32
|
* Success response
|
|
33
33
|
*/
|
|
34
34
|
export type GetSimilarResponseBody = {
|
|
35
|
-
message
|
|
36
|
-
success
|
|
37
|
-
content
|
|
35
|
+
message: string;
|
|
36
|
+
success: boolean;
|
|
37
|
+
content: components.ProductListResponse;
|
|
38
38
|
};
|
|
39
39
|
|
|
40
40
|
/** @internal */
|
|
@@ -116,16 +116,16 @@ export const GetSimilarResponseBody$inboundSchema: z.ZodType<
|
|
|
116
116
|
z.ZodTypeDef,
|
|
117
117
|
unknown
|
|
118
118
|
> = z.object({
|
|
119
|
-
message: z.string()
|
|
120
|
-
success: z.boolean()
|
|
121
|
-
content: components.ProductListResponse$inboundSchema
|
|
119
|
+
message: z.string(),
|
|
120
|
+
success: z.boolean(),
|
|
121
|
+
content: components.ProductListResponse$inboundSchema,
|
|
122
122
|
});
|
|
123
123
|
|
|
124
124
|
/** @internal */
|
|
125
125
|
export type GetSimilarResponseBody$Outbound = {
|
|
126
|
-
message
|
|
127
|
-
success
|
|
128
|
-
content
|
|
126
|
+
message: string;
|
|
127
|
+
success: boolean;
|
|
128
|
+
content: components.ProductListResponse$Outbound;
|
|
129
129
|
};
|
|
130
130
|
|
|
131
131
|
/** @internal */
|
|
@@ -134,9 +134,9 @@ export const GetSimilarResponseBody$outboundSchema: z.ZodType<
|
|
|
134
134
|
z.ZodTypeDef,
|
|
135
135
|
GetSimilarResponseBody
|
|
136
136
|
> = z.object({
|
|
137
|
-
message: z.string()
|
|
138
|
-
success: z.boolean()
|
|
139
|
-
content: components.ProductListResponse$outboundSchema
|
|
137
|
+
message: z.string(),
|
|
138
|
+
success: z.boolean(),
|
|
139
|
+
content: components.ProductListResponse$outboundSchema,
|
|
140
140
|
});
|
|
141
141
|
|
|
142
142
|
/**
|
|
@@ -37,11 +37,11 @@ export type GetSkusRequest = {
|
|
|
37
37
|
};
|
|
38
38
|
|
|
39
39
|
export type Content = {
|
|
40
|
-
skus
|
|
40
|
+
skus: Array<components.Sku>;
|
|
41
41
|
/**
|
|
42
42
|
* pagination metadata structure
|
|
43
43
|
*/
|
|
44
|
-
pagination
|
|
44
|
+
pagination: components.Pagination;
|
|
45
45
|
};
|
|
46
46
|
|
|
47
47
|
/**
|
|
@@ -133,14 +133,14 @@ export function getSkusRequestFromJSON(
|
|
|
133
133
|
/** @internal */
|
|
134
134
|
export const Content$inboundSchema: z.ZodType<Content, z.ZodTypeDef, unknown> =
|
|
135
135
|
z.object({
|
|
136
|
-
skus: z.array(components.Sku$inboundSchema)
|
|
137
|
-
pagination: components.Pagination$inboundSchema
|
|
136
|
+
skus: z.array(components.Sku$inboundSchema),
|
|
137
|
+
pagination: components.Pagination$inboundSchema,
|
|
138
138
|
});
|
|
139
139
|
|
|
140
140
|
/** @internal */
|
|
141
141
|
export type Content$Outbound = {
|
|
142
|
-
skus
|
|
143
|
-
pagination
|
|
142
|
+
skus: Array<components.Sku$Outbound>;
|
|
143
|
+
pagination: components.Pagination$Outbound;
|
|
144
144
|
};
|
|
145
145
|
|
|
146
146
|
/** @internal */
|
|
@@ -149,8 +149,8 @@ export const Content$outboundSchema: z.ZodType<
|
|
|
149
149
|
z.ZodTypeDef,
|
|
150
150
|
Content
|
|
151
151
|
> = z.object({
|
|
152
|
-
skus: z.array(components.Sku$outboundSchema)
|
|
153
|
-
pagination: components.Pagination$outboundSchema
|
|
152
|
+
skus: z.array(components.Sku$outboundSchema),
|
|
153
|
+
pagination: components.Pagination$outboundSchema,
|
|
154
154
|
});
|
|
155
155
|
|
|
156
156
|
/**
|