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.
Files changed (158) hide show
  1. package/esm/lib/config.d.ts +3 -3
  2. package/esm/lib/config.js +3 -3
  3. package/esm/models/components/analyticsevent.d.ts +8 -8
  4. package/esm/models/components/analyticsevent.d.ts.map +1 -1
  5. package/esm/models/components/analyticsevent.js +12 -12
  6. package/esm/models/components/analyticsevent.js.map +1 -1
  7. package/esm/models/components/associatedoption.d.ts +125 -0
  8. package/esm/models/components/associatedoption.d.ts.map +1 -0
  9. package/esm/models/components/associatedoption.js +107 -0
  10. package/esm/models/components/associatedoption.js.map +1 -0
  11. package/esm/models/components/bundleproduct.d.ts +236 -0
  12. package/esm/models/components/bundleproduct.d.ts.map +1 -0
  13. package/esm/models/components/bundleproduct.js +262 -0
  14. package/esm/models/components/bundleproduct.js.map +1 -0
  15. package/esm/models/components/bundleproductdetail.d.ts +265 -0
  16. package/esm/models/components/bundleproductdetail.d.ts.map +1 -0
  17. package/esm/models/components/bundleproductdetail.js +288 -0
  18. package/esm/models/components/bundleproductdetail.js.map +1 -0
  19. package/esm/models/components/cart.d.ts +15 -15
  20. package/esm/models/components/cart.d.ts.map +1 -1
  21. package/esm/models/components/cart.js +15 -15
  22. package/esm/models/components/cart.js.map +1 -1
  23. package/esm/models/components/discountbasedpromotion.d.ts +0 -2
  24. package/esm/models/components/discountbasedpromotion.d.ts.map +1 -1
  25. package/esm/models/components/discountbasedpromotion.js +0 -4
  26. package/esm/models/components/discountbasedpromotion.js.map +1 -1
  27. package/esm/models/components/fixedpricepromotion.d.ts +0 -2
  28. package/esm/models/components/fixedpricepromotion.d.ts.map +1 -1
  29. package/esm/models/components/fixedpricepromotion.js +0 -4
  30. package/esm/models/components/fixedpricepromotion.js.map +1 -1
  31. package/esm/models/components/freegoodspromotion.d.ts +0 -5
  32. package/esm/models/components/freegoodspromotion.d.ts.map +1 -1
  33. package/esm/models/components/freegoodspromotion.js +0 -4
  34. package/esm/models/components/freegoodspromotion.js.map +1 -1
  35. package/esm/models/components/index.d.ts +8 -6
  36. package/esm/models/components/index.d.ts.map +1 -1
  37. package/esm/models/components/index.js +8 -6
  38. package/esm/models/components/index.js.map +1 -1
  39. package/esm/models/components/productattribute.d.ts +97 -64
  40. package/esm/models/components/productattribute.d.ts.map +1 -1
  41. package/esm/models/components/productattribute.js +67 -128
  42. package/esm/models/components/productattribute.js.map +1 -1
  43. package/esm/models/components/productcategory.d.ts +2 -2
  44. package/esm/models/components/productcategory.d.ts.map +1 -1
  45. package/esm/models/components/productcategory.js +2 -2
  46. package/esm/models/components/productcategory.js.map +1 -1
  47. package/esm/models/components/productdetail.d.ts +16 -188
  48. package/esm/models/components/productdetail.d.ts.map +1 -1
  49. package/esm/models/components/productdetail.js +26 -228
  50. package/esm/models/components/productdetail.js.map +1 -1
  51. package/esm/models/components/productlistresponse.d.ts +49 -3
  52. package/esm/models/components/productlistresponse.d.ts.map +1 -1
  53. package/esm/models/components/productlistresponse.js +65 -3
  54. package/esm/models/components/productlistresponse.js.map +1 -1
  55. package/esm/models/components/productshipping.d.ts +13 -15
  56. package/esm/models/components/productshipping.d.ts.map +1 -1
  57. package/esm/models/components/productshipping.js +14 -18
  58. package/esm/models/components/productshipping.js.map +1 -1
  59. package/esm/models/components/{promotion.d.ts → promotiondetail.d.ts} +29 -29
  60. package/esm/models/components/promotiondetail.d.ts.map +1 -0
  61. package/esm/models/components/{promotion.js → promotiondetail.js} +29 -29
  62. package/esm/models/components/promotiondetail.js.map +1 -0
  63. package/esm/models/components/seo.d.ts +6 -6
  64. package/esm/models/components/seo.d.ts.map +1 -1
  65. package/esm/models/components/seo.js +6 -19
  66. package/esm/models/components/seo.js.map +1 -1
  67. package/esm/models/components/{product.d.ts → singleproduct.d.ts} +52 -75
  68. package/esm/models/components/singleproduct.d.ts.map +1 -0
  69. package/esm/models/components/{product.js → singleproduct.js} +37 -95
  70. package/esm/models/components/singleproduct.js.map +1 -0
  71. package/esm/models/components/singleproductdetail.d.ts +159 -0
  72. package/esm/models/components/singleproductdetail.d.ts.map +1 -0
  73. package/esm/models/components/singleproductdetail.js +156 -0
  74. package/esm/models/components/singleproductdetail.js.map +1 -0
  75. package/esm/models/components/{skuinfo.d.ts → sku.d.ts} +59 -48
  76. package/esm/models/components/sku.d.ts.map +1 -0
  77. package/esm/models/components/{skuinfo.js → sku.js} +67 -57
  78. package/esm/models/components/sku.js.map +1 -0
  79. package/esm/models/components/variant.d.ts +42 -72
  80. package/esm/models/components/variant.d.ts.map +1 -1
  81. package/esm/models/components/variant.js +39 -82
  82. package/esm/models/components/variant.js.map +1 -1
  83. package/esm/models/components/variantdetail.d.ts +101 -68
  84. package/esm/models/components/variantdetail.d.ts.map +1 -1
  85. package/esm/models/components/variantdetail.js +99 -71
  86. package/esm/models/components/variantdetail.js.map +1 -1
  87. package/esm/models/components/variantoption.d.ts +118 -0
  88. package/esm/models/components/variantoption.d.ts.map +1 -0
  89. package/esm/models/components/variantoption.js +114 -0
  90. package/esm/models/components/variantoption.js.map +1 -0
  91. package/esm/models/components/volumebasedpromotion.d.ts +0 -5
  92. package/esm/models/components/volumebasedpromotion.d.ts.map +1 -1
  93. package/esm/models/components/volumebasedpromotion.js +0 -4
  94. package/esm/models/components/volumebasedpromotion.js.map +1 -1
  95. package/esm/models/operations/getpromotions.d.ts +2 -2
  96. package/esm/models/operations/getpromotions.d.ts.map +1 -1
  97. package/esm/models/operations/getpromotions.js +2 -2
  98. package/esm/models/operations/getpromotions.js.map +1 -1
  99. package/esm/models/operations/getskus.d.ts +2 -2
  100. package/esm/models/operations/getskus.d.ts.map +1 -1
  101. package/esm/models/operations/getskus.js +2 -2
  102. package/esm/models/operations/getskus.js.map +1 -1
  103. package/esm/models/operations/getwishtlist.d.ts +2 -2
  104. package/esm/models/operations/getwishtlist.d.ts.map +1 -1
  105. package/esm/models/operations/getwishtlist.js +2 -2
  106. package/esm/models/operations/getwishtlist.js.map +1 -1
  107. package/jsr.json +1 -1
  108. package/package.json +1 -1
  109. package/src/lib/config.ts +3 -3
  110. package/src/models/components/analyticsevent.ts +16 -15
  111. package/src/models/components/associatedoption.ts +217 -0
  112. package/src/models/components/bundleproduct.ts +501 -0
  113. package/src/models/components/bundleproductdetail.ts +567 -0
  114. package/src/models/components/cart.ts +24 -24
  115. package/src/models/components/discountbasedpromotion.ts +0 -6
  116. package/src/models/components/fixedpricepromotion.ts +0 -6
  117. package/src/models/components/freegoodspromotion.ts +0 -9
  118. package/src/models/components/index.ts +8 -6
  119. package/src/models/components/productattribute.ts +162 -188
  120. package/src/models/components/productcategory.ts +4 -4
  121. package/src/models/components/productdetail.ts +52 -475
  122. package/src/models/components/productlistresponse.ts +147 -9
  123. package/src/models/components/productshipping.ts +27 -33
  124. package/src/models/components/{promotion.ts → promotiondetail.ts} +47 -45
  125. package/src/models/components/seo.ts +12 -25
  126. package/src/models/components/singleproduct.ts +269 -0
  127. package/src/models/components/singleproductdetail.ts +339 -0
  128. package/src/models/components/sku.ts +252 -0
  129. package/src/models/components/variant.ts +81 -170
  130. package/src/models/components/variantdetail.ts +189 -168
  131. package/src/models/components/variantoption.ts +214 -0
  132. package/src/models/components/volumebasedpromotion.ts +0 -9
  133. package/src/models/operations/getpromotions.ts +4 -4
  134. package/src/models/operations/getskus.ts +4 -4
  135. package/src/models/operations/getwishtlist.ts +4 -4
  136. package/esm/models/components/product.d.ts.map +0 -1
  137. package/esm/models/components/product.js.map +0 -1
  138. package/esm/models/components/productbundleitem.d.ts +0 -47
  139. package/esm/models/components/productbundleitem.d.ts.map +0 -1
  140. package/esm/models/components/productbundleitem.js +0 -66
  141. package/esm/models/components/productbundleitem.js.map +0 -1
  142. package/esm/models/components/productpackaging.d.ts +0 -68
  143. package/esm/models/components/productpackaging.d.ts.map +0 -1
  144. package/esm/models/components/productpackaging.js +0 -88
  145. package/esm/models/components/productpackaging.js.map +0 -1
  146. package/esm/models/components/promotion.d.ts.map +0 -1
  147. package/esm/models/components/promotion.js.map +0 -1
  148. package/esm/models/components/saleschannel.d.ts +0 -39
  149. package/esm/models/components/saleschannel.d.ts.map +0 -1
  150. package/esm/models/components/saleschannel.js +0 -53
  151. package/esm/models/components/saleschannel.js.map +0 -1
  152. package/esm/models/components/skuinfo.d.ts.map +0 -1
  153. package/esm/models/components/skuinfo.js.map +0 -1
  154. package/src/models/components/product.ts +0 -363
  155. package/src/models/components/productbundleitem.ts +0 -127
  156. package/src/models/components/productpackaging.ts +0 -162
  157. package/src/models/components/saleschannel.ts +0 -96
  158. 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 AttributeValue = {
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 & { attributeType: "color" })
129
- | (SingleSelectAttribute & { attributeType: "single-select" })
130
- | (MultiSelectAttribute & { attributeType: "multi-select" })
131
- | (TextAttribute & { attributeType: "text" })
132
- | (DateAttribute & { attributeType: "date" })
133
- | (NumberAttribute & { attributeType: "number" });
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
- }).transform((v) => {
146
- return remap$(v, {
147
- "attribute_type": "attributeType",
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
- }).transform((v) => {
171
- return remap$(v, {
172
- attributeType: "attribute_type",
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
- }).transform((v) => {
219
- return remap$(v, {
220
- "attribute_type": "attributeType",
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
- }).transform((v) => {
244
- return remap$(v, {
245
- attributeType: "attribute_type",
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
- }).transform((v) => {
288
- return remap$(v, {
289
- "attribute_type": "attributeType",
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
- }).transform((v) => {
313
- return remap$(v, {
314
- attributeType: "attribute_type",
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
- }).transform((v) => {
357
- return remap$(v, {
358
- "attribute_type": "attributeType",
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
- }).transform((v) => {
382
- return remap$(v, {
383
- attributeType: "attribute_type",
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
- }).transform((v) => {
430
- return remap$(v, {
431
- "attribute_type": "attributeType",
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
- }).transform((v) => {
455
- return remap$(v, {
456
- attributeType: "attribute_type",
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 AttributeValue$inboundSchema: z.ZodType<
494
- AttributeValue,
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 AttributeValue$Outbound = {
492
+ export type ColorAttributeValue$Outbound = {
504
493
  name: string;
505
494
  hexcode: string;
506
495
  };
507
496
 
508
497
  /** @internal */
509
- export const AttributeValue$outboundSchema: z.ZodType<
510
- AttributeValue$Outbound,
498
+ export const ColorAttributeValue$outboundSchema: z.ZodType<
499
+ ColorAttributeValue$Outbound,
511
500
  z.ZodTypeDef,
512
- AttributeValue
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 AttributeValue$ {
523
- /** @deprecated use `AttributeValue$inboundSchema` instead. */
524
- export const inboundSchema = AttributeValue$inboundSchema;
525
- /** @deprecated use `AttributeValue$outboundSchema` instead. */
526
- export const outboundSchema = AttributeValue$outboundSchema;
527
- /** @deprecated use `AttributeValue$Outbound` instead. */
528
- export type Outbound = AttributeValue$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 attributeValueToJSON(attributeValue: AttributeValue): string {
532
- return JSON.stringify(AttributeValue$outboundSchema.parse(attributeValue));
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 attributeValueFromJSON(
528
+ export function colorAttributeValueFromJSON(
536
529
  jsonString: string,
537
- ): SafeParseResult<AttributeValue, SDKValidationError> {
530
+ ): SafeParseResult<ColorAttributeValue, SDKValidationError> {
538
531
  return safeParse(
539
532
  jsonString,
540
- (x) => AttributeValue$inboundSchema.parse(JSON.parse(x)),
541
- `Failed to parse 'AttributeValue' from JSON`,
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
- }).transform((v) => {
556
- return remap$(v, {
557
- "attribute_type": "attributeType",
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
- }).transform((v) => {
581
- return remap$(v, {
582
- attributeType: "attribute_type",
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({ attribute_type: z.literal("color") }).transform((v) => ({
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({ attribute_type: z.literal("single-select") }).transform((v) => ({
627
- attributeType: v.attribute_type,
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({ attribute_type: z.literal("multi-select") }).transform((v) => ({
632
- attributeType: v.attribute_type,
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({ attribute_type: z.literal("text") }).transform((v) => ({
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({ attribute_type: z.literal("date") }).transform((v) => ({
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({ attribute_type: z.literal("number") }).transform((v) => ({
647
- attributeType: v.attribute_type,
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 & { attribute_type: "color" })
655
- | (SingleSelectAttribute$Outbound & { attribute_type: "single-select" })
656
- | (MultiSelectAttribute$Outbound & { attribute_type: "multi-select" })
657
- | (TextAttribute$Outbound & { attribute_type: "text" })
658
- | (DateAttribute$Outbound & { attribute_type: "date" })
659
- | (NumberAttribute$Outbound & { attribute_type: "number" });
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({ attributeType: z.literal("color") }).transform((v) => ({
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({ attributeType: z.literal("single-select") }).transform((v) => ({
674
- attribute_type: v.attributeType,
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({ attributeType: z.literal("multi-select") }).transform((v) => ({
679
- attribute_type: v.attributeType,
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({ attributeType: z.literal("text") }).transform((v) => ({
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({ attributeType: z.literal("date") }).transform((v) => ({
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({ attributeType: z.literal("number") }).transform((v) => ({
694
- attribute_type: v.attributeType,
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: string;
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: string;
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(),