ce-storefront 0.3.6 → 0.3.8
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 +6 -5
- package/esm/models/components/productlistresponse.d.ts.map +1 -1
- package/esm/models/components/productlistresponse.js +6 -5
- package/esm/models/components/productlistresponse.js.map +1 -1
- package/esm/models/components/productpricing.d.ts +12 -12
- package/esm/models/components/productpricing.d.ts.map +1 -1
- package/esm/models/components/productpricing.js +12 -12
- package/esm/models/components/productpricing.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} +39 -24
- package/esm/models/components/singleproduct.d.ts.map +1 -0
- package/esm/models/components/{product.js → singleproduct.js} +24 -25
- 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 +23 -13
- package/src/models/components/productpricing.ts +24 -24
- package/src/models/components/productshipping.ts +27 -27
- package/src/models/components/{product.ts → singleproduct.ts} +90 -73
- 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
|
@@ -6,196 +6,23 @@ import * as z from "zod";
|
|
|
6
6
|
import { safeParse } from "../../lib/schemas.js";
|
|
7
7
|
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
8
8
|
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
/** @internal */
|
|
28
|
-
export type BundleProduct2$Outbound = {};
|
|
29
|
-
|
|
30
|
-
/** @internal */
|
|
31
|
-
export const BundleProduct2$outboundSchema: z.ZodType<
|
|
32
|
-
BundleProduct2$Outbound,
|
|
33
|
-
z.ZodTypeDef,
|
|
34
|
-
BundleProduct2
|
|
35
|
-
> = z.object({});
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* @internal
|
|
39
|
-
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
40
|
-
*/
|
|
41
|
-
export namespace BundleProduct2$ {
|
|
42
|
-
/** @deprecated use `BundleProduct2$inboundSchema` instead. */
|
|
43
|
-
export const inboundSchema = BundleProduct2$inboundSchema;
|
|
44
|
-
/** @deprecated use `BundleProduct2$outboundSchema` instead. */
|
|
45
|
-
export const outboundSchema = BundleProduct2$outboundSchema;
|
|
46
|
-
/** @deprecated use `BundleProduct2$Outbound` instead. */
|
|
47
|
-
export type Outbound = BundleProduct2$Outbound;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
export function bundleProduct2ToJSON(bundleProduct2: BundleProduct2): string {
|
|
51
|
-
return JSON.stringify(BundleProduct2$outboundSchema.parse(bundleProduct2));
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
export function bundleProduct2FromJSON(
|
|
55
|
-
jsonString: string,
|
|
56
|
-
): SafeParseResult<BundleProduct2, SDKValidationError> {
|
|
57
|
-
return safeParse(
|
|
58
|
-
jsonString,
|
|
59
|
-
(x) => BundleProduct2$inboundSchema.parse(JSON.parse(x)),
|
|
60
|
-
`Failed to parse 'BundleProduct2' from JSON`,
|
|
61
|
-
);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
/** @internal */
|
|
65
|
-
export const BundleProduct$inboundSchema: z.ZodType<
|
|
66
|
-
BundleProduct,
|
|
67
|
-
z.ZodTypeDef,
|
|
68
|
-
unknown
|
|
69
|
-
> = z.union([z.lazy(() => BundleProduct2$inboundSchema), z.array(z.any())]);
|
|
70
|
-
|
|
71
|
-
/** @internal */
|
|
72
|
-
export type BundleProduct$Outbound = BundleProduct2$Outbound | Array<any>;
|
|
73
|
-
|
|
74
|
-
/** @internal */
|
|
75
|
-
export const BundleProduct$outboundSchema: z.ZodType<
|
|
76
|
-
BundleProduct$Outbound,
|
|
77
|
-
z.ZodTypeDef,
|
|
78
|
-
BundleProduct
|
|
79
|
-
> = z.union([z.lazy(() => BundleProduct2$outboundSchema), z.array(z.any())]);
|
|
80
|
-
|
|
81
|
-
/**
|
|
82
|
-
* @internal
|
|
83
|
-
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
84
|
-
*/
|
|
85
|
-
export namespace BundleProduct$ {
|
|
86
|
-
/** @deprecated use `BundleProduct$inboundSchema` instead. */
|
|
87
|
-
export const inboundSchema = BundleProduct$inboundSchema;
|
|
88
|
-
/** @deprecated use `BundleProduct$outboundSchema` instead. */
|
|
89
|
-
export const outboundSchema = BundleProduct$outboundSchema;
|
|
90
|
-
/** @deprecated use `BundleProduct$Outbound` instead. */
|
|
91
|
-
export type Outbound = BundleProduct$Outbound;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
export function bundleProductToJSON(bundleProduct: BundleProduct): string {
|
|
95
|
-
return JSON.stringify(BundleProduct$outboundSchema.parse(bundleProduct));
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
export function bundleProductFromJSON(
|
|
99
|
-
jsonString: string,
|
|
100
|
-
): SafeParseResult<BundleProduct, SDKValidationError> {
|
|
101
|
-
return safeParse(
|
|
102
|
-
jsonString,
|
|
103
|
-
(x) => BundleProduct$inboundSchema.parse(JSON.parse(x)),
|
|
104
|
-
`Failed to parse 'BundleProduct' from JSON`,
|
|
105
|
-
);
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
/** @internal */
|
|
109
|
-
export const Product2$inboundSchema: z.ZodType<
|
|
110
|
-
Product2,
|
|
111
|
-
z.ZodTypeDef,
|
|
112
|
-
unknown
|
|
113
|
-
> = z.object({});
|
|
114
|
-
|
|
115
|
-
/** @internal */
|
|
116
|
-
export type Product2$Outbound = {};
|
|
117
|
-
|
|
118
|
-
/** @internal */
|
|
119
|
-
export const Product2$outboundSchema: z.ZodType<
|
|
120
|
-
Product2$Outbound,
|
|
121
|
-
z.ZodTypeDef,
|
|
122
|
-
Product2
|
|
123
|
-
> = z.object({});
|
|
124
|
-
|
|
125
|
-
/**
|
|
126
|
-
* @internal
|
|
127
|
-
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
128
|
-
*/
|
|
129
|
-
export namespace Product2$ {
|
|
130
|
-
/** @deprecated use `Product2$inboundSchema` instead. */
|
|
131
|
-
export const inboundSchema = Product2$inboundSchema;
|
|
132
|
-
/** @deprecated use `Product2$outboundSchema` instead. */
|
|
133
|
-
export const outboundSchema = Product2$outboundSchema;
|
|
134
|
-
/** @deprecated use `Product2$Outbound` instead. */
|
|
135
|
-
export type Outbound = Product2$Outbound;
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
export function product2ToJSON(product2: Product2): string {
|
|
139
|
-
return JSON.stringify(Product2$outboundSchema.parse(product2));
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
export function product2FromJSON(
|
|
143
|
-
jsonString: string,
|
|
144
|
-
): SafeParseResult<Product2, SDKValidationError> {
|
|
145
|
-
return safeParse(
|
|
146
|
-
jsonString,
|
|
147
|
-
(x) => Product2$inboundSchema.parse(JSON.parse(x)),
|
|
148
|
-
`Failed to parse 'Product2' from JSON`,
|
|
149
|
-
);
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
/** @internal */
|
|
153
|
-
export const ProductDetailProduct$inboundSchema: z.ZodType<
|
|
154
|
-
ProductDetailProduct,
|
|
155
|
-
z.ZodTypeDef,
|
|
156
|
-
unknown
|
|
157
|
-
> = z.union([z.lazy(() => Product2$inboundSchema), z.array(z.any())]);
|
|
158
|
-
|
|
159
|
-
/** @internal */
|
|
160
|
-
export type ProductDetailProduct$Outbound = Product2$Outbound | Array<any>;
|
|
161
|
-
|
|
162
|
-
/** @internal */
|
|
163
|
-
export const ProductDetailProduct$outboundSchema: z.ZodType<
|
|
164
|
-
ProductDetailProduct$Outbound,
|
|
165
|
-
z.ZodTypeDef,
|
|
166
|
-
ProductDetailProduct
|
|
167
|
-
> = z.union([z.lazy(() => Product2$outboundSchema), z.array(z.any())]);
|
|
168
|
-
|
|
169
|
-
/**
|
|
170
|
-
* @internal
|
|
171
|
-
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
172
|
-
*/
|
|
173
|
-
export namespace ProductDetailProduct$ {
|
|
174
|
-
/** @deprecated use `ProductDetailProduct$inboundSchema` instead. */
|
|
175
|
-
export const inboundSchema = ProductDetailProduct$inboundSchema;
|
|
176
|
-
/** @deprecated use `ProductDetailProduct$outboundSchema` instead. */
|
|
177
|
-
export const outboundSchema = ProductDetailProduct$outboundSchema;
|
|
178
|
-
/** @deprecated use `ProductDetailProduct$Outbound` instead. */
|
|
179
|
-
export type Outbound = ProductDetailProduct$Outbound;
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
export function productDetailProductToJSON(
|
|
183
|
-
productDetailProduct: ProductDetailProduct,
|
|
184
|
-
): string {
|
|
185
|
-
return JSON.stringify(
|
|
186
|
-
ProductDetailProduct$outboundSchema.parse(productDetailProduct),
|
|
187
|
-
);
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
export function productDetailProductFromJSON(
|
|
191
|
-
jsonString: string,
|
|
192
|
-
): SafeParseResult<ProductDetailProduct, SDKValidationError> {
|
|
193
|
-
return safeParse(
|
|
194
|
-
jsonString,
|
|
195
|
-
(x) => ProductDetailProduct$inboundSchema.parse(JSON.parse(x)),
|
|
196
|
-
`Failed to parse 'ProductDetailProduct' from JSON`,
|
|
197
|
-
);
|
|
198
|
-
}
|
|
9
|
+
import {
|
|
10
|
+
BundleProductDetail,
|
|
11
|
+
BundleProductDetail$inboundSchema,
|
|
12
|
+
BundleProductDetail$Outbound,
|
|
13
|
+
BundleProductDetail$outboundSchema,
|
|
14
|
+
} from "./bundleproductdetail.js";
|
|
15
|
+
import {
|
|
16
|
+
SingleProductDetail,
|
|
17
|
+
SingleProductDetail$inboundSchema,
|
|
18
|
+
SingleProductDetail$Outbound,
|
|
19
|
+
SingleProductDetail$outboundSchema,
|
|
20
|
+
} from "./singleproductdetail.js";
|
|
21
|
+
|
|
22
|
+
export type ProductDetail =
|
|
23
|
+
| (SingleProductDetail & { productType: "physical" })
|
|
24
|
+
| (SingleProductDetail & { productType: "digital" })
|
|
25
|
+
| (BundleProductDetail & { productType: "bundle" });
|
|
199
26
|
|
|
200
27
|
/** @internal */
|
|
201
28
|
export const ProductDetail$inboundSchema: z.ZodType<
|
|
@@ -203,16 +30,28 @@ export const ProductDetail$inboundSchema: z.ZodType<
|
|
|
203
30
|
z.ZodTypeDef,
|
|
204
31
|
unknown
|
|
205
32
|
> = z.union([
|
|
206
|
-
|
|
207
|
-
|
|
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
|
+
),
|
|
208
48
|
]);
|
|
209
49
|
|
|
210
50
|
/** @internal */
|
|
211
51
|
export type ProductDetail$Outbound =
|
|
212
|
-
|
|
|
213
|
-
|
|
|
214
|
-
|
|
|
215
|
-
| Array<any>;
|
|
52
|
+
| (SingleProductDetail$Outbound & { product_type: "physical" })
|
|
53
|
+
| (SingleProductDetail$Outbound & { product_type: "digital" })
|
|
54
|
+
| (BundleProductDetail$Outbound & { product_type: "bundle" });
|
|
216
55
|
|
|
217
56
|
/** @internal */
|
|
218
57
|
export const ProductDetail$outboundSchema: z.ZodType<
|
|
@@ -220,8 +59,21 @@ export const ProductDetail$outboundSchema: z.ZodType<
|
|
|
220
59
|
z.ZodTypeDef,
|
|
221
60
|
ProductDetail
|
|
222
61
|
> = z.union([
|
|
223
|
-
|
|
224
|
-
|
|
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
|
+
),
|
|
225
77
|
]);
|
|
226
78
|
|
|
227
79
|
/**
|
|
@@ -6,6 +6,12 @@ import * as z from "zod";
|
|
|
6
6
|
import { safeParse } from "../../lib/schemas.js";
|
|
7
7
|
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
8
8
|
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
9
|
+
import {
|
|
10
|
+
BundleProduct,
|
|
11
|
+
BundleProduct$inboundSchema,
|
|
12
|
+
BundleProduct$Outbound,
|
|
13
|
+
BundleProduct$outboundSchema,
|
|
14
|
+
} from "./bundleproduct.js";
|
|
9
15
|
import {
|
|
10
16
|
Pagination,
|
|
11
17
|
Pagination$inboundSchema,
|
|
@@ -13,16 +19,16 @@ import {
|
|
|
13
19
|
Pagination$outboundSchema,
|
|
14
20
|
} from "./pagination.js";
|
|
15
21
|
import {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
} from "./
|
|
22
|
+
SingleProduct,
|
|
23
|
+
SingleProduct$inboundSchema,
|
|
24
|
+
SingleProduct$Outbound,
|
|
25
|
+
SingleProduct$outboundSchema,
|
|
26
|
+
} from "./singleproduct.js";
|
|
21
27
|
|
|
22
|
-
export type Products =
|
|
28
|
+
export type Products = SingleProduct | BundleProduct;
|
|
23
29
|
|
|
24
30
|
export type ProductListResponse = {
|
|
25
|
-
products?: Array<
|
|
31
|
+
products?: Array<SingleProduct | BundleProduct> | undefined;
|
|
26
32
|
/**
|
|
27
33
|
* pagination metadata structure
|
|
28
34
|
*/
|
|
@@ -34,17 +40,17 @@ export const Products$inboundSchema: z.ZodType<
|
|
|
34
40
|
Products,
|
|
35
41
|
z.ZodTypeDef,
|
|
36
42
|
unknown
|
|
37
|
-
> = z.
|
|
43
|
+
> = z.union([SingleProduct$inboundSchema, BundleProduct$inboundSchema]);
|
|
38
44
|
|
|
39
45
|
/** @internal */
|
|
40
|
-
export type Products$Outbound =
|
|
46
|
+
export type Products$Outbound = SingleProduct$Outbound | BundleProduct$Outbound;
|
|
41
47
|
|
|
42
48
|
/** @internal */
|
|
43
49
|
export const Products$outboundSchema: z.ZodType<
|
|
44
50
|
Products$Outbound,
|
|
45
51
|
z.ZodTypeDef,
|
|
46
52
|
Products
|
|
47
|
-
> = z.
|
|
53
|
+
> = z.union([SingleProduct$outboundSchema, BundleProduct$outboundSchema]);
|
|
48
54
|
|
|
49
55
|
/**
|
|
50
56
|
* @internal
|
|
@@ -79,13 +85,15 @@ export const ProductListResponse$inboundSchema: z.ZodType<
|
|
|
79
85
|
z.ZodTypeDef,
|
|
80
86
|
unknown
|
|
81
87
|
> = z.object({
|
|
82
|
-
products: z.array(
|
|
88
|
+
products: z.array(
|
|
89
|
+
z.union([SingleProduct$inboundSchema, BundleProduct$inboundSchema]),
|
|
90
|
+
).optional(),
|
|
83
91
|
pagination: Pagination$inboundSchema.optional(),
|
|
84
92
|
});
|
|
85
93
|
|
|
86
94
|
/** @internal */
|
|
87
95
|
export type ProductListResponse$Outbound = {
|
|
88
|
-
products?: Array<
|
|
96
|
+
products?: Array<SingleProduct$Outbound | BundleProduct$Outbound> | undefined;
|
|
89
97
|
pagination?: Pagination$Outbound | undefined;
|
|
90
98
|
};
|
|
91
99
|
|
|
@@ -95,7 +103,9 @@ export const ProductListResponse$outboundSchema: z.ZodType<
|
|
|
95
103
|
z.ZodTypeDef,
|
|
96
104
|
ProductListResponse
|
|
97
105
|
> = z.object({
|
|
98
|
-
products: z.array(
|
|
106
|
+
products: z.array(
|
|
107
|
+
z.union([SingleProduct$outboundSchema, BundleProduct$outboundSchema]),
|
|
108
|
+
).optional(),
|
|
99
109
|
pagination: Pagination$outboundSchema.optional(),
|
|
100
110
|
});
|
|
101
111
|
|
|
@@ -15,12 +15,12 @@ export const TaxType = {
|
|
|
15
15
|
export type TaxType = ClosedEnum<typeof TaxType>;
|
|
16
16
|
|
|
17
17
|
export type ProductPricing = {
|
|
18
|
-
currency
|
|
19
|
-
taxType
|
|
20
|
-
taxRate
|
|
21
|
-
priceIncludingTax
|
|
22
|
-
listingPrice
|
|
23
|
-
sellingPrice
|
|
18
|
+
currency: string;
|
|
19
|
+
taxType: TaxType;
|
|
20
|
+
taxRate: number;
|
|
21
|
+
priceIncludingTax: boolean;
|
|
22
|
+
listingPrice: number;
|
|
23
|
+
sellingPrice: number;
|
|
24
24
|
minOrderQuantity?: number | undefined;
|
|
25
25
|
maxOrderQuantity?: number | null | undefined;
|
|
26
26
|
incrementalQuantity?: number | undefined;
|
|
@@ -52,12 +52,12 @@ export const ProductPricing$inboundSchema: z.ZodType<
|
|
|
52
52
|
z.ZodTypeDef,
|
|
53
53
|
unknown
|
|
54
54
|
> = z.object({
|
|
55
|
-
currency: z.string()
|
|
56
|
-
tax_type: TaxType$inboundSchema
|
|
57
|
-
tax_rate: z.number()
|
|
58
|
-
price_including_tax: z.boolean()
|
|
59
|
-
listing_price: z.number()
|
|
60
|
-
selling_price: z.number()
|
|
55
|
+
currency: z.string(),
|
|
56
|
+
tax_type: TaxType$inboundSchema,
|
|
57
|
+
tax_rate: z.number(),
|
|
58
|
+
price_including_tax: z.boolean(),
|
|
59
|
+
listing_price: z.number(),
|
|
60
|
+
selling_price: z.number(),
|
|
61
61
|
min_order_quantity: z.number().int().default(1),
|
|
62
62
|
max_order_quantity: z.nullable(z.number().int()).optional(),
|
|
63
63
|
incremental_quantity: z.number().int().default(1),
|
|
@@ -78,12 +78,12 @@ export const ProductPricing$inboundSchema: z.ZodType<
|
|
|
78
78
|
|
|
79
79
|
/** @internal */
|
|
80
80
|
export type ProductPricing$Outbound = {
|
|
81
|
-
currency
|
|
82
|
-
tax_type
|
|
83
|
-
tax_rate
|
|
84
|
-
price_including_tax
|
|
85
|
-
listing_price
|
|
86
|
-
selling_price
|
|
81
|
+
currency: string;
|
|
82
|
+
tax_type: string;
|
|
83
|
+
tax_rate: number;
|
|
84
|
+
price_including_tax: boolean;
|
|
85
|
+
listing_price: number;
|
|
86
|
+
selling_price: number;
|
|
87
87
|
min_order_quantity: number;
|
|
88
88
|
max_order_quantity?: number | null | undefined;
|
|
89
89
|
incremental_quantity: number;
|
|
@@ -96,12 +96,12 @@ export const ProductPricing$outboundSchema: z.ZodType<
|
|
|
96
96
|
z.ZodTypeDef,
|
|
97
97
|
ProductPricing
|
|
98
98
|
> = z.object({
|
|
99
|
-
currency: z.string()
|
|
100
|
-
taxType: TaxType$outboundSchema
|
|
101
|
-
taxRate: z.number()
|
|
102
|
-
priceIncludingTax: z.boolean()
|
|
103
|
-
listingPrice: z.number()
|
|
104
|
-
sellingPrice: z.number()
|
|
99
|
+
currency: z.string(),
|
|
100
|
+
taxType: TaxType$outboundSchema,
|
|
101
|
+
taxRate: z.number(),
|
|
102
|
+
priceIncludingTax: z.boolean(),
|
|
103
|
+
listingPrice: z.number(),
|
|
104
|
+
sellingPrice: z.number(),
|
|
105
105
|
minOrderQuantity: z.number().int().default(1),
|
|
106
106
|
maxOrderQuantity: z.nullable(z.number().int()).optional(),
|
|
107
107
|
incrementalQuantity: z.number().int().default(1),
|
|
@@ -9,14 +9,14 @@ import { Result as SafeParseResult } from "../../types/fp.js";
|
|
|
9
9
|
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
10
10
|
|
|
11
11
|
export type ProductShipping = {
|
|
12
|
-
additionalCost?: number | undefined;
|
|
12
|
+
additionalCost?: number | null | undefined;
|
|
13
13
|
shippingPriceIncludingTax?: boolean | undefined;
|
|
14
|
-
availabilityDescription?: string | undefined;
|
|
14
|
+
availabilityDescription?: string | null | undefined;
|
|
15
15
|
shipsInternationally?: boolean | undefined;
|
|
16
|
-
midCode?: string | undefined;
|
|
17
|
-
countryOfOrigin?: string | undefined;
|
|
18
|
-
taxType?: string | undefined;
|
|
19
|
-
taxRate?: number | undefined;
|
|
16
|
+
midCode?: string | null | undefined;
|
|
17
|
+
countryOfOrigin?: string | null | undefined;
|
|
18
|
+
taxType?: string | null | undefined;
|
|
19
|
+
taxRate?: number | null | undefined;
|
|
20
20
|
};
|
|
21
21
|
|
|
22
22
|
/** @internal */
|
|
@@ -25,14 +25,14 @@ export const ProductShipping$inboundSchema: z.ZodType<
|
|
|
25
25
|
z.ZodTypeDef,
|
|
26
26
|
unknown
|
|
27
27
|
> = z.object({
|
|
28
|
-
additional_cost: z.number().optional(),
|
|
28
|
+
additional_cost: z.nullable(z.number()).optional(),
|
|
29
29
|
shipping_price_including_tax: z.boolean().optional(),
|
|
30
|
-
availability_description: z.string().optional(),
|
|
31
|
-
ships_internationally: z.boolean().
|
|
32
|
-
mid_code: z.string().optional(),
|
|
33
|
-
country_of_origin: z.string().default("India"),
|
|
34
|
-
tax_type: z.string().optional(),
|
|
35
|
-
tax_rate: z.number().optional(),
|
|
30
|
+
availability_description: z.nullable(z.string()).optional(),
|
|
31
|
+
ships_internationally: z.boolean().default(false),
|
|
32
|
+
mid_code: z.nullable(z.string()).optional(),
|
|
33
|
+
country_of_origin: z.nullable(z.string().default("India")),
|
|
34
|
+
tax_type: z.nullable(z.string()).optional(),
|
|
35
|
+
tax_rate: z.nullable(z.number()).optional(),
|
|
36
36
|
}).transform((v) => {
|
|
37
37
|
return remap$(v, {
|
|
38
38
|
"additional_cost": "additionalCost",
|
|
@@ -48,14 +48,14 @@ export const ProductShipping$inboundSchema: z.ZodType<
|
|
|
48
48
|
|
|
49
49
|
/** @internal */
|
|
50
50
|
export type ProductShipping$Outbound = {
|
|
51
|
-
additional_cost?: number | undefined;
|
|
51
|
+
additional_cost?: number | null | undefined;
|
|
52
52
|
shipping_price_including_tax?: boolean | undefined;
|
|
53
|
-
availability_description?: string | undefined;
|
|
54
|
-
ships_internationally
|
|
55
|
-
mid_code?: string | undefined;
|
|
56
|
-
country_of_origin: string;
|
|
57
|
-
tax_type?: string | undefined;
|
|
58
|
-
tax_rate?: number | undefined;
|
|
53
|
+
availability_description?: string | null | undefined;
|
|
54
|
+
ships_internationally: boolean;
|
|
55
|
+
mid_code?: string | null | undefined;
|
|
56
|
+
country_of_origin: string | null;
|
|
57
|
+
tax_type?: string | null | undefined;
|
|
58
|
+
tax_rate?: number | null | undefined;
|
|
59
59
|
};
|
|
60
60
|
|
|
61
61
|
/** @internal */
|
|
@@ -64,14 +64,14 @@ export const ProductShipping$outboundSchema: z.ZodType<
|
|
|
64
64
|
z.ZodTypeDef,
|
|
65
65
|
ProductShipping
|
|
66
66
|
> = z.object({
|
|
67
|
-
additionalCost: z.number().optional(),
|
|
67
|
+
additionalCost: z.nullable(z.number()).optional(),
|
|
68
68
|
shippingPriceIncludingTax: z.boolean().optional(),
|
|
69
|
-
availabilityDescription: z.string().optional(),
|
|
70
|
-
shipsInternationally: z.boolean().
|
|
71
|
-
midCode: z.string().optional(),
|
|
72
|
-
countryOfOrigin: z.string().default("India"),
|
|
73
|
-
taxType: z.string().optional(),
|
|
74
|
-
taxRate: z.number().optional(),
|
|
69
|
+
availabilityDescription: z.nullable(z.string()).optional(),
|
|
70
|
+
shipsInternationally: z.boolean().default(false),
|
|
71
|
+
midCode: z.nullable(z.string()).optional(),
|
|
72
|
+
countryOfOrigin: z.nullable(z.string().default("India")),
|
|
73
|
+
taxType: z.nullable(z.string()).optional(),
|
|
74
|
+
taxRate: z.nullable(z.number()).optional(),
|
|
75
75
|
}).transform((v) => {
|
|
76
76
|
return remap$(v, {
|
|
77
77
|
additionalCost: "additional_cost",
|