ce-storefront 0.3.6 → 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 +2 -2
- package/esm/lib/config.js +2 -2
- 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/index.d.ts +4 -1
- package/esm/models/components/index.d.ts.map +1 -1
- package/esm/models/components/index.js +4 -1
- package/esm/models/components/index.js.map +1 -1
- package/esm/models/components/productdetail.d.ts +16 -86
- package/esm/models/components/productdetail.d.ts.map +1 -1
- package/esm/models/components/productdetail.js +20 -88
- package/esm/models/components/productdetail.js.map +1 -1
- package/esm/models/components/productlistresponse.d.ts +30 -5
- package/esm/models/components/productlistresponse.d.ts.map +1 -1
- package/esm/models/components/productlistresponse.js +46 -5
- package/esm/models/components/productlistresponse.js.map +1 -1
- package/esm/models/components/productshipping.d.ts +13 -13
- package/esm/models/components/productshipping.d.ts.map +1 -1
- package/esm/models/components/productshipping.js +14 -14
- package/esm/models/components/productshipping.js.map +1 -1
- package/esm/models/components/{product.d.ts → singleproduct.d.ts} +29 -14
- package/esm/models/components/singleproduct.d.ts.map +1 -0
- package/esm/models/components/{product.js → singleproduct.js} +15 -16
- 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/sku.d.ts +7 -4
- package/esm/models/components/sku.d.ts.map +1 -1
- package/esm/models/components/sku.js +6 -4
- package/esm/models/components/sku.js.map +1 -1
- package/esm/models/components/variant.d.ts +39 -30
- package/esm/models/components/variant.d.ts.map +1 -1
- package/esm/models/components/variant.js +38 -31
- package/esm/models/components/variant.js.map +1 -1
- package/esm/models/components/variantdetail.d.ts +89 -27
- package/esm/models/components/variantdetail.d.ts.map +1 -1
- package/esm/models/components/variantdetail.js +93 -28
- package/esm/models/components/variantdetail.js.map +1 -1
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/lib/config.ts +2 -2
- package/src/models/components/bundleproduct.ts +501 -0
- package/src/models/components/bundleproductdetail.ts +567 -0
- package/src/models/components/index.ts +4 -1
- package/src/models/components/productdetail.ts +50 -198
- package/src/models/components/productlistresponse.ts +105 -13
- package/src/models/components/productshipping.ts +27 -27
- package/src/models/components/{product.ts → singleproduct.ts} +75 -58
- package/src/models/components/singleproductdetail.ts +339 -0
- package/src/models/components/sku.ts +16 -8
- package/src/models/components/variant.ts +75 -59
- package/src/models/components/variantdetail.ts +168 -55
- package/esm/models/components/product.d.ts.map +0 -1
- package/esm/models/components/product.js.map +0 -1
|
@@ -58,7 +58,7 @@ export const ProductType = {
|
|
|
58
58
|
} as const;
|
|
59
59
|
export type ProductType = ClosedEnum<typeof ProductType>;
|
|
60
60
|
|
|
61
|
-
export type
|
|
61
|
+
export type SingleProduct = {
|
|
62
62
|
/**
|
|
63
63
|
* The ULID of the product
|
|
64
64
|
*/
|
|
@@ -69,10 +69,25 @@ export type Product = {
|
|
|
69
69
|
shortDescription?: string | undefined;
|
|
70
70
|
productType: ProductType;
|
|
71
71
|
active?: boolean | undefined;
|
|
72
|
+
/**
|
|
73
|
+
* Indicates whether the product has stock available
|
|
74
|
+
*/
|
|
72
75
|
stockAvailable?: boolean | undefined;
|
|
76
|
+
/**
|
|
77
|
+
* Indicates whether this item is associated with any active (product-specific) coupons
|
|
78
|
+
*/
|
|
73
79
|
onOffer?: boolean | undefined;
|
|
80
|
+
/**
|
|
81
|
+
* Indicates whether the product has any subscription plans avaialble
|
|
82
|
+
*/
|
|
74
83
|
onSubscription?: boolean | undefined;
|
|
84
|
+
/**
|
|
85
|
+
* Indicates whether the product is currently on promotion. When true, the `ProductPromotion` object will contain details of the promotion
|
|
86
|
+
*/
|
|
75
87
|
onPromotion?: boolean | undefined;
|
|
88
|
+
/**
|
|
89
|
+
* Indicates whether the product has variants
|
|
90
|
+
*/
|
|
76
91
|
hasVariant?: boolean | undefined;
|
|
77
92
|
tags?: Array<string> | null | undefined;
|
|
78
93
|
categoryIds?: Array<string> | undefined;
|
|
@@ -110,50 +125,52 @@ export namespace ProductType$ {
|
|
|
110
125
|
}
|
|
111
126
|
|
|
112
127
|
/** @internal */
|
|
113
|
-
export const
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
128
|
+
export const SingleProduct$inboundSchema: z.ZodType<
|
|
129
|
+
SingleProduct,
|
|
130
|
+
z.ZodTypeDef,
|
|
131
|
+
unknown
|
|
132
|
+
> = z.object({
|
|
133
|
+
id: z.string(),
|
|
134
|
+
sku: z.string().optional(),
|
|
135
|
+
name: z.string(),
|
|
136
|
+
slug: z.string(),
|
|
137
|
+
short_description: z.string().optional(),
|
|
138
|
+
product_type: ProductType$inboundSchema,
|
|
139
|
+
active: z.boolean().default(true),
|
|
140
|
+
stock_available: z.boolean().default(true),
|
|
141
|
+
on_offer: z.boolean().default(false),
|
|
142
|
+
on_subscription: z.boolean().default(false),
|
|
143
|
+
on_promotion: z.boolean().default(false),
|
|
144
|
+
has_variant: z.boolean().default(false),
|
|
145
|
+
tags: z.nullable(z.array(z.string())).optional(),
|
|
146
|
+
category_ids: z.array(z.string()).optional(),
|
|
147
|
+
reviews_rating_sum: z.number().optional(),
|
|
148
|
+
reviews_count: z.number().int().optional(),
|
|
149
|
+
attributes: z.array(ProductAttribute$inboundSchema).optional(),
|
|
150
|
+
pricing: ProductPricing$inboundSchema.optional(),
|
|
151
|
+
variant_options: z.nullable(z.array(VariantOption$inboundSchema)).optional(),
|
|
152
|
+
promotion: z.nullable(ProductPromotion$inboundSchema).optional(),
|
|
153
|
+
images: z.array(ProductImage$inboundSchema).optional(),
|
|
154
|
+
subscription: z.array(ProductSubscription$inboundSchema).optional(),
|
|
155
|
+
variants: z.array(Variant$inboundSchema).optional(),
|
|
156
|
+
}).transform((v) => {
|
|
157
|
+
return remap$(v, {
|
|
158
|
+
"short_description": "shortDescription",
|
|
159
|
+
"product_type": "productType",
|
|
160
|
+
"stock_available": "stockAvailable",
|
|
161
|
+
"on_offer": "onOffer",
|
|
162
|
+
"on_subscription": "onSubscription",
|
|
163
|
+
"on_promotion": "onPromotion",
|
|
164
|
+
"has_variant": "hasVariant",
|
|
165
|
+
"category_ids": "categoryIds",
|
|
166
|
+
"reviews_rating_sum": "reviewsRatingSum",
|
|
167
|
+
"reviews_count": "reviewsCount",
|
|
168
|
+
"variant_options": "variantOptions",
|
|
153
169
|
});
|
|
170
|
+
});
|
|
154
171
|
|
|
155
172
|
/** @internal */
|
|
156
|
-
export type
|
|
173
|
+
export type SingleProduct$Outbound = {
|
|
157
174
|
id: string;
|
|
158
175
|
sku?: string | undefined;
|
|
159
176
|
name: string;
|
|
@@ -180,10 +197,10 @@ export type Product$Outbound = {
|
|
|
180
197
|
};
|
|
181
198
|
|
|
182
199
|
/** @internal */
|
|
183
|
-
export const
|
|
184
|
-
|
|
200
|
+
export const SingleProduct$outboundSchema: z.ZodType<
|
|
201
|
+
SingleProduct$Outbound,
|
|
185
202
|
z.ZodTypeDef,
|
|
186
|
-
|
|
203
|
+
SingleProduct
|
|
187
204
|
> = z.object({
|
|
188
205
|
id: z.string(),
|
|
189
206
|
sku: z.string().optional(),
|
|
@@ -228,25 +245,25 @@ export const Product$outboundSchema: z.ZodType<
|
|
|
228
245
|
* @internal
|
|
229
246
|
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
230
247
|
*/
|
|
231
|
-
export namespace
|
|
232
|
-
/** @deprecated use `
|
|
233
|
-
export const inboundSchema =
|
|
234
|
-
/** @deprecated use `
|
|
235
|
-
export const outboundSchema =
|
|
236
|
-
/** @deprecated use `
|
|
237
|
-
export type Outbound =
|
|
248
|
+
export namespace SingleProduct$ {
|
|
249
|
+
/** @deprecated use `SingleProduct$inboundSchema` instead. */
|
|
250
|
+
export const inboundSchema = SingleProduct$inboundSchema;
|
|
251
|
+
/** @deprecated use `SingleProduct$outboundSchema` instead. */
|
|
252
|
+
export const outboundSchema = SingleProduct$outboundSchema;
|
|
253
|
+
/** @deprecated use `SingleProduct$Outbound` instead. */
|
|
254
|
+
export type Outbound = SingleProduct$Outbound;
|
|
238
255
|
}
|
|
239
256
|
|
|
240
|
-
export function
|
|
241
|
-
return JSON.stringify(
|
|
257
|
+
export function singleProductToJSON(singleProduct: SingleProduct): string {
|
|
258
|
+
return JSON.stringify(SingleProduct$outboundSchema.parse(singleProduct));
|
|
242
259
|
}
|
|
243
260
|
|
|
244
|
-
export function
|
|
261
|
+
export function singleProductFromJSON(
|
|
245
262
|
jsonString: string,
|
|
246
|
-
): SafeParseResult<
|
|
263
|
+
): SafeParseResult<SingleProduct, SDKValidationError> {
|
|
247
264
|
return safeParse(
|
|
248
265
|
jsonString,
|
|
249
|
-
(x) =>
|
|
250
|
-
`Failed to parse '
|
|
266
|
+
(x) => SingleProduct$inboundSchema.parse(JSON.parse(x)),
|
|
267
|
+
`Failed to parse 'SingleProduct' from JSON`,
|
|
251
268
|
);
|
|
252
269
|
}
|
|
@@ -0,0 +1,339 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
8
|
+
import { ClosedEnum } from "../../types/enums.js";
|
|
9
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
10
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
11
|
+
import {
|
|
12
|
+
ProductAttribute,
|
|
13
|
+
ProductAttribute$inboundSchema,
|
|
14
|
+
ProductAttribute$Outbound,
|
|
15
|
+
ProductAttribute$outboundSchema,
|
|
16
|
+
} from "./productattribute.js";
|
|
17
|
+
import {
|
|
18
|
+
ProductImage,
|
|
19
|
+
ProductImage$inboundSchema,
|
|
20
|
+
ProductImage$Outbound,
|
|
21
|
+
ProductImage$outboundSchema,
|
|
22
|
+
} from "./productimage.js";
|
|
23
|
+
import {
|
|
24
|
+
ProductPricing,
|
|
25
|
+
ProductPricing$inboundSchema,
|
|
26
|
+
ProductPricing$Outbound,
|
|
27
|
+
ProductPricing$outboundSchema,
|
|
28
|
+
} from "./productpricing.js";
|
|
29
|
+
import {
|
|
30
|
+
ProductPromotion,
|
|
31
|
+
ProductPromotion$inboundSchema,
|
|
32
|
+
ProductPromotion$Outbound,
|
|
33
|
+
ProductPromotion$outboundSchema,
|
|
34
|
+
} from "./productpromotion.js";
|
|
35
|
+
import {
|
|
36
|
+
ProductShipping,
|
|
37
|
+
ProductShipping$inboundSchema,
|
|
38
|
+
ProductShipping$Outbound,
|
|
39
|
+
ProductShipping$outboundSchema,
|
|
40
|
+
} from "./productshipping.js";
|
|
41
|
+
import {
|
|
42
|
+
ProductSubscription,
|
|
43
|
+
ProductSubscription$inboundSchema,
|
|
44
|
+
ProductSubscription$Outbound,
|
|
45
|
+
ProductSubscription$outboundSchema,
|
|
46
|
+
} from "./productsubscription.js";
|
|
47
|
+
import {
|
|
48
|
+
ProductVideo,
|
|
49
|
+
ProductVideo$inboundSchema,
|
|
50
|
+
ProductVideo$Outbound,
|
|
51
|
+
ProductVideo$outboundSchema,
|
|
52
|
+
} from "./productvideo.js";
|
|
53
|
+
import {
|
|
54
|
+
Seo,
|
|
55
|
+
Seo$inboundSchema,
|
|
56
|
+
Seo$Outbound,
|
|
57
|
+
Seo$outboundSchema,
|
|
58
|
+
} from "./seo.js";
|
|
59
|
+
import {
|
|
60
|
+
Variant,
|
|
61
|
+
Variant$inboundSchema,
|
|
62
|
+
Variant$Outbound,
|
|
63
|
+
Variant$outboundSchema,
|
|
64
|
+
} from "./variant.js";
|
|
65
|
+
import {
|
|
66
|
+
VariantOption,
|
|
67
|
+
VariantOption$inboundSchema,
|
|
68
|
+
VariantOption$Outbound,
|
|
69
|
+
VariantOption$outboundSchema,
|
|
70
|
+
} from "./variantoption.js";
|
|
71
|
+
|
|
72
|
+
export const SingleProductDetailProductType = {
|
|
73
|
+
Physical: "physical",
|
|
74
|
+
Digital: "digital",
|
|
75
|
+
Bundle: "bundle",
|
|
76
|
+
} as const;
|
|
77
|
+
export type SingleProductDetailProductType = ClosedEnum<
|
|
78
|
+
typeof SingleProductDetailProductType
|
|
79
|
+
>;
|
|
80
|
+
|
|
81
|
+
export type SingleProductDetail = {
|
|
82
|
+
/**
|
|
83
|
+
* The ULID of the product
|
|
84
|
+
*/
|
|
85
|
+
id: string;
|
|
86
|
+
sku?: string | undefined;
|
|
87
|
+
name: string;
|
|
88
|
+
slug: string;
|
|
89
|
+
shortDescription?: string | undefined;
|
|
90
|
+
productType: SingleProductDetailProductType;
|
|
91
|
+
active?: boolean | undefined;
|
|
92
|
+
/**
|
|
93
|
+
* Indicates whether the product has stock available
|
|
94
|
+
*/
|
|
95
|
+
stockAvailable?: boolean | undefined;
|
|
96
|
+
/**
|
|
97
|
+
* Indicates whether this item is associated with any active (product-specific) coupons
|
|
98
|
+
*/
|
|
99
|
+
onOffer?: boolean | undefined;
|
|
100
|
+
/**
|
|
101
|
+
* Indicates whether the product has any subscription plans avaialble
|
|
102
|
+
*/
|
|
103
|
+
onSubscription?: boolean | undefined;
|
|
104
|
+
/**
|
|
105
|
+
* Indicates whether the product is currently on promotion. When true, the `ProductPromotion` object will contain details of the promotion
|
|
106
|
+
*/
|
|
107
|
+
onPromotion?: boolean | undefined;
|
|
108
|
+
/**
|
|
109
|
+
* Indicates whether the product has variants
|
|
110
|
+
*/
|
|
111
|
+
hasVariant?: boolean | undefined;
|
|
112
|
+
tags?: Array<string> | null | undefined;
|
|
113
|
+
categoryIds?: Array<string> | undefined;
|
|
114
|
+
reviewsRatingSum?: number | undefined;
|
|
115
|
+
reviewsCount?: number | undefined;
|
|
116
|
+
attributes?: Array<ProductAttribute> | undefined;
|
|
117
|
+
pricing?: ProductPricing | undefined;
|
|
118
|
+
/**
|
|
119
|
+
* this will be used if has_variant is true, to auto set default values.
|
|
120
|
+
*/
|
|
121
|
+
variantOptions?: Array<VariantOption> | null | undefined;
|
|
122
|
+
promotion?: ProductPromotion | null | undefined;
|
|
123
|
+
images?: Array<ProductImage> | undefined;
|
|
124
|
+
subscription?: Array<ProductSubscription> | undefined;
|
|
125
|
+
variants?: Array<Variant> | undefined;
|
|
126
|
+
description?: string | undefined;
|
|
127
|
+
hsnCode?: string | undefined;
|
|
128
|
+
videos?: Array<ProductVideo> | undefined;
|
|
129
|
+
shipping?: ProductShipping | null | undefined;
|
|
130
|
+
/**
|
|
131
|
+
* An array of product ULIDs
|
|
132
|
+
*/
|
|
133
|
+
upsellingProductIds?: Array<string> | undefined;
|
|
134
|
+
/**
|
|
135
|
+
* An array of product ULIDs
|
|
136
|
+
*/
|
|
137
|
+
crosssellingProductIds?: Array<string> | undefined;
|
|
138
|
+
seo?: Seo | undefined;
|
|
139
|
+
metadata?: { [k: string]: string } | undefined;
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
/** @internal */
|
|
143
|
+
export const SingleProductDetailProductType$inboundSchema: z.ZodNativeEnum<
|
|
144
|
+
typeof SingleProductDetailProductType
|
|
145
|
+
> = z.nativeEnum(SingleProductDetailProductType);
|
|
146
|
+
|
|
147
|
+
/** @internal */
|
|
148
|
+
export const SingleProductDetailProductType$outboundSchema: z.ZodNativeEnum<
|
|
149
|
+
typeof SingleProductDetailProductType
|
|
150
|
+
> = SingleProductDetailProductType$inboundSchema;
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* @internal
|
|
154
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
155
|
+
*/
|
|
156
|
+
export namespace SingleProductDetailProductType$ {
|
|
157
|
+
/** @deprecated use `SingleProductDetailProductType$inboundSchema` instead. */
|
|
158
|
+
export const inboundSchema = SingleProductDetailProductType$inboundSchema;
|
|
159
|
+
/** @deprecated use `SingleProductDetailProductType$outboundSchema` instead. */
|
|
160
|
+
export const outboundSchema = SingleProductDetailProductType$outboundSchema;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
/** @internal */
|
|
164
|
+
export const SingleProductDetail$inboundSchema: z.ZodType<
|
|
165
|
+
SingleProductDetail,
|
|
166
|
+
z.ZodTypeDef,
|
|
167
|
+
unknown
|
|
168
|
+
> = z.object({
|
|
169
|
+
id: z.string(),
|
|
170
|
+
sku: z.string().optional(),
|
|
171
|
+
name: z.string(),
|
|
172
|
+
slug: z.string(),
|
|
173
|
+
short_description: z.string().optional(),
|
|
174
|
+
product_type: SingleProductDetailProductType$inboundSchema,
|
|
175
|
+
active: z.boolean().default(true),
|
|
176
|
+
stock_available: z.boolean().default(true),
|
|
177
|
+
on_offer: z.boolean().default(false),
|
|
178
|
+
on_subscription: z.boolean().default(false),
|
|
179
|
+
on_promotion: z.boolean().default(false),
|
|
180
|
+
has_variant: z.boolean().default(false),
|
|
181
|
+
tags: z.nullable(z.array(z.string())).optional(),
|
|
182
|
+
category_ids: z.array(z.string()).optional(),
|
|
183
|
+
reviews_rating_sum: z.number().optional(),
|
|
184
|
+
reviews_count: z.number().int().optional(),
|
|
185
|
+
attributes: z.array(ProductAttribute$inboundSchema).optional(),
|
|
186
|
+
pricing: ProductPricing$inboundSchema.optional(),
|
|
187
|
+
variant_options: z.nullable(z.array(VariantOption$inboundSchema)).optional(),
|
|
188
|
+
promotion: z.nullable(ProductPromotion$inboundSchema).optional(),
|
|
189
|
+
images: z.array(ProductImage$inboundSchema).optional(),
|
|
190
|
+
subscription: z.array(ProductSubscription$inboundSchema).optional(),
|
|
191
|
+
variants: z.array(Variant$inboundSchema).optional(),
|
|
192
|
+
description: z.string().optional(),
|
|
193
|
+
hsn_code: z.string().optional(),
|
|
194
|
+
videos: z.array(ProductVideo$inboundSchema).optional(),
|
|
195
|
+
shipping: z.nullable(ProductShipping$inboundSchema).optional(),
|
|
196
|
+
upselling_product_ids: z.array(z.string()).optional(),
|
|
197
|
+
crossselling_product_ids: z.array(z.string()).optional(),
|
|
198
|
+
seo: Seo$inboundSchema.optional(),
|
|
199
|
+
metadata: z.record(z.string()).optional(),
|
|
200
|
+
}).transform((v) => {
|
|
201
|
+
return remap$(v, {
|
|
202
|
+
"short_description": "shortDescription",
|
|
203
|
+
"product_type": "productType",
|
|
204
|
+
"stock_available": "stockAvailable",
|
|
205
|
+
"on_offer": "onOffer",
|
|
206
|
+
"on_subscription": "onSubscription",
|
|
207
|
+
"on_promotion": "onPromotion",
|
|
208
|
+
"has_variant": "hasVariant",
|
|
209
|
+
"category_ids": "categoryIds",
|
|
210
|
+
"reviews_rating_sum": "reviewsRatingSum",
|
|
211
|
+
"reviews_count": "reviewsCount",
|
|
212
|
+
"variant_options": "variantOptions",
|
|
213
|
+
"hsn_code": "hsnCode",
|
|
214
|
+
"upselling_product_ids": "upsellingProductIds",
|
|
215
|
+
"crossselling_product_ids": "crosssellingProductIds",
|
|
216
|
+
});
|
|
217
|
+
});
|
|
218
|
+
|
|
219
|
+
/** @internal */
|
|
220
|
+
export type SingleProductDetail$Outbound = {
|
|
221
|
+
id: string;
|
|
222
|
+
sku?: string | undefined;
|
|
223
|
+
name: string;
|
|
224
|
+
slug: string;
|
|
225
|
+
short_description?: string | undefined;
|
|
226
|
+
product_type: string;
|
|
227
|
+
active: boolean;
|
|
228
|
+
stock_available: boolean;
|
|
229
|
+
on_offer: boolean;
|
|
230
|
+
on_subscription: boolean;
|
|
231
|
+
on_promotion: boolean;
|
|
232
|
+
has_variant: boolean;
|
|
233
|
+
tags?: Array<string> | null | undefined;
|
|
234
|
+
category_ids?: Array<string> | undefined;
|
|
235
|
+
reviews_rating_sum?: number | undefined;
|
|
236
|
+
reviews_count?: number | undefined;
|
|
237
|
+
attributes?: Array<ProductAttribute$Outbound> | undefined;
|
|
238
|
+
pricing?: ProductPricing$Outbound | undefined;
|
|
239
|
+
variant_options?: Array<VariantOption$Outbound> | null | undefined;
|
|
240
|
+
promotion?: ProductPromotion$Outbound | null | undefined;
|
|
241
|
+
images?: Array<ProductImage$Outbound> | undefined;
|
|
242
|
+
subscription?: Array<ProductSubscription$Outbound> | undefined;
|
|
243
|
+
variants?: Array<Variant$Outbound> | undefined;
|
|
244
|
+
description?: string | undefined;
|
|
245
|
+
hsn_code?: string | undefined;
|
|
246
|
+
videos?: Array<ProductVideo$Outbound> | undefined;
|
|
247
|
+
shipping?: ProductShipping$Outbound | null | undefined;
|
|
248
|
+
upselling_product_ids?: Array<string> | undefined;
|
|
249
|
+
crossselling_product_ids?: Array<string> | undefined;
|
|
250
|
+
seo?: Seo$Outbound | undefined;
|
|
251
|
+
metadata?: { [k: string]: string } | undefined;
|
|
252
|
+
};
|
|
253
|
+
|
|
254
|
+
/** @internal */
|
|
255
|
+
export const SingleProductDetail$outboundSchema: z.ZodType<
|
|
256
|
+
SingleProductDetail$Outbound,
|
|
257
|
+
z.ZodTypeDef,
|
|
258
|
+
SingleProductDetail
|
|
259
|
+
> = z.object({
|
|
260
|
+
id: z.string(),
|
|
261
|
+
sku: z.string().optional(),
|
|
262
|
+
name: z.string(),
|
|
263
|
+
slug: z.string(),
|
|
264
|
+
shortDescription: z.string().optional(),
|
|
265
|
+
productType: SingleProductDetailProductType$outboundSchema,
|
|
266
|
+
active: z.boolean().default(true),
|
|
267
|
+
stockAvailable: z.boolean().default(true),
|
|
268
|
+
onOffer: z.boolean().default(false),
|
|
269
|
+
onSubscription: z.boolean().default(false),
|
|
270
|
+
onPromotion: z.boolean().default(false),
|
|
271
|
+
hasVariant: z.boolean().default(false),
|
|
272
|
+
tags: z.nullable(z.array(z.string())).optional(),
|
|
273
|
+
categoryIds: z.array(z.string()).optional(),
|
|
274
|
+
reviewsRatingSum: z.number().optional(),
|
|
275
|
+
reviewsCount: z.number().int().optional(),
|
|
276
|
+
attributes: z.array(ProductAttribute$outboundSchema).optional(),
|
|
277
|
+
pricing: ProductPricing$outboundSchema.optional(),
|
|
278
|
+
variantOptions: z.nullable(z.array(VariantOption$outboundSchema)).optional(),
|
|
279
|
+
promotion: z.nullable(ProductPromotion$outboundSchema).optional(),
|
|
280
|
+
images: z.array(ProductImage$outboundSchema).optional(),
|
|
281
|
+
subscription: z.array(ProductSubscription$outboundSchema).optional(),
|
|
282
|
+
variants: z.array(Variant$outboundSchema).optional(),
|
|
283
|
+
description: z.string().optional(),
|
|
284
|
+
hsnCode: z.string().optional(),
|
|
285
|
+
videos: z.array(ProductVideo$outboundSchema).optional(),
|
|
286
|
+
shipping: z.nullable(ProductShipping$outboundSchema).optional(),
|
|
287
|
+
upsellingProductIds: z.array(z.string()).optional(),
|
|
288
|
+
crosssellingProductIds: z.array(z.string()).optional(),
|
|
289
|
+
seo: Seo$outboundSchema.optional(),
|
|
290
|
+
metadata: z.record(z.string()).optional(),
|
|
291
|
+
}).transform((v) => {
|
|
292
|
+
return remap$(v, {
|
|
293
|
+
shortDescription: "short_description",
|
|
294
|
+
productType: "product_type",
|
|
295
|
+
stockAvailable: "stock_available",
|
|
296
|
+
onOffer: "on_offer",
|
|
297
|
+
onSubscription: "on_subscription",
|
|
298
|
+
onPromotion: "on_promotion",
|
|
299
|
+
hasVariant: "has_variant",
|
|
300
|
+
categoryIds: "category_ids",
|
|
301
|
+
reviewsRatingSum: "reviews_rating_sum",
|
|
302
|
+
reviewsCount: "reviews_count",
|
|
303
|
+
variantOptions: "variant_options",
|
|
304
|
+
hsnCode: "hsn_code",
|
|
305
|
+
upsellingProductIds: "upselling_product_ids",
|
|
306
|
+
crosssellingProductIds: "crossselling_product_ids",
|
|
307
|
+
});
|
|
308
|
+
});
|
|
309
|
+
|
|
310
|
+
/**
|
|
311
|
+
* @internal
|
|
312
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
313
|
+
*/
|
|
314
|
+
export namespace SingleProductDetail$ {
|
|
315
|
+
/** @deprecated use `SingleProductDetail$inboundSchema` instead. */
|
|
316
|
+
export const inboundSchema = SingleProductDetail$inboundSchema;
|
|
317
|
+
/** @deprecated use `SingleProductDetail$outboundSchema` instead. */
|
|
318
|
+
export const outboundSchema = SingleProductDetail$outboundSchema;
|
|
319
|
+
/** @deprecated use `SingleProductDetail$Outbound` instead. */
|
|
320
|
+
export type Outbound = SingleProductDetail$Outbound;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
export function singleProductDetailToJSON(
|
|
324
|
+
singleProductDetail: SingleProductDetail,
|
|
325
|
+
): string {
|
|
326
|
+
return JSON.stringify(
|
|
327
|
+
SingleProductDetail$outboundSchema.parse(singleProductDetail),
|
|
328
|
+
);
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
export function singleProductDetailFromJSON(
|
|
332
|
+
jsonString: string,
|
|
333
|
+
): SafeParseResult<SingleProductDetail, SDKValidationError> {
|
|
334
|
+
return safeParse(
|
|
335
|
+
jsonString,
|
|
336
|
+
(x) => SingleProductDetail$inboundSchema.parse(JSON.parse(x)),
|
|
337
|
+
`Failed to parse 'SingleProductDetail' from JSON`,
|
|
338
|
+
);
|
|
339
|
+
}
|
|
@@ -56,13 +56,16 @@ export type Sku = {
|
|
|
56
56
|
productId: string;
|
|
57
57
|
variantId?: string | null | undefined;
|
|
58
58
|
sku: string;
|
|
59
|
+
slug?: string | undefined;
|
|
59
60
|
productName: string;
|
|
60
61
|
variantName?: string | null | undefined;
|
|
61
62
|
productType: SKUProductType;
|
|
62
|
-
slug?: string | undefined;
|
|
63
63
|
shortDescription?: string | undefined;
|
|
64
64
|
active?: boolean | undefined;
|
|
65
65
|
stockAvailable?: boolean | undefined;
|
|
66
|
+
/**
|
|
67
|
+
* Indicates whether this item is associated with any active (product-specific) coupons
|
|
68
|
+
*/
|
|
66
69
|
onOffer?: boolean | undefined;
|
|
67
70
|
onSubscription?: boolean | undefined;
|
|
68
71
|
onPromotion?: boolean | undefined;
|
|
@@ -75,7 +78,7 @@ export type Sku = {
|
|
|
75
78
|
pricing?: ProductPricing | undefined;
|
|
76
79
|
promotion?: ProductPromotion | null | undefined;
|
|
77
80
|
subscription?: Array<ProductSubscription> | undefined;
|
|
78
|
-
associatedOptions?: { [k: string]: AssociatedOption } | undefined;
|
|
81
|
+
associatedOptions?: { [k: string]: AssociatedOption } | null | undefined;
|
|
79
82
|
};
|
|
80
83
|
|
|
81
84
|
/** @internal */
|
|
@@ -105,10 +108,10 @@ export const Sku$inboundSchema: z.ZodType<Sku, z.ZodTypeDef, unknown> = z
|
|
|
105
108
|
product_id: z.string(),
|
|
106
109
|
variant_id: z.nullable(z.string()).optional(),
|
|
107
110
|
sku: z.string(),
|
|
111
|
+
slug: z.string().optional(),
|
|
108
112
|
product_name: z.string(),
|
|
109
113
|
variant_name: z.nullable(z.string()).optional(),
|
|
110
114
|
product_type: SKUProductType$inboundSchema,
|
|
111
|
-
slug: z.string().optional(),
|
|
112
115
|
short_description: z.string().optional(),
|
|
113
116
|
active: z.boolean().default(true),
|
|
114
117
|
stock_available: z.boolean().default(true),
|
|
@@ -124,7 +127,8 @@ export const Sku$inboundSchema: z.ZodType<Sku, z.ZodTypeDef, unknown> = z
|
|
|
124
127
|
pricing: ProductPricing$inboundSchema.optional(),
|
|
125
128
|
promotion: z.nullable(ProductPromotion$inboundSchema).optional(),
|
|
126
129
|
subscription: z.array(ProductSubscription$inboundSchema).optional(),
|
|
127
|
-
associated_options: z.record(AssociatedOption$inboundSchema)
|
|
130
|
+
associated_options: z.nullable(z.record(AssociatedOption$inboundSchema))
|
|
131
|
+
.optional(),
|
|
128
132
|
}).transform((v) => {
|
|
129
133
|
return remap$(v, {
|
|
130
134
|
"product_id": "productId",
|
|
@@ -149,10 +153,10 @@ export type Sku$Outbound = {
|
|
|
149
153
|
product_id: string;
|
|
150
154
|
variant_id?: string | null | undefined;
|
|
151
155
|
sku: string;
|
|
156
|
+
slug?: string | undefined;
|
|
152
157
|
product_name: string;
|
|
153
158
|
variant_name?: string | null | undefined;
|
|
154
159
|
product_type: string;
|
|
155
|
-
slug?: string | undefined;
|
|
156
160
|
short_description?: string | undefined;
|
|
157
161
|
active: boolean;
|
|
158
162
|
stock_available: boolean;
|
|
@@ -168,7 +172,10 @@ export type Sku$Outbound = {
|
|
|
168
172
|
pricing?: ProductPricing$Outbound | undefined;
|
|
169
173
|
promotion?: ProductPromotion$Outbound | null | undefined;
|
|
170
174
|
subscription?: Array<ProductSubscription$Outbound> | undefined;
|
|
171
|
-
associated_options?:
|
|
175
|
+
associated_options?:
|
|
176
|
+
| { [k: string]: AssociatedOption$Outbound }
|
|
177
|
+
| null
|
|
178
|
+
| undefined;
|
|
172
179
|
};
|
|
173
180
|
|
|
174
181
|
/** @internal */
|
|
@@ -177,10 +184,10 @@ export const Sku$outboundSchema: z.ZodType<Sku$Outbound, z.ZodTypeDef, Sku> = z
|
|
|
177
184
|
productId: z.string(),
|
|
178
185
|
variantId: z.nullable(z.string()).optional(),
|
|
179
186
|
sku: z.string(),
|
|
187
|
+
slug: z.string().optional(),
|
|
180
188
|
productName: z.string(),
|
|
181
189
|
variantName: z.nullable(z.string()).optional(),
|
|
182
190
|
productType: SKUProductType$outboundSchema,
|
|
183
|
-
slug: z.string().optional(),
|
|
184
191
|
shortDescription: z.string().optional(),
|
|
185
192
|
active: z.boolean().default(true),
|
|
186
193
|
stockAvailable: z.boolean().default(true),
|
|
@@ -196,7 +203,8 @@ export const Sku$outboundSchema: z.ZodType<Sku$Outbound, z.ZodTypeDef, Sku> = z
|
|
|
196
203
|
pricing: ProductPricing$outboundSchema.optional(),
|
|
197
204
|
promotion: z.nullable(ProductPromotion$outboundSchema).optional(),
|
|
198
205
|
subscription: z.array(ProductSubscription$outboundSchema).optional(),
|
|
199
|
-
associatedOptions: z.record(AssociatedOption$outboundSchema)
|
|
206
|
+
associatedOptions: z.nullable(z.record(AssociatedOption$outboundSchema))
|
|
207
|
+
.optional(),
|
|
200
208
|
}).transform((v) => {
|
|
201
209
|
return remap$(v, {
|
|
202
210
|
productId: "product_id",
|