ce-storefront 0.3.5 → 0.3.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/lib/config.d.ts +3 -3
- package/esm/lib/config.js +3 -3
- package/esm/models/components/analyticsevent.d.ts +8 -8
- package/esm/models/components/analyticsevent.d.ts.map +1 -1
- package/esm/models/components/analyticsevent.js +12 -12
- package/esm/models/components/analyticsevent.js.map +1 -1
- package/esm/models/components/associatedoption.d.ts +125 -0
- package/esm/models/components/associatedoption.d.ts.map +1 -0
- package/esm/models/components/associatedoption.js +107 -0
- package/esm/models/components/associatedoption.js.map +1 -0
- package/esm/models/components/bundleproduct.d.ts +236 -0
- package/esm/models/components/bundleproduct.d.ts.map +1 -0
- package/esm/models/components/bundleproduct.js +262 -0
- package/esm/models/components/bundleproduct.js.map +1 -0
- package/esm/models/components/bundleproductdetail.d.ts +265 -0
- package/esm/models/components/bundleproductdetail.d.ts.map +1 -0
- package/esm/models/components/bundleproductdetail.js +288 -0
- package/esm/models/components/bundleproductdetail.js.map +1 -0
- package/esm/models/components/cart.d.ts +15 -15
- package/esm/models/components/cart.d.ts.map +1 -1
- package/esm/models/components/cart.js +15 -15
- package/esm/models/components/cart.js.map +1 -1
- package/esm/models/components/discountbasedpromotion.d.ts +0 -2
- package/esm/models/components/discountbasedpromotion.d.ts.map +1 -1
- package/esm/models/components/discountbasedpromotion.js +0 -4
- package/esm/models/components/discountbasedpromotion.js.map +1 -1
- package/esm/models/components/fixedpricepromotion.d.ts +0 -2
- package/esm/models/components/fixedpricepromotion.d.ts.map +1 -1
- package/esm/models/components/fixedpricepromotion.js +0 -4
- package/esm/models/components/fixedpricepromotion.js.map +1 -1
- package/esm/models/components/freegoodspromotion.d.ts +0 -5
- package/esm/models/components/freegoodspromotion.d.ts.map +1 -1
- package/esm/models/components/freegoodspromotion.js +0 -4
- package/esm/models/components/freegoodspromotion.js.map +1 -1
- package/esm/models/components/index.d.ts +8 -6
- package/esm/models/components/index.d.ts.map +1 -1
- package/esm/models/components/index.js +8 -6
- package/esm/models/components/index.js.map +1 -1
- package/esm/models/components/productattribute.d.ts +97 -64
- package/esm/models/components/productattribute.d.ts.map +1 -1
- package/esm/models/components/productattribute.js +67 -128
- package/esm/models/components/productattribute.js.map +1 -1
- package/esm/models/components/productcategory.d.ts +2 -2
- package/esm/models/components/productcategory.d.ts.map +1 -1
- package/esm/models/components/productcategory.js +2 -2
- package/esm/models/components/productcategory.js.map +1 -1
- package/esm/models/components/productdetail.d.ts +16 -188
- package/esm/models/components/productdetail.d.ts.map +1 -1
- package/esm/models/components/productdetail.js +26 -228
- package/esm/models/components/productdetail.js.map +1 -1
- package/esm/models/components/productlistresponse.d.ts +49 -3
- package/esm/models/components/productlistresponse.d.ts.map +1 -1
- package/esm/models/components/productlistresponse.js +65 -3
- package/esm/models/components/productlistresponse.js.map +1 -1
- package/esm/models/components/productshipping.d.ts +13 -15
- package/esm/models/components/productshipping.d.ts.map +1 -1
- package/esm/models/components/productshipping.js +14 -18
- package/esm/models/components/productshipping.js.map +1 -1
- package/esm/models/components/{promotion.d.ts → promotiondetail.d.ts} +29 -29
- package/esm/models/components/promotiondetail.d.ts.map +1 -0
- package/esm/models/components/{promotion.js → promotiondetail.js} +29 -29
- package/esm/models/components/promotiondetail.js.map +1 -0
- package/esm/models/components/seo.d.ts +6 -6
- package/esm/models/components/seo.d.ts.map +1 -1
- package/esm/models/components/seo.js +6 -19
- package/esm/models/components/seo.js.map +1 -1
- package/esm/models/components/{product.d.ts → singleproduct.d.ts} +52 -75
- package/esm/models/components/singleproduct.d.ts.map +1 -0
- package/esm/models/components/{product.js → singleproduct.js} +37 -95
- package/esm/models/components/singleproduct.js.map +1 -0
- package/esm/models/components/singleproductdetail.d.ts +159 -0
- package/esm/models/components/singleproductdetail.d.ts.map +1 -0
- package/esm/models/components/singleproductdetail.js +156 -0
- package/esm/models/components/singleproductdetail.js.map +1 -0
- package/esm/models/components/{skuinfo.d.ts → sku.d.ts} +59 -48
- package/esm/models/components/sku.d.ts.map +1 -0
- package/esm/models/components/{skuinfo.js → sku.js} +67 -57
- package/esm/models/components/sku.js.map +1 -0
- package/esm/models/components/variant.d.ts +42 -72
- package/esm/models/components/variant.d.ts.map +1 -1
- package/esm/models/components/variant.js +39 -82
- package/esm/models/components/variant.js.map +1 -1
- package/esm/models/components/variantdetail.d.ts +101 -68
- package/esm/models/components/variantdetail.d.ts.map +1 -1
- package/esm/models/components/variantdetail.js +99 -71
- package/esm/models/components/variantdetail.js.map +1 -1
- package/esm/models/components/variantoption.d.ts +118 -0
- package/esm/models/components/variantoption.d.ts.map +1 -0
- package/esm/models/components/variantoption.js +114 -0
- package/esm/models/components/variantoption.js.map +1 -0
- package/esm/models/components/volumebasedpromotion.d.ts +0 -5
- package/esm/models/components/volumebasedpromotion.d.ts.map +1 -1
- package/esm/models/components/volumebasedpromotion.js +0 -4
- package/esm/models/components/volumebasedpromotion.js.map +1 -1
- package/esm/models/operations/getpromotions.d.ts +2 -2
- package/esm/models/operations/getpromotions.d.ts.map +1 -1
- package/esm/models/operations/getpromotions.js +2 -2
- package/esm/models/operations/getpromotions.js.map +1 -1
- package/esm/models/operations/getskus.d.ts +2 -2
- package/esm/models/operations/getskus.d.ts.map +1 -1
- package/esm/models/operations/getskus.js +2 -2
- package/esm/models/operations/getskus.js.map +1 -1
- package/esm/models/operations/getwishtlist.d.ts +2 -2
- package/esm/models/operations/getwishtlist.d.ts.map +1 -1
- package/esm/models/operations/getwishtlist.js +2 -2
- package/esm/models/operations/getwishtlist.js.map +1 -1
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/lib/config.ts +3 -3
- package/src/models/components/analyticsevent.ts +16 -15
- package/src/models/components/associatedoption.ts +217 -0
- package/src/models/components/bundleproduct.ts +501 -0
- package/src/models/components/bundleproductdetail.ts +567 -0
- package/src/models/components/cart.ts +24 -24
- package/src/models/components/discountbasedpromotion.ts +0 -6
- package/src/models/components/fixedpricepromotion.ts +0 -6
- package/src/models/components/freegoodspromotion.ts +0 -9
- package/src/models/components/index.ts +8 -6
- package/src/models/components/productattribute.ts +162 -188
- package/src/models/components/productcategory.ts +4 -4
- package/src/models/components/productdetail.ts +52 -475
- package/src/models/components/productlistresponse.ts +147 -9
- package/src/models/components/productshipping.ts +27 -33
- package/src/models/components/{promotion.ts → promotiondetail.ts} +47 -45
- package/src/models/components/seo.ts +12 -25
- package/src/models/components/singleproduct.ts +269 -0
- package/src/models/components/singleproductdetail.ts +339 -0
- package/src/models/components/sku.ts +252 -0
- package/src/models/components/variant.ts +81 -170
- package/src/models/components/variantdetail.ts +189 -168
- package/src/models/components/variantoption.ts +214 -0
- package/src/models/components/volumebasedpromotion.ts +0 -9
- package/src/models/operations/getpromotions.ts +4 -4
- package/src/models/operations/getskus.ts +4 -4
- package/src/models/operations/getwishtlist.ts +4 -4
- package/esm/models/components/product.d.ts.map +0 -1
- package/esm/models/components/product.js.map +0 -1
- package/esm/models/components/productbundleitem.d.ts +0 -47
- package/esm/models/components/productbundleitem.d.ts.map +0 -1
- package/esm/models/components/productbundleitem.js +0 -66
- package/esm/models/components/productbundleitem.js.map +0 -1
- package/esm/models/components/productpackaging.d.ts +0 -68
- package/esm/models/components/productpackaging.d.ts.map +0 -1
- package/esm/models/components/productpackaging.js +0 -88
- package/esm/models/components/productpackaging.js.map +0 -1
- package/esm/models/components/promotion.d.ts.map +0 -1
- package/esm/models/components/promotion.js.map +0 -1
- package/esm/models/components/saleschannel.d.ts +0 -39
- package/esm/models/components/saleschannel.d.ts.map +0 -1
- package/esm/models/components/saleschannel.js +0 -53
- package/esm/models/components/saleschannel.js.map +0 -1
- package/esm/models/components/skuinfo.d.ts.map +0 -1
- package/esm/models/components/skuinfo.js.map +0 -1
- package/src/models/components/product.ts +0 -363
- package/src/models/components/productbundleitem.ts +0 -127
- package/src/models/components/productpackaging.ts +0 -162
- package/src/models/components/saleschannel.ts +0 -96
- package/src/models/components/skuinfo.ts +0 -237
|
@@ -3,7 +3,6 @@
|
|
|
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 { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
8
|
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
@@ -12,11 +11,6 @@ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
|
12
11
|
* Attribute for numeric values
|
|
13
12
|
*/
|
|
14
13
|
export type NumberAttribute = {
|
|
15
|
-
attributeType?: "number" | undefined;
|
|
16
|
-
/**
|
|
17
|
-
* For numeric attributes
|
|
18
|
-
*/
|
|
19
|
-
attributeValue: number;
|
|
20
14
|
/**
|
|
21
15
|
* Unique identifier for the attribute
|
|
22
16
|
*/
|
|
@@ -25,17 +19,21 @@ export type NumberAttribute = {
|
|
|
25
19
|
* Name of the attribute
|
|
26
20
|
*/
|
|
27
21
|
name: string;
|
|
22
|
+
/**
|
|
23
|
+
* 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`
|
|
24
|
+
*/
|
|
25
|
+
key: string;
|
|
26
|
+
type?: "number" | undefined;
|
|
27
|
+
/**
|
|
28
|
+
* For numeric attributes
|
|
29
|
+
*/
|
|
30
|
+
value: number;
|
|
28
31
|
};
|
|
29
32
|
|
|
30
33
|
/**
|
|
31
34
|
* Attribute for date values
|
|
32
35
|
*/
|
|
33
36
|
export type DateAttribute = {
|
|
34
|
-
attributeType?: "date" | undefined;
|
|
35
|
-
/**
|
|
36
|
-
* For date attributes
|
|
37
|
-
*/
|
|
38
|
-
attributeValue: Date;
|
|
39
37
|
/**
|
|
40
38
|
* Unique identifier for the attribute
|
|
41
39
|
*/
|
|
@@ -44,17 +42,21 @@ export type DateAttribute = {
|
|
|
44
42
|
* Name of the attribute
|
|
45
43
|
*/
|
|
46
44
|
name: string;
|
|
45
|
+
/**
|
|
46
|
+
* 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`
|
|
47
|
+
*/
|
|
48
|
+
key: string;
|
|
49
|
+
type?: "date" | undefined;
|
|
50
|
+
/**
|
|
51
|
+
* For date attributes
|
|
52
|
+
*/
|
|
53
|
+
value: Date;
|
|
47
54
|
};
|
|
48
55
|
|
|
49
56
|
/**
|
|
50
57
|
* Attribute for text values
|
|
51
58
|
*/
|
|
52
59
|
export type TextAttribute = {
|
|
53
|
-
attributeType?: "text" | undefined;
|
|
54
|
-
/**
|
|
55
|
-
* For text attributes
|
|
56
|
-
*/
|
|
57
|
-
attributeValue: string;
|
|
58
60
|
/**
|
|
59
61
|
* Unique identifier for the attribute
|
|
60
62
|
*/
|
|
@@ -63,17 +65,21 @@ export type TextAttribute = {
|
|
|
63
65
|
* Name of the attribute
|
|
64
66
|
*/
|
|
65
67
|
name: string;
|
|
68
|
+
/**
|
|
69
|
+
* 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`
|
|
70
|
+
*/
|
|
71
|
+
key?: string | undefined;
|
|
72
|
+
type?: "text" | undefined;
|
|
73
|
+
/**
|
|
74
|
+
* For text attributes
|
|
75
|
+
*/
|
|
76
|
+
value: string;
|
|
66
77
|
};
|
|
67
78
|
|
|
68
79
|
/**
|
|
69
80
|
* Attribute for multi-select values
|
|
70
81
|
*/
|
|
71
82
|
export type MultiSelectAttribute = {
|
|
72
|
-
attributeType?: "multi-select" | undefined;
|
|
73
|
-
/**
|
|
74
|
-
* For multi-select attributes
|
|
75
|
-
*/
|
|
76
|
-
attributeValue: Array<string>;
|
|
77
83
|
/**
|
|
78
84
|
* Unique identifier for the attribute
|
|
79
85
|
*/
|
|
@@ -82,17 +88,21 @@ export type MultiSelectAttribute = {
|
|
|
82
88
|
* Name of the attribute
|
|
83
89
|
*/
|
|
84
90
|
name: string;
|
|
91
|
+
/**
|
|
92
|
+
* 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`
|
|
93
|
+
*/
|
|
94
|
+
key: string;
|
|
95
|
+
type?: "multi-select" | undefined;
|
|
96
|
+
/**
|
|
97
|
+
* For multi-select attributes
|
|
98
|
+
*/
|
|
99
|
+
value: Array<string>;
|
|
85
100
|
};
|
|
86
101
|
|
|
87
102
|
/**
|
|
88
103
|
* Attribute for single-select values
|
|
89
104
|
*/
|
|
90
105
|
export type SingleSelectAttribute = {
|
|
91
|
-
attributeType?: "single-select" | undefined;
|
|
92
|
-
/**
|
|
93
|
-
* For single-select attributes
|
|
94
|
-
*/
|
|
95
|
-
attributeValue: string;
|
|
96
106
|
/**
|
|
97
107
|
* Unique identifier for the attribute
|
|
98
108
|
*/
|
|
@@ -101,10 +111,22 @@ export type SingleSelectAttribute = {
|
|
|
101
111
|
* Name of the attribute
|
|
102
112
|
*/
|
|
103
113
|
name: string;
|
|
114
|
+
/**
|
|
115
|
+
* 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`
|
|
116
|
+
*/
|
|
117
|
+
key: string;
|
|
118
|
+
type?: "single-select" | undefined;
|
|
119
|
+
/**
|
|
120
|
+
* For single-select attributes
|
|
121
|
+
*/
|
|
122
|
+
value: string;
|
|
104
123
|
};
|
|
105
124
|
|
|
106
|
-
export type
|
|
125
|
+
export type ColorAttributeValue = {
|
|
107
126
|
name: string;
|
|
127
|
+
/**
|
|
128
|
+
* The hex code of the color (e.g., #000000).
|
|
129
|
+
*/
|
|
108
130
|
hexcode: string;
|
|
109
131
|
};
|
|
110
132
|
|
|
@@ -112,8 +134,6 @@ export type AttributeValue = {
|
|
|
112
134
|
* Attribute for colors
|
|
113
135
|
*/
|
|
114
136
|
export type ColorAttribute = {
|
|
115
|
-
attributeType?: "color" | undefined;
|
|
116
|
-
attributeValue: Array<AttributeValue>;
|
|
117
137
|
/**
|
|
118
138
|
* Unique identifier for the attribute
|
|
119
139
|
*/
|
|
@@ -122,15 +142,21 @@ export type ColorAttribute = {
|
|
|
122
142
|
* Name of the attribute
|
|
123
143
|
*/
|
|
124
144
|
name: string;
|
|
145
|
+
/**
|
|
146
|
+
* 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`
|
|
147
|
+
*/
|
|
148
|
+
key: string;
|
|
149
|
+
type?: "color" | undefined;
|
|
150
|
+
value: Array<ColorAttributeValue>;
|
|
125
151
|
};
|
|
126
152
|
|
|
127
153
|
export type ProductAttribute =
|
|
128
|
-
| (ColorAttribute & {
|
|
129
|
-
| (SingleSelectAttribute & {
|
|
130
|
-
| (MultiSelectAttribute & {
|
|
131
|
-
| (TextAttribute & {
|
|
132
|
-
| (DateAttribute & {
|
|
133
|
-
| (NumberAttribute & {
|
|
154
|
+
| (ColorAttribute & { type: "color" })
|
|
155
|
+
| (SingleSelectAttribute & { type: "single-select" })
|
|
156
|
+
| (MultiSelectAttribute & { type: "multi-select" })
|
|
157
|
+
| (TextAttribute & { type: "text" })
|
|
158
|
+
| (DateAttribute & { type: "date" })
|
|
159
|
+
| (NumberAttribute & { type: "number" });
|
|
134
160
|
|
|
135
161
|
/** @internal */
|
|
136
162
|
export const NumberAttribute$inboundSchema: z.ZodType<
|
|
@@ -138,23 +164,20 @@ export const NumberAttribute$inboundSchema: z.ZodType<
|
|
|
138
164
|
z.ZodTypeDef,
|
|
139
165
|
unknown
|
|
140
166
|
> = z.object({
|
|
141
|
-
attribute_type: z.literal("number").optional(),
|
|
142
|
-
attribute_value: z.number(),
|
|
143
167
|
id: z.string(),
|
|
144
168
|
name: z.string(),
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
"attribute_value": "attributeValue",
|
|
149
|
-
});
|
|
169
|
+
key: z.string(),
|
|
170
|
+
type: z.literal("number").optional(),
|
|
171
|
+
value: z.number(),
|
|
150
172
|
});
|
|
151
173
|
|
|
152
174
|
/** @internal */
|
|
153
175
|
export type NumberAttribute$Outbound = {
|
|
154
|
-
attribute_type: "number";
|
|
155
|
-
attribute_value: number;
|
|
156
176
|
id: string;
|
|
157
177
|
name: string;
|
|
178
|
+
key: string;
|
|
179
|
+
type: "number";
|
|
180
|
+
value: number;
|
|
158
181
|
};
|
|
159
182
|
|
|
160
183
|
/** @internal */
|
|
@@ -163,15 +186,11 @@ export const NumberAttribute$outboundSchema: z.ZodType<
|
|
|
163
186
|
z.ZodTypeDef,
|
|
164
187
|
NumberAttribute
|
|
165
188
|
> = z.object({
|
|
166
|
-
attributeType: z.literal("number").default("number" as const),
|
|
167
|
-
attributeValue: z.number(),
|
|
168
189
|
id: z.string(),
|
|
169
190
|
name: z.string(),
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
attributeValue: "attribute_value",
|
|
174
|
-
});
|
|
191
|
+
key: z.string(),
|
|
192
|
+
type: z.literal("number").default("number" as const),
|
|
193
|
+
value: z.number(),
|
|
175
194
|
});
|
|
176
195
|
|
|
177
196
|
/**
|
|
@@ -209,25 +228,20 @@ export const DateAttribute$inboundSchema: z.ZodType<
|
|
|
209
228
|
z.ZodTypeDef,
|
|
210
229
|
unknown
|
|
211
230
|
> = z.object({
|
|
212
|
-
attribute_type: z.literal("date").optional(),
|
|
213
|
-
attribute_value: z.string().datetime({ offset: true }).transform(v =>
|
|
214
|
-
new Date(v)
|
|
215
|
-
),
|
|
216
231
|
id: z.string(),
|
|
217
232
|
name: z.string(),
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
"attribute_value": "attributeValue",
|
|
222
|
-
});
|
|
233
|
+
key: z.string(),
|
|
234
|
+
type: z.literal("date").optional(),
|
|
235
|
+
value: z.string().datetime({ offset: true }).transform(v => new Date(v)),
|
|
223
236
|
});
|
|
224
237
|
|
|
225
238
|
/** @internal */
|
|
226
239
|
export type DateAttribute$Outbound = {
|
|
227
|
-
attribute_type: "date";
|
|
228
|
-
attribute_value: string;
|
|
229
240
|
id: string;
|
|
230
241
|
name: string;
|
|
242
|
+
key: string;
|
|
243
|
+
type: "date";
|
|
244
|
+
value: string;
|
|
231
245
|
};
|
|
232
246
|
|
|
233
247
|
/** @internal */
|
|
@@ -236,15 +250,11 @@ export const DateAttribute$outboundSchema: z.ZodType<
|
|
|
236
250
|
z.ZodTypeDef,
|
|
237
251
|
DateAttribute
|
|
238
252
|
> = z.object({
|
|
239
|
-
attributeType: z.literal("date").default("date" as const),
|
|
240
|
-
attributeValue: z.date().transform(v => v.toISOString()),
|
|
241
253
|
id: z.string(),
|
|
242
254
|
name: z.string(),
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
attributeValue: "attribute_value",
|
|
247
|
-
});
|
|
255
|
+
key: z.string(),
|
|
256
|
+
type: z.literal("date").default("date" as const),
|
|
257
|
+
value: z.date().transform(v => v.toISOString()),
|
|
248
258
|
});
|
|
249
259
|
|
|
250
260
|
/**
|
|
@@ -280,23 +290,20 @@ export const TextAttribute$inboundSchema: z.ZodType<
|
|
|
280
290
|
z.ZodTypeDef,
|
|
281
291
|
unknown
|
|
282
292
|
> = z.object({
|
|
283
|
-
attribute_type: z.literal("text").optional(),
|
|
284
|
-
attribute_value: z.string(),
|
|
285
293
|
id: z.string(),
|
|
286
294
|
name: z.string(),
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
"attribute_value": "attributeValue",
|
|
291
|
-
});
|
|
295
|
+
key: z.string().optional(),
|
|
296
|
+
type: z.literal("text").optional(),
|
|
297
|
+
value: z.string(),
|
|
292
298
|
});
|
|
293
299
|
|
|
294
300
|
/** @internal */
|
|
295
301
|
export type TextAttribute$Outbound = {
|
|
296
|
-
attribute_type: "text";
|
|
297
|
-
attribute_value: string;
|
|
298
302
|
id: string;
|
|
299
303
|
name: string;
|
|
304
|
+
key?: string | undefined;
|
|
305
|
+
type: "text";
|
|
306
|
+
value: string;
|
|
300
307
|
};
|
|
301
308
|
|
|
302
309
|
/** @internal */
|
|
@@ -305,15 +312,11 @@ export const TextAttribute$outboundSchema: z.ZodType<
|
|
|
305
312
|
z.ZodTypeDef,
|
|
306
313
|
TextAttribute
|
|
307
314
|
> = z.object({
|
|
308
|
-
attributeType: z.literal("text").default("text" as const),
|
|
309
|
-
attributeValue: z.string(),
|
|
310
315
|
id: z.string(),
|
|
311
316
|
name: z.string(),
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
attributeValue: "attribute_value",
|
|
316
|
-
});
|
|
317
|
+
key: z.string().optional(),
|
|
318
|
+
type: z.literal("text").default("text" as const),
|
|
319
|
+
value: z.string(),
|
|
317
320
|
});
|
|
318
321
|
|
|
319
322
|
/**
|
|
@@ -349,23 +352,20 @@ export const MultiSelectAttribute$inboundSchema: z.ZodType<
|
|
|
349
352
|
z.ZodTypeDef,
|
|
350
353
|
unknown
|
|
351
354
|
> = z.object({
|
|
352
|
-
attribute_type: z.literal("multi-select").optional(),
|
|
353
|
-
attribute_value: z.array(z.string()),
|
|
354
355
|
id: z.string(),
|
|
355
356
|
name: z.string(),
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
"attribute_value": "attributeValue",
|
|
360
|
-
});
|
|
357
|
+
key: z.string(),
|
|
358
|
+
type: z.literal("multi-select").optional(),
|
|
359
|
+
value: z.array(z.string()),
|
|
361
360
|
});
|
|
362
361
|
|
|
363
362
|
/** @internal */
|
|
364
363
|
export type MultiSelectAttribute$Outbound = {
|
|
365
|
-
attribute_type: "multi-select";
|
|
366
|
-
attribute_value: Array<string>;
|
|
367
364
|
id: string;
|
|
368
365
|
name: string;
|
|
366
|
+
key: string;
|
|
367
|
+
type: "multi-select";
|
|
368
|
+
value: Array<string>;
|
|
369
369
|
};
|
|
370
370
|
|
|
371
371
|
/** @internal */
|
|
@@ -374,15 +374,11 @@ export const MultiSelectAttribute$outboundSchema: z.ZodType<
|
|
|
374
374
|
z.ZodTypeDef,
|
|
375
375
|
MultiSelectAttribute
|
|
376
376
|
> = z.object({
|
|
377
|
-
attributeType: z.literal("multi-select").default("multi-select" as const),
|
|
378
|
-
attributeValue: z.array(z.string()),
|
|
379
377
|
id: z.string(),
|
|
380
378
|
name: z.string(),
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
attributeValue: "attribute_value",
|
|
385
|
-
});
|
|
379
|
+
key: z.string(),
|
|
380
|
+
type: z.literal("multi-select").default("multi-select" as const),
|
|
381
|
+
value: z.array(z.string()),
|
|
386
382
|
});
|
|
387
383
|
|
|
388
384
|
/**
|
|
@@ -422,23 +418,20 @@ export const SingleSelectAttribute$inboundSchema: z.ZodType<
|
|
|
422
418
|
z.ZodTypeDef,
|
|
423
419
|
unknown
|
|
424
420
|
> = z.object({
|
|
425
|
-
attribute_type: z.literal("single-select").optional(),
|
|
426
|
-
attribute_value: z.string(),
|
|
427
421
|
id: z.string(),
|
|
428
422
|
name: z.string(),
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
"attribute_value": "attributeValue",
|
|
433
|
-
});
|
|
423
|
+
key: z.string(),
|
|
424
|
+
type: z.literal("single-select").optional(),
|
|
425
|
+
value: z.string(),
|
|
434
426
|
});
|
|
435
427
|
|
|
436
428
|
/** @internal */
|
|
437
429
|
export type SingleSelectAttribute$Outbound = {
|
|
438
|
-
attribute_type: "single-select";
|
|
439
|
-
attribute_value: string;
|
|
440
430
|
id: string;
|
|
441
431
|
name: string;
|
|
432
|
+
key: string;
|
|
433
|
+
type: "single-select";
|
|
434
|
+
value: string;
|
|
442
435
|
};
|
|
443
436
|
|
|
444
437
|
/** @internal */
|
|
@@ -447,15 +440,11 @@ export const SingleSelectAttribute$outboundSchema: z.ZodType<
|
|
|
447
440
|
z.ZodTypeDef,
|
|
448
441
|
SingleSelectAttribute
|
|
449
442
|
> = z.object({
|
|
450
|
-
attributeType: z.literal("single-select").default("single-select" as const),
|
|
451
|
-
attributeValue: z.string(),
|
|
452
443
|
id: z.string(),
|
|
453
444
|
name: z.string(),
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
attributeValue: "attribute_value",
|
|
458
|
-
});
|
|
445
|
+
key: z.string(),
|
|
446
|
+
type: z.literal("single-select").default("single-select" as const),
|
|
447
|
+
value: z.string(),
|
|
459
448
|
});
|
|
460
449
|
|
|
461
450
|
/**
|
|
@@ -490,8 +479,8 @@ export function singleSelectAttributeFromJSON(
|
|
|
490
479
|
}
|
|
491
480
|
|
|
492
481
|
/** @internal */
|
|
493
|
-
export const
|
|
494
|
-
|
|
482
|
+
export const ColorAttributeValue$inboundSchema: z.ZodType<
|
|
483
|
+
ColorAttributeValue,
|
|
495
484
|
z.ZodTypeDef,
|
|
496
485
|
unknown
|
|
497
486
|
> = z.object({
|
|
@@ -500,16 +489,16 @@ export const AttributeValue$inboundSchema: z.ZodType<
|
|
|
500
489
|
});
|
|
501
490
|
|
|
502
491
|
/** @internal */
|
|
503
|
-
export type
|
|
492
|
+
export type ColorAttributeValue$Outbound = {
|
|
504
493
|
name: string;
|
|
505
494
|
hexcode: string;
|
|
506
495
|
};
|
|
507
496
|
|
|
508
497
|
/** @internal */
|
|
509
|
-
export const
|
|
510
|
-
|
|
498
|
+
export const ColorAttributeValue$outboundSchema: z.ZodType<
|
|
499
|
+
ColorAttributeValue$Outbound,
|
|
511
500
|
z.ZodTypeDef,
|
|
512
|
-
|
|
501
|
+
ColorAttributeValue
|
|
513
502
|
> = z.object({
|
|
514
503
|
name: z.string(),
|
|
515
504
|
hexcode: z.string(),
|
|
@@ -519,26 +508,30 @@ export const AttributeValue$outboundSchema: z.ZodType<
|
|
|
519
508
|
* @internal
|
|
520
509
|
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
521
510
|
*/
|
|
522
|
-
export namespace
|
|
523
|
-
/** @deprecated use `
|
|
524
|
-
export const inboundSchema =
|
|
525
|
-
/** @deprecated use `
|
|
526
|
-
export const outboundSchema =
|
|
527
|
-
/** @deprecated use `
|
|
528
|
-
export type Outbound =
|
|
511
|
+
export namespace ColorAttributeValue$ {
|
|
512
|
+
/** @deprecated use `ColorAttributeValue$inboundSchema` instead. */
|
|
513
|
+
export const inboundSchema = ColorAttributeValue$inboundSchema;
|
|
514
|
+
/** @deprecated use `ColorAttributeValue$outboundSchema` instead. */
|
|
515
|
+
export const outboundSchema = ColorAttributeValue$outboundSchema;
|
|
516
|
+
/** @deprecated use `ColorAttributeValue$Outbound` instead. */
|
|
517
|
+
export type Outbound = ColorAttributeValue$Outbound;
|
|
529
518
|
}
|
|
530
519
|
|
|
531
|
-
export function
|
|
532
|
-
|
|
520
|
+
export function colorAttributeValueToJSON(
|
|
521
|
+
colorAttributeValue: ColorAttributeValue,
|
|
522
|
+
): string {
|
|
523
|
+
return JSON.stringify(
|
|
524
|
+
ColorAttributeValue$outboundSchema.parse(colorAttributeValue),
|
|
525
|
+
);
|
|
533
526
|
}
|
|
534
527
|
|
|
535
|
-
export function
|
|
528
|
+
export function colorAttributeValueFromJSON(
|
|
536
529
|
jsonString: string,
|
|
537
|
-
): SafeParseResult<
|
|
530
|
+
): SafeParseResult<ColorAttributeValue, SDKValidationError> {
|
|
538
531
|
return safeParse(
|
|
539
532
|
jsonString,
|
|
540
|
-
(x) =>
|
|
541
|
-
`Failed to parse '
|
|
533
|
+
(x) => ColorAttributeValue$inboundSchema.parse(JSON.parse(x)),
|
|
534
|
+
`Failed to parse 'ColorAttributeValue' from JSON`,
|
|
542
535
|
);
|
|
543
536
|
}
|
|
544
537
|
|
|
@@ -548,23 +541,20 @@ export const ColorAttribute$inboundSchema: z.ZodType<
|
|
|
548
541
|
z.ZodTypeDef,
|
|
549
542
|
unknown
|
|
550
543
|
> = z.object({
|
|
551
|
-
attribute_type: z.literal("color").optional(),
|
|
552
|
-
attribute_value: z.array(z.lazy(() => AttributeValue$inboundSchema)),
|
|
553
544
|
id: z.string(),
|
|
554
545
|
name: z.string(),
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
"attribute_value": "attributeValue",
|
|
559
|
-
});
|
|
546
|
+
key: z.string(),
|
|
547
|
+
type: z.literal("color").optional(),
|
|
548
|
+
value: z.array(z.lazy(() => ColorAttributeValue$inboundSchema)),
|
|
560
549
|
});
|
|
561
550
|
|
|
562
551
|
/** @internal */
|
|
563
552
|
export type ColorAttribute$Outbound = {
|
|
564
|
-
attribute_type: "color";
|
|
565
|
-
attribute_value: Array<AttributeValue$Outbound>;
|
|
566
553
|
id: string;
|
|
567
554
|
name: string;
|
|
555
|
+
key: string;
|
|
556
|
+
type: "color";
|
|
557
|
+
value: Array<ColorAttributeValue$Outbound>;
|
|
568
558
|
};
|
|
569
559
|
|
|
570
560
|
/** @internal */
|
|
@@ -573,15 +563,11 @@ export const ColorAttribute$outboundSchema: z.ZodType<
|
|
|
573
563
|
z.ZodTypeDef,
|
|
574
564
|
ColorAttribute
|
|
575
565
|
> = z.object({
|
|
576
|
-
attributeType: z.literal("color").default("color" as const),
|
|
577
|
-
attributeValue: z.array(z.lazy(() => AttributeValue$outboundSchema)),
|
|
578
566
|
id: z.string(),
|
|
579
567
|
name: z.string(),
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
attributeValue: "attribute_value",
|
|
584
|
-
});
|
|
568
|
+
key: z.string(),
|
|
569
|
+
type: z.literal("color").default("color" as const),
|
|
570
|
+
value: z.array(z.lazy(() => ColorAttributeValue$outboundSchema)),
|
|
585
571
|
});
|
|
586
572
|
|
|
587
573
|
/**
|
|
@@ -618,45 +604,39 @@ export const ProductAttribute$inboundSchema: z.ZodType<
|
|
|
618
604
|
unknown
|
|
619
605
|
> = z.union([
|
|
620
606
|
z.lazy(() => ColorAttribute$inboundSchema).and(
|
|
621
|
-
z.object({
|
|
622
|
-
attributeType: v.attribute_type,
|
|
623
|
-
})),
|
|
607
|
+
z.object({ type: z.literal("color") }).transform((v) => ({ type: v.type })),
|
|
624
608
|
),
|
|
625
609
|
z.lazy(() => SingleSelectAttribute$inboundSchema).and(
|
|
626
|
-
z.object({
|
|
627
|
-
|
|
610
|
+
z.object({ type: z.literal("single-select") }).transform((v) => ({
|
|
611
|
+
type: v.type,
|
|
628
612
|
})),
|
|
629
613
|
),
|
|
630
614
|
z.lazy(() => MultiSelectAttribute$inboundSchema).and(
|
|
631
|
-
z.object({
|
|
632
|
-
|
|
615
|
+
z.object({ type: z.literal("multi-select") }).transform((v) => ({
|
|
616
|
+
type: v.type,
|
|
633
617
|
})),
|
|
634
618
|
),
|
|
635
619
|
z.lazy(() => TextAttribute$inboundSchema).and(
|
|
636
|
-
z.object({
|
|
637
|
-
attributeType: v.attribute_type,
|
|
638
|
-
})),
|
|
620
|
+
z.object({ type: z.literal("text") }).transform((v) => ({ type: v.type })),
|
|
639
621
|
),
|
|
640
622
|
z.lazy(() => DateAttribute$inboundSchema).and(
|
|
641
|
-
z.object({
|
|
642
|
-
attributeType: v.attribute_type,
|
|
643
|
-
})),
|
|
623
|
+
z.object({ type: z.literal("date") }).transform((v) => ({ type: v.type })),
|
|
644
624
|
),
|
|
645
625
|
z.lazy(() => NumberAttribute$inboundSchema).and(
|
|
646
|
-
z.object({
|
|
647
|
-
|
|
626
|
+
z.object({ type: z.literal("number") }).transform((v) => ({
|
|
627
|
+
type: v.type,
|
|
648
628
|
})),
|
|
649
629
|
),
|
|
650
630
|
]);
|
|
651
631
|
|
|
652
632
|
/** @internal */
|
|
653
633
|
export type ProductAttribute$Outbound =
|
|
654
|
-
| (ColorAttribute$Outbound & {
|
|
655
|
-
| (SingleSelectAttribute$Outbound & {
|
|
656
|
-
| (MultiSelectAttribute$Outbound & {
|
|
657
|
-
| (TextAttribute$Outbound & {
|
|
658
|
-
| (DateAttribute$Outbound & {
|
|
659
|
-
| (NumberAttribute$Outbound & {
|
|
634
|
+
| (ColorAttribute$Outbound & { type: "color" })
|
|
635
|
+
| (SingleSelectAttribute$Outbound & { type: "single-select" })
|
|
636
|
+
| (MultiSelectAttribute$Outbound & { type: "multi-select" })
|
|
637
|
+
| (TextAttribute$Outbound & { type: "text" })
|
|
638
|
+
| (DateAttribute$Outbound & { type: "date" })
|
|
639
|
+
| (NumberAttribute$Outbound & { type: "number" });
|
|
660
640
|
|
|
661
641
|
/** @internal */
|
|
662
642
|
export const ProductAttribute$outboundSchema: z.ZodType<
|
|
@@ -665,33 +645,27 @@ export const ProductAttribute$outboundSchema: z.ZodType<
|
|
|
665
645
|
ProductAttribute
|
|
666
646
|
> = z.union([
|
|
667
647
|
z.lazy(() => ColorAttribute$outboundSchema).and(
|
|
668
|
-
z.object({
|
|
669
|
-
attribute_type: v.attributeType,
|
|
670
|
-
})),
|
|
648
|
+
z.object({ type: z.literal("color") }).transform((v) => ({ type: v.type })),
|
|
671
649
|
),
|
|
672
650
|
z.lazy(() => SingleSelectAttribute$outboundSchema).and(
|
|
673
|
-
z.object({
|
|
674
|
-
|
|
651
|
+
z.object({ type: z.literal("single-select") }).transform((v) => ({
|
|
652
|
+
type: v.type,
|
|
675
653
|
})),
|
|
676
654
|
),
|
|
677
655
|
z.lazy(() => MultiSelectAttribute$outboundSchema).and(
|
|
678
|
-
z.object({
|
|
679
|
-
|
|
656
|
+
z.object({ type: z.literal("multi-select") }).transform((v) => ({
|
|
657
|
+
type: v.type,
|
|
680
658
|
})),
|
|
681
659
|
),
|
|
682
660
|
z.lazy(() => TextAttribute$outboundSchema).and(
|
|
683
|
-
z.object({
|
|
684
|
-
attribute_type: v.attributeType,
|
|
685
|
-
})),
|
|
661
|
+
z.object({ type: z.literal("text") }).transform((v) => ({ type: v.type })),
|
|
686
662
|
),
|
|
687
663
|
z.lazy(() => DateAttribute$outboundSchema).and(
|
|
688
|
-
z.object({
|
|
689
|
-
attribute_type: v.attributeType,
|
|
690
|
-
})),
|
|
664
|
+
z.object({ type: z.literal("date") }).transform((v) => ({ type: v.type })),
|
|
691
665
|
),
|
|
692
666
|
z.lazy(() => NumberAttribute$outboundSchema).and(
|
|
693
|
-
z.object({
|
|
694
|
-
|
|
667
|
+
z.object({ type: z.literal("number") }).transform((v) => ({
|
|
668
|
+
type: v.type,
|
|
695
669
|
})),
|
|
696
670
|
),
|
|
697
671
|
]);
|
|
@@ -20,7 +20,7 @@ export type ChildCategories = {
|
|
|
20
20
|
export type ProductCategory = {
|
|
21
21
|
id: string;
|
|
22
22
|
name: string;
|
|
23
|
-
description
|
|
23
|
+
description?: string | null | undefined;
|
|
24
24
|
parentCategoryId?: string | null | undefined;
|
|
25
25
|
productCount?: number | undefined;
|
|
26
26
|
active: boolean;
|
|
@@ -112,7 +112,7 @@ export const ProductCategory$inboundSchema: z.ZodType<
|
|
|
112
112
|
> = z.object({
|
|
113
113
|
id: z.string(),
|
|
114
114
|
name: z.string(),
|
|
115
|
-
description: z.string(),
|
|
115
|
+
description: z.nullable(z.string()).optional(),
|
|
116
116
|
parent_category_id: z.nullable(z.string()).optional(),
|
|
117
117
|
product_count: z.number().int().optional(),
|
|
118
118
|
active: z.boolean(),
|
|
@@ -131,7 +131,7 @@ export const ProductCategory$inboundSchema: z.ZodType<
|
|
|
131
131
|
export type ProductCategory$Outbound = {
|
|
132
132
|
id: string;
|
|
133
133
|
name: string;
|
|
134
|
-
description
|
|
134
|
+
description?: string | null | undefined;
|
|
135
135
|
parent_category_id?: string | null | undefined;
|
|
136
136
|
product_count?: number | undefined;
|
|
137
137
|
active: boolean;
|
|
@@ -146,7 +146,7 @@ export const ProductCategory$outboundSchema: z.ZodType<
|
|
|
146
146
|
> = z.object({
|
|
147
147
|
id: z.string(),
|
|
148
148
|
name: z.string(),
|
|
149
|
-
description: z.string(),
|
|
149
|
+
description: z.nullable(z.string()).optional(),
|
|
150
150
|
parentCategoryId: z.nullable(z.string()).optional(),
|
|
151
151
|
productCount: z.number().int().optional(),
|
|
152
152
|
active: z.boolean(),
|